mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-17 12:02:22 +08:00
Documentation for 0931d530ae
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.5"/>
|
||||
<meta name="generator" content="Doxygen 1.9.6"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: probability/poisson_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.5 -->
|
||||
<!-- Generated by Doxygen 1.9.6 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -130,8 +130,8 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p ><a href="https://en.wikipedia.org/wiki/Poisson_distribution" target="_blank">Poisson statistics</a> </p>
|
||||
<p >The Poisson distribution counts how many events occur over a set time interval. </p>
|
||||
<div class="textblock"><p><a href="https://en.wikipedia.org/wiki/Poisson_distribution" target="_blank">Poisson statistics</a> </p>
|
||||
<p>The Poisson distribution counts how many events occur over a set time interval. </p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="a63ffd347e75d5ed7a518cbcfbfeec71a" name="a63ffd347e75d5ed7a518cbcfbfeec71a"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a63ffd347e75d5ed7a518cbcfbfeec71a">◆ </a></span>fact()</h2>
|
||||
@@ -148,7 +148,7 @@ Functions</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Compute factorial of a given number </p>
|
||||
<p>Compute factorial of a given number </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 30</span> {</div>
|
||||
<div class="line"><span class="lineno"> 31</span> <span class="keywordtype">double</span> x_fact = x;</div>
|
||||
<div class="line"><span class="lineno"> 32</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = x - 1; i > 0; i--) {</div>
|
||||
@@ -178,7 +178,7 @@ Functions</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >main function </p>
|
||||
<p>main function </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 65</span> {</div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="keywordtype">double</span> rate, expected;</div>
|
||||
<div class="line"><span class="lineno"> 67</span> rate = <a class="code hl_function" href="../../d9/d24/poisson__dist_8cpp.html#ac217ab9a06291f360d816700a6958ca8">poisson_rate</a>(3, 1);</div>
|
||||
@@ -234,7 +234,7 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >calculate the expected value over a time e.g rate of 2.5 over 10 mins = 2.5 x 10 = 25 </p>
|
||||
<p>calculate the expected value over a time e.g rate of 2.5 over 10 mins = 2.5 x 10 = 25 </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 25</span>{ <span class="keywordflow">return</span> rate * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>; }</div>
|
||||
<div class="ttc" id="atime_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/c/time.html">std::time</a></div><div class="ttdeci">T time(T... args)</div></div>
|
||||
</div><!-- fragment -->
|
||||
@@ -271,7 +271,7 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >probability of a success in range for Poisson dist (inclusive, inclusive) </p><p class="formulaDsp">
|
||||
<p>probability of a success in range for Poisson dist (inclusive, inclusive) </p><p class="formulaDsp">
|
||||
\[P = \sum_i p(\mu,i)\]
|
||||
</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 54</span> {</div>
|
||||
@@ -317,7 +317,7 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >poisson rate:<br />
|
||||
<p>poisson rate:<br />
|
||||
calculate the events per unit time<br />
|
||||
e.g 5 dollars every 2 mins = 5 / 2 = 2.5 </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 17</span> {</div>
|
||||
@@ -351,7 +351,7 @@ e.g 5 dollars every 2 mins = 5 / 2 = 2.5 </p>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Find the probability of x successes in a Poisson dist. </p><p class="formulaDsp">
|
||||
<p>Find the probability of x successes in a Poisson dist. </p><p class="formulaDsp">
|
||||
\[p(\mu,x) = \frac{\mu^x e^{-\mu}}{x!}\]
|
||||
</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 46</span> {</div>
|
||||
@@ -375,7 +375,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="../../d9/d24/poisson__dist_8cpp.html">poisson_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.5 </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.6 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user