LogFAQs > #934539049

LurkerFAQs, Active DB, DB1, DB2, DB3, DB4, DB5, Database 6 ( 01.01.2020-07.18.2020 ), DB7, DB8, DB9, DB10, DB11, DB12, Clear
Topic List
Page List: 1
TopicSaveEstelle & LeonhartFour in Different Houses: Eclectic Edition [SELF]
xp1337
02/18/20 6:22:13 AM
#286:


Yeah, that's what I did.!
I went and wrote a short program on my calculator that runs and displays the binomial and cumulative distribution functions on gacha odds

Mainly because I can't graph it on my TI-83 because the domain of (n choose k) is the natural numbers while the graphing function is over all reals so it would get mad. It's possible there's some functionality pre-built in there to get it to only use integers >= 1 but to find out I'd have to go dig out the manual just like how the catalog shows it has some binomial function built in but like hell do I know what parameters it wants or if it'd even be applicable here.

Faster to just give it a short program to do it:

Basically it prompts you for # of rolls, odds, and the "k" in (n choose k). Then it calculates and spits out P(0) before entering a simple while loop to run p^k(1-p)^(n-k)*(n choose k) and outputting the result while also tracking and spitting out the cumulative sum of P(k) (or rather 1-sum; where the sum was initialized to P(0) before the loop) before incrementing k. and the loop breaks once run k times (The way I was taught programming I would normally conceive this as a for loop but the way TI programming is it was just easier for me to make it a while loop and making a counter variable that stands in for k to break out once it reaches the user's inputted k at the start)

I just didn't get into the math behind the program there but that's what the actual program is doing.

---
xp1337: Don't you wish there was a spell-checker that told you when you a word out?
... Copied to Clipboard!
Topic List
Page List: 1