• To: mathgroup at smc.vnet.net
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Thu, 26 Mar 2009 05:22:57 -0500 (EST)
• References: <gqd1o0\$nqq\$1@smc.vnet.net>

```Hi,

look like a home work
1) Range[6] /. {a_, b__} :> {{a}, {b}}
2) Table[2*j, {i, 4}, {j, 0, i - 1}]
3) Part[{a, b, c, d}, #] & /@  {3, 2, 4, 1}

Regards
Jens

Fabrizio 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
>

```

• Prev by Date: Cycling through windows with a keyboard shortcut
• Next by Date: Re: help^please