http://learn.cemetech.net/index.php?title=TI-BASIC:Randbin&feed=atom&action=historyTI-BASIC:Randbin - Revision history2024-03-28T14:16:16ZRevision history for this page on the wikiMediaWiki 1.34.0http://learn.cemetech.net/index.php?title=TI-BASIC:Randbin&diff=585&oldid=prevMaintenance script: Initial automated import2016-02-24T18:08:36Z<p>Initial automated import</p>
<p><b>New page</b></p><div>{{Template:TI-BASIC:Command<br />
|picture=RANDBIN.GIF<br />
|summary=Generates a random number with the binomial distribution.<br />
|syntax=randBin(''n'',''p'',''# simulations'')<br />
|location=Press:<br />
# MATH to access the [[TI-BASIC:Math|Math]] menu.<br />
# LEFT to access the PRB submenu.<br />
# 7 to select randBin(, or use arrows.<br />
|compatibility=TI-83/84/+/SE<br />
|size=2 bytes<br />
}}<br />
<br />
randBin(''n'',''p'') generates a pseudorandom integer between 0 and ''n'' inclusive according to the binomial distribution B(''n'',''p'') - that is, ''n'' trials of an event with probability of success ''p'' are performed, and the number of successes is returned. randBin(''n'',''p'',''simulations'') performs the above calculation ''simulations'' times, and returns a list of the results. The expected (average) result is ''n''*''p''.<br />
<br />
''n'' should be an integer greater than or equal to 1, while ''p'' should be a real number between 0 and 1 inclusive.<br />
<br />
''seed''→rand affects the output of randBin(<br />
<br />
0→rand<br />
0<br />
randBin(5,1/2<br />
2<br />
randBin(5,1/2,10<br />
{3 3 2 4 3 2 2 2 4 3}<br />
<br />
= Formulas =<br />
<br />
The value of randBin( for a given seed can be expressed in terms of [[TI-BASIC:Rand|Rand]]:<br />
<br />
randBin(N,P)=sum(P>rand(N<br />
<br />
This is identical to the output of randBin( in the sense that for the same seed, both expressions will generate the same random numbers.<br />
<br />
= Error Conditions =<br />
<br />
* '''[[TI-BASIC:Errors#domain|ERR:DOMAIN]]''' is triggered if the probability is not on the interval from 0 to 1.<br />
<br />
= Related Commands =<br />
<br />
* [[TI-BASIC:Rand|Rand]]<br />
* [[TI-BASIC:Randint|RandInt(]]<br />
* [[TI-BASIC:Randnorm|RandNorm(]]<br />
* [[TI-BASIC:Randm|RandM(]]<br />
* [[TI-BASIC:Randintnorep|randIntNoRep(]][[Category:TI-BASIC]]<br />
[[Category:TIBD]]</div>Maintenance script