Difference between revisions of "BinomialDist Command"
From GeoGebra Manual
m |
|||
(23 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude>{{Manual Page|version= | + | <noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|probability}} |
− | {{command|probability}} | + | ;BinomialDist( <Number of Trials>, <Probability of Success> ) |
− | ;BinomialDist | ||
:Returns a bar graph of a [[w:Binomial distribution|Binomial distribution]]. | :Returns a bar graph of a [[w:Binomial distribution|Binomial distribution]]. | ||
− | : | + | :The parameter ''Number of Trials'' specifies the number of independent Bernoulli trials and the parameter ''Probability of Success'' specifies the probability of success in one trial. |
− | + | :{{Note|'''BinomialDist( <Number of Trials>, <Probability of Success>,<List of values>)''' is also available.}} | |
− | + | ;BinomialDist( <Number of Trials>, <Probability of Success>, <Boolean Cumulative> ) | |
− | ;BinomialDist | ||
:Returns a bar graph of a Binomial distribution when ''Cumulative'' = false. | :Returns a bar graph of a Binomial distribution when ''Cumulative'' = false. | ||
− | :Returns a | + | :Returns a graph of a cumulative Binomial distribution when ''Cumulative'' = true. |
:First two parameters are same as above. | :First two parameters are same as above. | ||
− | ;BinomialDist | + | ;BinomialDist( <Number of Trials>, <Probability of Success>, <Variable Value>, <Boolean Cumulative> ) |
− | :Let X be a Binomial random variable. | + | :Let X be a Binomial random variable and let v be the variable value. |
:Returns P( X = ''v'') when ''Cumulative'' = false. | :Returns P( X = ''v'') when ''Cumulative'' = false. | ||
:Returns P( X ≤ ''v'') when ''Cumulative'' = true. | :Returns P( X ≤ ''v'') when ''Cumulative'' = true. | ||
:First two parameters are same as above. | :First two parameters are same as above. | ||
+ | :{{Note|1=A simplified syntax is available to calculate P(''u'' ≤ X ≤ ''v''): e.g. <code>BinomialDist(10, 0.2, 1..3)</code> yields ''0.77175'', that is the same as BinomialDist(10, 0.2, {1, 2, 3}). This syntax also works in the CAS View}} | ||
+ | |||
==CAS Specific Syntax== | ==CAS Specific Syntax== | ||
− | In [[CAS View]] only one syntax is allowed: | + | In [[File:Menu view cas.svg|link=|16px]] [[CAS View]] only one syntax is allowed: |
− | ;BinomialDist | + | ;BinomialDist( <Number of Trials>, <Probability of Success>, <Variable Value>, <Boolean Cumulative> ) |
− | :Let X be a Binomial random variable. | + | :Let X be a Binomial random variable and let v be the variable value. |
:Returns P( X = ''v'') when ''Cumulative'' = false. | :Returns P( X = ''v'') when ''Cumulative'' = false. | ||
:Returns P( X ≤ ''v'') when ''Cumulative'' = true. | :Returns P( X ≤ ''v'') when ''Cumulative'' = true. | ||
+ | |||
+ | :{{example| 1=<div>You can plot a graph with eg <code>f(x):=BinomialDist(100,x,36,true)-BinomialDist(100,x,23,true)</code></div>}} | ||
:{{example| 1=<div>Assume transfering three packets of data over a faulty line. The chance an arbitrary packet transfered over this line becomes corrupted is <math>\frac{1}{10}</math>, hence the propability of transfering an arbitrary packet successfully is <math>\frac{9}{10}</math>. | :{{example| 1=<div>Assume transfering three packets of data over a faulty line. The chance an arbitrary packet transfered over this line becomes corrupted is <math>\frac{1}{10}</math>, hence the propability of transfering an arbitrary packet successfully is <math>\frac{9}{10}</math>. | ||
− | :*<code><nowiki>BinomialDist | + | :*<code><nowiki>BinomialDist(3, 0.9, 0, false)</nowiki></code> yields ''<math>\frac{1}{1000}</math>'', the probability of none of the three packets being transferred successfully. |
− | :*<code><nowiki>BinomialDist | + | :*<code><nowiki>BinomialDist(3, 0.9, 1, false)</nowiki></code> yields ''<math>\frac{27}{1000}</math>'', the probability of exactly one of three packets being transferred successfully. |
− | :*<code><nowiki>BinomialDist | + | :*<code><nowiki>BinomialDist(3, 0.9, 2, false)</nowiki></code> yields ''<math>\frac{243}{1000}</math>'', the probability of exactly two of three packets being transferred successfully. |
− | :*<code><nowiki>BinomialDist | + | :*<code><nowiki>BinomialDist(3, 0.9, 3, false)</nowiki></code> yields ''<math>\frac{729}{1000}</math>'', the probability of all three packets being transferred successfully. |
− | :*<code><nowiki>BinomialDist | + | :*<code><nowiki>BinomialDist(3, 0.9, 0, true)</nowiki></code> yields ''<math>\frac{1}{1000}</math>'', the probability of none of the three packets being transferred successfully. |
− | :*<code><nowiki>BinomialDist | + | :*<code><nowiki>BinomialDist(3, 0.9, 1, true)</nowiki></code> yields ''<math>\frac{7}{250}</math>'', the probability of at most one of three packets being transferred successfully. |
− | :*<code><nowiki>BinomialDist | + | :*<code><nowiki>BinomialDist(3, 0.9, 2, true)</nowiki></code> yields ''<math>\frac{271}{1000}</math>'', the probability of at most two of three packets being transferred successfully. |
− | :*<code><nowiki>BinomialDist | + | :*<code><nowiki>BinomialDist(3, 0.9, 3, true)</nowiki></code> yields ''1'', the probability of at most three of three packets being transferred successfully. |
− | :*<code><nowiki>BinomialDist | + | :*<code><nowiki>BinomialDist(3, 0.9, 4, false)</nowiki></code> yields ''0'', the probability of exactly four of three packets being transferred successfully. |
− | :*<code><nowiki>BinomialDist | + | :*<code><nowiki>BinomialDist(3, 0.9, 4, true)</nowiki></code> yields ''1'', the probability of at most four of three packets being transferred successfully.</div>}} |
Latest revision as of 01:01, 1 February 2024
- BinomialDist( <Number of Trials>, <Probability of Success> )
- Returns a bar graph of a Binomial distribution.
- The parameter Number of Trials specifies the number of independent Bernoulli trials and the parameter Probability of Success specifies the probability of success in one trial.
- Note: BinomialDist( <Number of Trials>, <Probability of Success>,<List of values>) is also available.
- BinomialDist( <Number of Trials>, <Probability of Success>, <Boolean Cumulative> )
- Returns a bar graph of a Binomial distribution when Cumulative = false.
- Returns a graph of a cumulative Binomial distribution when Cumulative = true.
- First two parameters are same as above.
- BinomialDist( <Number of Trials>, <Probability of Success>, <Variable Value>, <Boolean Cumulative> )
- Let X be a Binomial random variable and let v be the variable value.
- Returns P( X = v) when Cumulative = false.
- Returns P( X ≤ v) when Cumulative = true.
- First two parameters are same as above.
- Note: A simplified syntax is available to calculate P(u ≤ X ≤ v): e.g.
BinomialDist(10, 0.2, 1..3)
yields 0.77175, that is the same as BinomialDist(10, 0.2, {1, 2, 3}). This syntax also works in the CAS View
CAS Specific Syntax
In CAS View only one syntax is allowed:
- BinomialDist( <Number of Trials>, <Probability of Success>, <Variable Value>, <Boolean Cumulative> )
- Let X be a Binomial random variable and let v be the variable value.
- Returns P( X = v) when Cumulative = false.
- Returns P( X ≤ v) when Cumulative = true.
- Example:You can plot a graph with eg
f(x):=BinomialDist(100,x,36,true)-BinomialDist(100,x,23,true)
- Example:Assume transfering three packets of data over a faulty line. The chance an arbitrary packet transfered over this line becomes corrupted is \frac{1}{10}, hence the propability of transfering an arbitrary packet successfully is \frac{9}{10}.
BinomialDist(3, 0.9, 0, false)
yields \frac{1}{1000}, the probability of none of the three packets being transferred successfully.BinomialDist(3, 0.9, 1, false)
yields \frac{27}{1000}, the probability of exactly one of three packets being transferred successfully.BinomialDist(3, 0.9, 2, false)
yields \frac{243}{1000}, the probability of exactly two of three packets being transferred successfully.BinomialDist(3, 0.9, 3, false)
yields \frac{729}{1000}, the probability of all three packets being transferred successfully.BinomialDist(3, 0.9, 0, true)
yields \frac{1}{1000}, the probability of none of the three packets being transferred successfully.BinomialDist(3, 0.9, 1, true)
yields \frac{7}{250}, the probability of at most one of three packets being transferred successfully.BinomialDist(3, 0.9, 2, true)
yields \frac{271}{1000}, the probability of at most two of three packets being transferred successfully.BinomialDist(3, 0.9, 3, true)
yields 1, the probability of at most three of three packets being transferred successfully.BinomialDist(3, 0.9, 4, false)
yields 0, the probability of exactly four of three packets being transferred successfully.BinomialDist(3, 0.9, 4, true)
yields 1, the probability of at most four of three packets being transferred successfully.