Message Boards Message Boards

0
|
4355 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

help with this problem, I need generate a list with the function table

Posted 9 years ago

I need generate the next list with the function table:

{1,-1,1,-1,1,-1,1,-1,1,-1}, {-1,1,-1,1,-1,1,-1,1,-1}, {1.-1,-1,1,-1,1,-1}, {-1,1,-1,1,-1,1,-1}, {1,-1,1,-1,1,-1},
{-1,1,-1,1,-1}, {1,-1,1,-1}, {-1,1,-1}, {1,-1}, {-1}

I think use Table with j and i but use a potency par and odd with the number 1 for example:

Table[j^2, {j, -1, 1}, {j, 1}]

but with the previous function generate only {1},{1},{1}

please help me thank you

POSTED BY: Camilo Pacheco
Posted 9 years ago

There may be a more clever way to do this, but . . .

In[1]:= Table[Table[(-1)^n, {n, m, 1, -1}], {m, 10, 1, -1}]

Out[1]= {{1, -1, 1, -1, 1, -1, 1, -1, 1, -1}, {-1, 1, -1, 1, -1, 
  1, -1, 1, -1}, {1, -1, 1, -1, 1, -1, 1, -1}, {-1, 1, -1, 1, -1, 
  1, -1}, {1, -1, 1, -1, 1, -1}, {-1, 1, -1, 1, -1}, {1, -1, 
  1, -1}, {-1, 1, -1}, {1, -1}, {-1}}
POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract