Student Support Forum: 'fun function that looks at first position' topicStudent Support Forum > General > "fun function that looks at first position"

 Next Comment > Help | Reply To Topic
 Author Comment/Response prettyperla 09/22/11 3:14pm perlalist = {{{5, 1, "a"}, {6, 2, "b"}, {9, 3, "c"}}, {{10, 1, "a"}, {15, 2, "b"}, {10, 3, "c"}, {10, 4, "d"}}, {{100, 1, "d"}, {200, 2, "g"}, {300, 4, "t"}}}; I am trying to write code, that compares all the first positions and displays if the first position is x amount or more above all the rest. for this example, lets use x=5. Fyi, I will be using numbers like .00001, .0001, .001, .01 in my real code. if you look at the first part of the list, 9 is the highest, which is not 5 higher than all the rest, so nothing is displayed. In the second part of the list, 15 is 5 higher than all the rest of the first positions, so it is displayed. In the third part, 300 is more than 5 higher than all the rest of the first positions, so it is also displayed. fyi, this is just a small example of length 2. the real perla list could have a length of 10,000 and use more or less alphabet symbols output= {{15,2,"b"},{300,4,"t"}} Thanks in advance Attachment: experiments.nb, URL: ,

 Subject (listing for 'fun function that looks at first position') Author Date Posted fun function that looks at first position prettyperla 09/22/11 3:14pm Re: fun function that looks at first position yehuda ben-s... 09/25/11 07:22am
 Next Comment > Help | Reply To Topic