Documentation for 8b1eab204b

This commit is contained in:
realstealthninja
2024-11-04 12:43:05 +00:00
parent 4fb6e622e9
commit a7bccf7d01
6732 changed files with 153919 additions and 365711 deletions

View File

@@ -1,3 +1,4 @@
<!-- HTML header for doxygen 1.12.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
@@ -5,10 +6,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: probability/binomial_dist.cpp File Reference</title>
<title>TheAlgorithms/C++: probability/binomial_dist.cpp File Reference</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
@@ -18,14 +24,24 @@
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
<script type="text/javascript">
window.MathJax = {
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
},
loader: {
load: ['[tex]/ams']
},
tex: {
macros: {},
packages: ['base','configmacros','ams']
}
};
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
<div id="projectname">TheAlgorithms/C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
<div id="projectbrief">All the algorithms implemented in C++</div>
</td>
</tr>
</tbody>
@@ -119,7 +136,9 @@ Include dependency graph for binomial_dist.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d56/binomial__dist_8cpp__incl.svg" width="163" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><table class="memberdecls">
</div>
<p><a href="../../d6/db0/binomial__dist_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a4416a7bc7fa87201883c54cdc4c82813" id="r_a4416a7bc7fa87201883c54cdc4c82813"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4416a7bc7fa87201883c54cdc4c82813">binomial_expected</a> (double n, double p)</td></tr>
@@ -145,6 +164,8 @@ Functions</h2></td></tr>
<li>p : probability of success</li>
<li>x : desired successes </li>
</ul>
<p class="definition">Definition in file <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html">binomial_dist.cpp</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a4416a7bc7fa87201883c54cdc4c82813" name="a4416a7bc7fa87201883c54cdc4c82813"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4416a7bc7fa87201883c54cdc4c82813">&#9670;&#160;</a></span>binomial_expected()</h2>
@@ -172,6 +193,8 @@ Functions</h2></td></tr>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>\(\mu=np\) </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html#l00022">22</a> of file <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html">binomial_dist.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 22</span>{ <span class="keywordflow">return</span> n * p; }</div>
</div><!-- fragment -->
</div>
@@ -207,23 +230,18 @@ Functions</h2></td></tr>
<p>calculates the probability of a result within a range (inclusive, inclusive) </p><dl class="section return"><dt>Returns</dt><dd>\(\displaystyle \left.P(n,p)\right|_{x_0}^{x_1} =
\sum_{i=x_0}^{x_1} P(i)
=\sum_{i=x_0}^{x_1} {n\choose i} p^i (1-p)^{n-i}\) </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html#l00074">74</a> of file <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html">binomial_dist.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 75</span> {</div>
<div class="line"><span class="lineno"> 76</span> <span class="keywordtype">double</span> <a class="code hl_namespace" href="../../d4/ded/namespaceprobability.html">probability</a> = 0;</div>
<div class="line"><span class="lineno"> 77</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = lower_bound; i &lt;= <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/upper_bound.html">upper_bound</a>; i++) {</div>
<div class="line"><span class="lineno"> 78</span> <a class="code hl_namespace" href="../../d4/ded/namespaceprobability.html">probability</a> += <a class="code hl_function" href="#a78d36635232e54b5d71fcbf1eac9a49a">nCr</a>(n, i) * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(p, i) * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(1 - p, n - i);</div>
<div class="line"><span class="lineno"> 77</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = lower_bound; i &lt;= upper_bound; i++) {</div>
<div class="line"><span class="lineno"> 78</span> <a class="code hl_namespace" href="../../d4/ded/namespaceprobability.html">probability</a> += <a class="code hl_function" href="#a78d36635232e54b5d71fcbf1eac9a49a">nCr</a>(n, i) * std::pow(p, i) * std::pow(1 - p, n - i);</div>
<div class="line"><span class="lineno"> 79</span> }</div>
<div class="line"><span class="lineno"> 80</span> <span class="keywordflow">return</span> <a class="code hl_namespace" href="../../d4/ded/namespaceprobability.html">probability</a>;</div>
<div class="line"><span class="lineno"> 81</span>}</div>
<div class="ttc" id="abinomial__dist_8cpp_html_a78d36635232e54b5d71fcbf1eac9a49a"><div class="ttname"><a href="#a78d36635232e54b5d71fcbf1eac9a49a">nCr</a></div><div class="ttdeci">double nCr(double n, double r)</div><div class="ttdef"><b>Definition</b> binomial_dist.cpp:47</div></div>
<div class="ttc" id="abinomial__dist_8cpp_html_a78d36635232e54b5d71fcbf1eac9a49a"><div class="ttname"><a href="#a78d36635232e54b5d71fcbf1eac9a49a">nCr</a></div><div class="ttdeci">double nCr(double n, double r)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/db0/binomial__dist_8cpp_source.html#l00047">binomial_dist.cpp:47</a></div></div>
<div class="ttc" id="anamespaceprobability_html"><div class="ttname"><a href="../../d4/ded/namespaceprobability.html">probability</a></div><div class="ttdoc">Probability algorithms.</div></div>
<div class="ttc" id="apow_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a></div><div class="ttdeci">T pow(T... args)</div></div>
<div class="ttc" id="aupper_bound_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/upper_bound.html">std::upper_bound</a></div><div class="ttdeci">T upper_bound(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d6/db0/binomial__dist_8cpp_a76ed6ce71415fb400b65f0656cef3d25_cgraph.svg" width="308" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><!-- fragment -->
</div>
</div>
<a id="af09e51f513cee647d41192ab0a872cdc" name="af09e51f513cee647d41192ab0a872cdc"></a>
@@ -252,17 +270,13 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>\(\sigma = \sqrt{\sigma^2} = \sqrt{n\cdot p\cdot (1-p)}\) </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 36</span> {</div>
<div class="line"><span class="lineno"> 37</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(<a class="code hl_function" href="#acd4dd4558031e4c5d045c801f73d8861">binomial_variance</a>(n, p));</div>
<div class="line"><span class="lineno"> 38</span>}</div>
<div class="ttc" id="abinomial__dist_8cpp_html_acd4dd4558031e4c5d045c801f73d8861"><div class="ttname"><a href="#acd4dd4558031e4c5d045c801f73d8861">binomial_variance</a></div><div class="ttdeci">double binomial_variance(double n, double p)</div><div class="ttdef"><b>Definition</b> binomial_dist.cpp:29</div></div>
<div class="ttc" id="asqrt_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a></div><div class="ttdeci">T sqrt(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d6/db0/binomial__dist_8cpp_af09e51f513cee647d41192ab0a872cdc_cgraph.svg" width="370" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<p class="definition">Definition at line <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html#l00036">36</a> of file <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html">binomial_dist.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 36</span> {</div>
<div class="line"><span class="lineno"> 37</span> <span class="keywordflow">return</span> std::sqrt(<a class="code hl_function" href="#acd4dd4558031e4c5d045c801f73d8861">binomial_variance</a>(n, p));</div>
<div class="line"><span class="lineno"> 38</span>}</div>
<div class="ttc" id="abinomial__dist_8cpp_html_acd4dd4558031e4c5d045c801f73d8861"><div class="ttname"><a href="#acd4dd4558031e4c5d045c801f73d8861">binomial_variance</a></div><div class="ttdeci">double binomial_variance(double n, double p)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/db0/binomial__dist_8cpp_source.html#l00029">binomial_dist.cpp:29</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="acd4dd4558031e4c5d045c801f73d8861" name="acd4dd4558031e4c5d045c801f73d8861"></a>
@@ -291,6 +305,8 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>\(\sigma^2 = n\cdot p\cdot (1-p)\) </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html#l00029">29</a> of file <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html">binomial_dist.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 29</span>{ <span class="keywordflow">return</span> n * p * (1 - p); }</div>
</div><!-- fragment -->
</div>
@@ -319,15 +335,12 @@ Here is the call graph for this function:</div>
</table>
</div><div class="memdoc">
<p>calculates the probability of exactly x successes </p><dl class="section return"><dt>Returns</dt><dd>\(\displaystyle P(n,p,x) = {n\choose x} p^x (1-p)^{n-x}\) </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 65</span> {</div>
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a78d36635232e54b5d71fcbf1eac9a49a">nCr</a>(n, x) * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(p, x) * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a>(1 - p, n - x);</div>
<div class="line"><span class="lineno"> 67</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d6/db0/binomial__dist_8cpp_a19ae0a6a2bd200fd1eb0e31b2bf4cc76_cgraph.svg" width="284" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<p class="definition">Definition at line <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html#l00065">65</a> of file <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html">binomial_dist.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 65</span> {</div>
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a78d36635232e54b5d71fcbf1eac9a49a">nCr</a>(n, x) * std::pow(p, x) * std::pow(1 - p, n - x);</div>
<div class="line"><span class="lineno"> 67</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
@@ -345,35 +358,30 @@ Here is the call graph for this function:</div>
</table>
</div><div class="memdoc">
<p>main function </p>
<p class="definition">Definition at line <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html#l00084">84</a> of file <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html">binomial_dist.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 84</span> {</div>
<div class="line"><span class="lineno"> 85</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;expected value : &quot;</span> &lt;&lt; <a class="code hl_function" href="#a4416a7bc7fa87201883c54cdc4c82813">binomial_expected</a>(100, 0.5)</div>
<div class="line"><span class="lineno"> 86</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 85</span> std::cout &lt;&lt; <span class="stringliteral">&quot;expected value : &quot;</span> &lt;&lt; <a class="code hl_function" href="#a4416a7bc7fa87201883c54cdc4c82813">binomial_expected</a>(100, 0.5)</div>
<div class="line"><span class="lineno"> 86</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 87</span> </div>
<div class="line"><span class="lineno"> 88</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;variance : &quot;</span> &lt;&lt; <a class="code hl_function" href="#acd4dd4558031e4c5d045c801f73d8861">binomial_variance</a>(100, 0.5) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 88</span> std::cout &lt;&lt; <span class="stringliteral">&quot;variance : &quot;</span> &lt;&lt; <a class="code hl_function" href="#acd4dd4558031e4c5d045c801f73d8861">binomial_variance</a>(100, 0.5) &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 89</span> </div>
<div class="line"><span class="lineno"> 90</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;standard deviation : &quot;</span></div>
<div class="line"><span class="lineno"> 91</span> &lt;&lt; <a class="code hl_function" href="#af09e51f513cee647d41192ab0a872cdc">binomial_standard_deviation</a>(100, 0.5) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 90</span> std::cout &lt;&lt; <span class="stringliteral">&quot;standard deviation : &quot;</span></div>
<div class="line"><span class="lineno"> 91</span> &lt;&lt; <a class="code hl_function" href="#af09e51f513cee647d41192ab0a872cdc">binomial_standard_deviation</a>(100, 0.5) &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 92</span> </div>
<div class="line"><span class="lineno"> 93</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;exactly 30 successes : &quot;</span> &lt;&lt; <a class="code hl_function" href="#a19ae0a6a2bd200fd1eb0e31b2bf4cc76">binomial_x_successes</a>(100, 0.5, 30)</div>
<div class="line"><span class="lineno"> 94</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 93</span> std::cout &lt;&lt; <span class="stringliteral">&quot;exactly 30 successes : &quot;</span> &lt;&lt; <a class="code hl_function" href="#a19ae0a6a2bd200fd1eb0e31b2bf4cc76">binomial_x_successes</a>(100, 0.5, 30)</div>
<div class="line"><span class="lineno"> 94</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 95</span> </div>
<div class="line"><span class="lineno"> 96</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;45 or more successes : &quot;</span></div>
<div class="line"><span class="lineno"> 97</span> &lt;&lt; <a class="code hl_function" href="#a76ed6ce71415fb400b65f0656cef3d25">binomial_range_successes</a>(100, 0.5, 45, 100) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 96</span> std::cout &lt;&lt; <span class="stringliteral">&quot;45 or more successes : &quot;</span></div>
<div class="line"><span class="lineno"> 97</span> &lt;&lt; <a class="code hl_function" href="#a76ed6ce71415fb400b65f0656cef3d25">binomial_range_successes</a>(100, 0.5, 45, 100) &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 98</span> </div>
<div class="line"><span class="lineno"> 99</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 100</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="abinomial__dist_8cpp_html_a19ae0a6a2bd200fd1eb0e31b2bf4cc76"><div class="ttname"><a href="#a19ae0a6a2bd200fd1eb0e31b2bf4cc76">binomial_x_successes</a></div><div class="ttdeci">double binomial_x_successes(double n, double p, double x)</div><div class="ttdef"><b>Definition</b> binomial_dist.cpp:65</div></div>
<div class="ttc" id="abinomial__dist_8cpp_html_a4416a7bc7fa87201883c54cdc4c82813"><div class="ttname"><a href="#a4416a7bc7fa87201883c54cdc4c82813">binomial_expected</a></div><div class="ttdeci">double binomial_expected(double n, double p)</div><div class="ttdef"><b>Definition</b> binomial_dist.cpp:22</div></div>
<div class="ttc" id="abinomial__dist_8cpp_html_a76ed6ce71415fb400b65f0656cef3d25"><div class="ttname"><a href="#a76ed6ce71415fb400b65f0656cef3d25">binomial_range_successes</a></div><div class="ttdeci">double binomial_range_successes(double n, double p, double lower_bound, double upper_bound)</div><div class="ttdef"><b>Definition</b> binomial_dist.cpp:74</div></div>
<div class="ttc" id="abinomial__dist_8cpp_html_af09e51f513cee647d41192ab0a872cdc"><div class="ttname"><a href="#af09e51f513cee647d41192ab0a872cdc">binomial_standard_deviation</a></div><div class="ttdeci">double binomial_standard_deviation(double n, double p)</div><div class="ttdef"><b>Definition</b> binomial_dist.cpp:36</div></div>
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d6/db0/binomial__dist_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="467" height="286"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<div class="ttc" id="abinomial__dist_8cpp_html_a19ae0a6a2bd200fd1eb0e31b2bf4cc76"><div class="ttname"><a href="#a19ae0a6a2bd200fd1eb0e31b2bf4cc76">binomial_x_successes</a></div><div class="ttdeci">double binomial_x_successes(double n, double p, double x)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/db0/binomial__dist_8cpp_source.html#l00065">binomial_dist.cpp:65</a></div></div>
<div class="ttc" id="abinomial__dist_8cpp_html_a4416a7bc7fa87201883c54cdc4c82813"><div class="ttname"><a href="#a4416a7bc7fa87201883c54cdc4c82813">binomial_expected</a></div><div class="ttdeci">double binomial_expected(double n, double p)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/db0/binomial__dist_8cpp_source.html#l00022">binomial_dist.cpp:22</a></div></div>
<div class="ttc" id="abinomial__dist_8cpp_html_a76ed6ce71415fb400b65f0656cef3d25"><div class="ttname"><a href="#a76ed6ce71415fb400b65f0656cef3d25">binomial_range_successes</a></div><div class="ttdeci">double binomial_range_successes(double n, double p, double lower_bound, double upper_bound)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/db0/binomial__dist_8cpp_source.html#l00074">binomial_dist.cpp:74</a></div></div>
<div class="ttc" id="abinomial__dist_8cpp_html_af09e51f513cee647d41192ab0a872cdc"><div class="ttname"><a href="#af09e51f513cee647d41192ab0a872cdc">binomial_standard_deviation</a></div><div class="ttdeci">double binomial_standard_deviation(double n, double p)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/db0/binomial__dist_8cpp_source.html#l00036">binomial_dist.cpp:36</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a78d36635232e54b5d71fcbf1eac9a49a" name="a78d36635232e54b5d71fcbf1eac9a49a"></a>
@@ -404,6 +412,8 @@ Here is the call graph for this function:</div>
<dl class="section return"><dt>Returns</dt><dd>\(\displaystyle {n\choose r} =
\frac{n!}{r!(n-r)!} = \frac{n\times(n-1)\times(n-2)\times\cdots(n-r)}{r!}
\) </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html#l00047">47</a> of file <a class="el" href="../../d6/db0/binomial__dist_8cpp_source.html">binomial_dist.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 47</span> {</div>
<div class="line"><span class="lineno"> 48</span> <span class="keywordtype">double</span> numerator = n;</div>
<div class="line"><span class="lineno"> 49</span> <span class="keywordtype">double</span> denominator = r;</div>