• To: mathgroup at smc.vnet.net
• From: Raffy <raffy at mac.com>
• Date: Thu, 26 Mar 2009 05:23:42 -0500 (EST)
• References: <gqd1o0\$nqq\$1@smc.vnet.net>

```On Mar 25, 3:41 am, Fabrizio <Tekciti... at hotmail.Com> wrote:
> There are 3 small problems.
>
> 1)Using the functions:
>
> Position, ReplacePart, Take, Drop, Part, Rest, First and Last
>
> I have to get { { 1 } , { 2 , 3 , 4 , 5 , 6 } } out of Range[ 6 ]
>
> 2) Using the functions:
>
> Table, Random, Range
>
> I have to get { {0} , { 0 , 2 } , { 0 , 2 , 4 } , { 0 , 2 , 4 , 6 } , { 0=
, 2 , 4 , 6 , 8 } } in TWO ways.
>
> ---> I found for this second problem:
>
> Table[ 2 * j - 2 , { i , 5 } , { j , i } ]
>
> but another method using the same functions ?
>
> 3)using the functions as in problem 1:
>
> Use the lists { a , b , c , d } and { 3 , 2 , 4 , 1 } to create the list =
{ c , b , d , a } in one step.
>
> complete moron

This seems like homework? :p

1. {Take[Range[6],1], Drop[Range[6],1]}

2a. 2*Table[j, {i, 0, 4}, {j, 0, i}]
2b. 2*Table[Range[0, i], {i, 0, 4}]

3. {a, b, c, d}[[{3, 2, 4, 1}]]

```

• Prev by Date: Re: help^please
• Next by Date: Re: help^please