Difference between revisions of "HyperGeometric Command"

From GeoGebra Manual
Jump to: navigation, search
(command syntax: changed [ ] into ( ))
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.2}}</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|probability}}
{{command|cas=true|probability}}
+
;HyperGeometric( <Population Size>, <Number of Successes>, <Sample Size>):
;HyperGeometric[ <Population Size>, <Number of Successes>, <Sample Size>]:
 
 
: Returns a bar graph of a [[w:Hypergeometric distribution|Hypergeometric distribution]].
 
: Returns a bar graph of a [[w:Hypergeometric distribution|Hypergeometric distribution]].
 
:''Parameters:''
 
:''Parameters:''
Line 9: Line 8:
 
The bar graph shows the probability function of the number of white balls in the sample.
 
The bar graph shows the probability function of the number of white balls in the sample.
  
;HyperGeometric[ <Population Size>, <Number of Successes>, <Sample Size>, <Boolean Cumulative> ]
+
;HyperGeometric( <Population Size>, <Number of Successes>, <Sample Size>, <Boolean Cumulative> )
 
: Returns a bar graph of a Hypergeometric distribution when ''Cumulative'' = false.
 
: Returns a bar graph of a Hypergeometric distribution when ''Cumulative'' = false.
: Returns a bar graph of a cumulative Hypergeometric distribution when ''Cumulative'' = true.
+
: Returns the graph of a cumulative Hypergeometric distribution when ''Cumulative'' = true.
 
: First three parameters are same as above.
 
: First three parameters are same as above.
  
;HyperGeometric[ <Population Size>, <Number of Successes>, <Sample Size>, <Variable Value>, <Boolean Cumulative> ]
+
;HyperGeometric( <Population Size>, <Number of Successes>, <Sample Size>, <Variable Value>, <Boolean Cumulative> )
 
: Let X be a Hypergeometric random variable and v the variable value.
 
: Let X be a Hypergeometric random variable and v the variable value.
 
: Returns P( X = ''v'') when ''Cumulative'' = false.   
 
: Returns P( X = ''v'') when ''Cumulative'' = false.   
Line 21: Line 20:
  
 
==CAS Syntax==
 
==CAS Syntax==
;HyperGeometric[ <Population Size>, <Number of Successes>, <Sample Size>, <Variable Value>, <Boolean Cumulative> ]:
+
In the [[File:Menu view cas.svg|link=|16px]] [[CAS View]] you can use only the following syntax:
 +
 
 +
;HyperGeometric( <Population Size>, <Number of Successes>, <Sample Size>, <Variable Value>, <Boolean Cumulative> ):
 
:Let X be a Hypergeometric random variable and v the variable value.
 
:Let X be a Hypergeometric random variable and v the variable value.
 
:Returns P( X = ''v'') when ''Cumulative'' = false.   
 
:Returns P( X = ''v'') when ''Cumulative'' = false.   
Line 27: Line 28:
 
:The first three parameters are the same as above.
 
:The first three parameters are the same as above.
 
:{{example| 1=<div>Assume you select two balls out of ten balls, two of which are white, without putting any back.
 
:{{example| 1=<div>Assume you select two balls out of ten balls, two of which are white, without putting any back.
:*<code><nowiki>HyperGeometric[10, 2, 2, 0, false]</nowiki></code> yields <math>\frac{28}{45}</math>, the probability of selecting zero white balls,
+
:*<code><nowiki>HyperGeometric(10, 2, 2, 0, false)</nowiki></code> yields <math>\frac{28}{45}</math>, the probability of selecting zero white balls,
:*<code><nowiki>HyperGeometric[10, 2, 2, 1, false]</nowiki></code> yields <math>\frac{16}{45}</math>, the probability of selecting one white ball,
+
:*<code><nowiki>HyperGeometric(10, 2, 2, 1, false)</nowiki></code> yields <math>\frac{16}{45}</math>, the probability of selecting one white ball,
:*<code><nowiki>HyperGeometric[10, 2, 2, 2, false]</nowiki></code> yields <math>\frac{1}{45}</math>, the probability of selecting both white balls,
+
:*<code><nowiki>HyperGeometric(10, 2, 2, 2, false)</nowiki></code> yields <math>\frac{1}{45}</math>, the probability of selecting both white balls,
:*<code><nowiki>HyperGeometric[10, 2, 2, 3, false]</nowiki></code> yields ''0'', the probability of selecting three white balls.
+
:*<code><nowiki>HyperGeometric(10, 2, 2, 3, false)</nowiki></code> yields ''0'', the probability of selecting three white balls.
:*<code><nowiki>HyperGeometric[10, 2, 2, 0, true]</nowiki></code> yields <math>\frac{28}{45}</math>, the probability of selecting zero (or less) white balls,
+
:*<code><nowiki>HyperGeometric(10, 2, 2, 0, true)</nowiki></code> yields <math>\frac{28}{45}</math>, the probability of selecting zero (or less) white balls,
:*<code><nowiki>HyperGeometric[10, 2, 2, 1, true]</nowiki></code> yields <math>\frac{44}{45}</math>, the probability of selecting one or less white balls,
+
:*<code><nowiki>HyperGeometric(10, 2, 2, 1, true)</nowiki></code> yields <math>\frac{44}{45}</math>, the probability of selecting one or less white balls,
:*<code><nowiki>HyperGeometric[10, 2, 2, 2, true]</nowiki></code> yields ''1'', the probability of selecting two or less white balls and
+
:*<code><nowiki>HyperGeometric(10, 2, 2, 2, true)</nowiki></code> yields ''1'', the probability of selecting two or less white balls and
:*<code><nowiki>HyperGeometric[10, 2, 2, 3, true]</nowiki></code> yields ''1'', the probability of selecting three or less white balls.</div>}}
+
:*<code><nowiki>HyperGeometric(10, 2, 2, 3, true)</nowiki></code> yields ''1'', the probability of selecting three or less white balls.</div>}}

Latest revision as of 11:13, 11 October 2017


HyperGeometric( <Population Size>, <Number of Successes>, <Sample Size>)
Returns a bar graph of a Hypergeometric distribution.
Parameters:
Population size: number of balls in the urn
Number of Successes: number of white balls in the urn
Sample Size: number of balls drawn from the urn

The bar graph shows the probability function of the number of white balls in the sample.

HyperGeometric( <Population Size>, <Number of Successes>, <Sample Size>, <Boolean Cumulative> )
Returns a bar graph of a Hypergeometric distribution when Cumulative = false.
Returns the graph of a cumulative Hypergeometric distribution when Cumulative = true.
First three parameters are same as above.
HyperGeometric( <Population Size>, <Number of Successes>, <Sample Size>, <Variable Value>, <Boolean Cumulative> )
Let X be a Hypergeometric random variable and v the variable value.
Returns P( X = v) when Cumulative = false.
Returns P( X ≤ v) when Cumulative = true.
First three parameters are same as above.

CAS Syntax

In the Menu view cas.svg CAS View you can use only the following syntax:

HyperGeometric( <Population Size>, <Number of Successes>, <Sample Size>, <Variable Value>, <Boolean Cumulative> )
Let X be a Hypergeometric random variable and v the variable value.
Returns P( X = v) when Cumulative = false.
Returns P( X ≤ v) when Cumulative = true.
The first three parameters are the same as above.
Example:
Assume you select two balls out of ten balls, two of which are white, without putting any back.
  • HyperGeometric(10, 2, 2, 0, false) yields \frac{28}{45}, the probability of selecting zero white balls,
  • HyperGeometric(10, 2, 2, 1, false) yields \frac{16}{45}, the probability of selecting one white ball,
  • HyperGeometric(10, 2, 2, 2, false) yields \frac{1}{45}, the probability of selecting both white balls,
  • HyperGeometric(10, 2, 2, 3, false) yields 0, the probability of selecting three white balls.
  • HyperGeometric(10, 2, 2, 0, true) yields \frac{28}{45}, the probability of selecting zero (or less) white balls,
  • HyperGeometric(10, 2, 2, 1, true) yields \frac{44}{45}, the probability of selecting one or less white balls,
  • HyperGeometric(10, 2, 2, 2, true) yields 1, the probability of selecting two or less white balls and
  • HyperGeometric(10, 2, 2, 3, true) yields 1, the probability of selecting three or less white balls.
© 2024 International GeoGebra Institute