mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-30 13:33:58 +08:00
Documentation for 2a076c1b03
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: probability/binomial_dist.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<!-- Generated by Doxygen 1.9.4 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -207,7 +207,9 @@ Functions</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<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 >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>
|
||||
<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 <= <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/upper_bound.html">upper_bound</a>; i++) {</div>
|
||||
@@ -436,7 +438,9 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -460,7 +464,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d6/db0/binomial__dist_8cpp.html">binomial_dist.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user