Hello all,

I am currently in the process of making a program that computes the binomial theorem. I have decided to use lists to store all of the values. I have tried to make the program as "symbolic" as possible. For example, the user, read: myself, can type in an binomial expression and the calculator will parse the input into a few different custom lists, separating the input into terms, coefficients, variables and exponents. I am using the instring command along with certain numbers that I am using to symbolize what the user has typed in. After the program reads the expression into the first custom list, I would like to be able to remove any value that is equal to 71 or 72. I have read, Googled, youtubed etc. and have not had much luck in understanding how to remove unwanted numbers from a list and still keep the list in the previous order. As an example:

Code:
`{71, 1, 69, 4, 72→ʟEXPR`

I would like to remove the 71 and 72 but still keep in the list in the order it is. The 71 and 72 are numbers that I am interpreting as parentheses.

Code:
`{1, 69, 4→ʟEXPR`

Is there anyone who can walk me through how the statement

Code:
`seq(list  (X + (X≥N)), X, 1, dim(L1)-1`

works?

I am using a TI-84 Plus Silver Edition with OS 2.55, with a built in seq command wizard.

If need, I will try to post the code I have thus far.

So, as you may know, the arguments to seq() are:
Code:
`seq(expression, variable, start, end)`
It can be thought of as equivalent to:
Code:
```For(variable,start,end expression->Ans(variable-start+1 End```
In other words, it builds a list by plugging in values for variable from start to end, where the value of expression at each increment is an element of the list. So let's examine that code:
Code:
`seq(list  (X + (X≥N)), X, 1, dim(L1)-1`
The variable is X, so it will iterate X=1, X=2, ..., X=dim(L1)-1. This will make it output a list one element shorter than L1. Now for the hard part, the expression. When X<N, where N is the index of the element you want to remove, the expression will be equivalent to X + (0), because X≥N is 0 (false) when X<N, and 1 (true) when X≥N. When X≥N, the expression is equivalent to X+1, so it will essentially skip element N of the input list in the output list.

To remove your 71s and 72s, you could repeatedly apply this seq() operation until all the 71s or 72s were gone from the list. Another option would be cleverly constructing a list that would allow you to remove all the 71s and 72s in one pass of seq(). I'd be happy to show you that method if you want something faster than this.
After working through the example on paper,

seq(list(X+(X≥N)), X, 1, dim(list) - 1

I set N = 6. The new list that the calculator gave was

{1, 2, 3, 4, 5, 7, 8, 9, 0}

According to my calculations, when X = 9, the statement

seq(list(9+(9≥6) should evaluate to 10? However, according to the calculator, I am wrong, as it says that list(9) = 0. Maybe I am not completely following what is really happening. I am interested in seeing how you would remove all of the 71s and 72s with one pass of the seq command. Also, if I may ask, I would like to better understand how to perform such operations on lists, as I do not like to just Google someone else's code. I feel that in the long run, I would be better off knowing and understanding what I am coding.

Thank you for you time.

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.

»
» All times are UTC - 5 Hours

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