Omnimaga
Calculator Community => TI Calculators => TI-BASIC => Topic started by: MRide on September 02, 2010, 09:41:11 pm
-
Is it possible to have "If L1=L2"?
Specifically, I'm trying to add two lists together and see if they equal a third. I realize this is possible through a For( loop, but it seems too simple not to have a command that does this.
-
If Min(L1=L2
-
Thanks, I thought it would be that simple. I should really make sure I know all the list commands.
-
It actually took me a while to get that statement :P I needed it for a project a long time ago :)
-
Oh, well now I don't feel so bad. :P
-
Why does that work exactly?
-
Ok, lets say L1 = {1,2,0,4} and L2 = {1,2,3,0}
L1 = L2 == {1,1,0,0}
min({1,1,0,0}) = 0
Now if L1 = {1,2,3,4} and L2 = {1,2,3,4}
L1 = L2 == {1,1,1,1}
min({1,1,1,1}) = 1
-
Oh, ok. So basically you're just testing to see if there is a zero in any of the boolean between the lists?
-
Yep, which would mean that one of the elements is not the same :)
-
WOW, thanks so much for this! I never thought about doing that. I remember back in 2002 or 2003 I wondered how to do that, and never figured out. Nice trick you got there!
-
I love things like this :) Basic has its perks!
-
Yep, and there are still some crazy optimizations that I can never get no matter how long I stare at them :D
-
Yep, and there are still some crazy optimizations that I can never get no matter how long I stare at them :D
Like what?
-
Like binomcdf( (or pdf, I don't remember). I don't get how it works :P
-
Yeah same here. if you read one of the Illusiat 13 topics, Galandros explained it thoroughly and then I checked the TIBD page a few times. I never managed to understand how it works. so I stuck with a slower alternative x.x
-
I myself still dont understand how it works x.x its kinda weird
-
I don't even know what binomcdf does. Well, there are those who say it works, so I'll use it :)
-
Huh, maybe I'll look into it and try to explain it :) I know I've looked at it briefly but don't remember much. What do people use it for?
-
It's to replace seq(I,1,X somehow.
EDIT: It's here (http://www.unitedti.org/forum/index.php?s=4ba9d18da23e2eca59a12def3cb62411&showtopic=25&view=findpost&p=97478).
-
I know that its actually a statistical tool, but i have no idea how it manages to replace seq() o.O
-
Ugh, I'm trying to get it, but all the broken HTML in DarkerLine's post is really getting annoying :P
-
Ya, I tried to read it too. I understood it but I've forgotten now. If I remember though, though I'll read it again later to help, most of the replacement is because it is just a faster routine. But I'd have to check back and make sure.
-
Btw, I wrote a quick C# application that takes a webpage, and strips the stuff inside [ ], makes it soooo muucchhh easier to read, does anyone want me to post the non HTML filled text?
-
Mhmm that seems like a nice idea, it would make certain forum posts much easier to read
-
Okay, so as far as I can figure out, binomcdf(N,0 takes a probability (0 in this case) and somehow throws out a binomial list, and with 0, the list is N elements of 1, as in {1,1,1,.... Adding a cumSum( before it adds the ones to each total, resulting in {1,2,3,.... Somehow, it's faster than seq(I,I,1,N, probably because of all the floating-points used in the second :P
-
Interesting... And somehow you can use this for any combination of sequences?
-
No, I haven't had time to look into this yet but I remember this part. It doesn't work for all sequences, such as ones including lists. And although it should always be faster than a sequence that is replaced by this it is not always smaller.
-
I think it's only used for a list of {1,2,3,....
-
But i think if you were given a list like that, you could square it and get a polynomial list. I think any linear list can be transformed into a function if you mess with it enough o.O
-
Well I meant for seq( commands that contain a list inside of them. Unless I understood Builder's question wrong.
-
But i think if you were given a list like that, you could square it and get a polynomial list. I think any linear list can be transformed into a function if you mess with it enough o.O
When it gets complicated enough you might as well use seq( :P
But after a couple of tries, the binomcdf( thing creates a list of 100 elements in just 2 seconds, compared to 8.6 for the seq( equivalent, so it's gonna be faster for most cases, unless you need something really complex :P