Ok, well i guess this would fit in this topic...
I am working on a small Simulation program for AP Stats, and I would like to know how to get a "tally" you could say of certain numbers in a list. Like if i had a list of 0s, 1s and 2s, how could I count the 2s? Can anyone help me?
odogollie
Say you have a list such as the one you mentioned, containing 0s, 1s, and 2s. Say further that the list in L1. This code would return another list of the same length with 0 where there were not-2s and 1 where there were 2s:
Code: (L1=2)
Now, to count the number of 1s, just sum the entire list; the 0s won't make a difference, and each 1 is one 2:
Code: sum(L1=2)
Edit: Topic moved to TI-BASIC.
Ohhhhhh myyyy! Thank you so much!
odogollie wrote:
Ohhhhhh myyyy! Thank you so much!
Sure thing. Feel free to use this topic to post continued TI-BASIC list questions you may have.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
»
Go to Registration page
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum