In probability theory and statistics, Bayes' theorem (alternatively Bayes's theorem, Bayes's law or Bayes's rule) describes the probability of an event, based on prior knowledge of conditions that might be associated to the event. With Bayesian probability interpretation, the theorem expresses how a degree of impression, expressed as a probability, should rationally change to account for the availability of related evidence. Bayes ’ theorem was named after Thomas Bayes (1701–1761), who study how to calculate a distribution for the probability parameter of a binomial distribution (in modern terminology).By modern standards, we should refer to the Bayes – price rule. The French mathematician Pierre-Simon Laplace reproduced and extended Bayes's outcomes in 1774, apparently unaware of Bayes's work.

COMING SOON!

```
#include <iostream>
// bayes' theorem > https://en.wikipedia.org/wiki/Bayes%27_theorem
// bayes' theorem allows one to find P(A|B) given P(B|A)
// or P(B|A) given P(A|B) and P(A) and P(B)
// note P(A|B) is read 'The probability of A given that the event B has occured'
// returns P(A|B)
double bayes_AgivenB(double BgivenA, double A, double B) {
return (BgivenA * A) / B;
}
// returns P(B|A)
double bayes_BgivenA(double AgivenB, double A, double B) {
return (AgivenB * B) / A;
}
int main() {
double A = 0.01;
double B = 0.1;
double BgivenA = 0.9;
double AgivenB = bayes_AgivenB(BgivenA, A, B);
std::cout << "A given B = " << AgivenB << std::endl;
std::cout << "B given A = " << bayes_BgivenA(AgivenB, A, B) << std::endl;
return 0;
}
```