Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Lists manipulation' topicStudent Support Forum > General > Archives > "Lists manipulation"

Next Comment >Help | Reply To Topic
Author Comment/Response
Mikel
06/27/06 10:59pm

Hi

I have several issues

I am constructing a set of ordered pairs with Table:
Table[{i,j},{i,6},{j,6}]. I want something like {{1,1},{1,2},...,{6,6}} but Mathematica outputs {{{1,1},{1,2},...,{6,6}}}, that is, it gives a nested list. How do I get output I want?

I also want to extract the pairs such that the first component is greater that the second, I tried using Cases[S,crit], where S=Table[{i,j},{i,6},{j,6}] and crit[l_List]:=If[l[[1]][[1]]>l[[1]][[2]],True,False], but Mathematica gives an error. What's wrong with this criteria?

In general, where can I find a tutorial on working with patterns within lists?

Thanks

URL: ,

Subject (listing for 'Lists manipulation')
Author Date Posted
Lists manipulation Mikel 06/27/06 10:59pm
Re: Lists manipulation yehuda ben-... 06/28/06 6:17pm
Re: Lists manipulation Alvin 06/28/06 8:55pm
Next Comment >Help | Reply To Topic