# 1.2 Conditional probabilities and bayes' rule

 Page 1 / 1
This module introduces conditional probabilities and Bayes' rule.

If $A$ and $B$ are two separate but possibly dependent random events, then:

• Probability of $A$ and $B$ occurring together = $(,(A, B))$
• The conditional probability of $A$ , given that $B$ occurs = $(B, A)$
• The conditional probability of $B$ , given that $A$ occurs = $(A, B)$
From elementary rules of probability (Venn diagrams):
$(,(A, B))=(B, A)(B)=(A, B)(A)$
Dividing the right-hand pair of expressions by $(B)$ gives Bayes' rule:
$(B, A)=\frac{(A, B)(A)}{(B)}$
In problems of probabilistic inference, we are often trying to estimate the most probable underlying model for a randomprocess, based on some observed data or evidence. If $A$ represents a given set of model parameters, and $B$ represents the set of observed data values, then the terms in are given the following terminology:
• $(A)$ is the prior probability of the model $A$ (in the absence of any evidence);
• $(B)$ is the probability of the evidence $B$ ;
• $(A, B)$ is the likelihood that the evidence $B$ was produced, given that the model was $A$ ;
• $(B, A)$ is the posterior probability of the model being $A$ , given that the evidence is $B$ .
Quite often, we try to find the model $A$ which maximizes the posterior $(B, A)$ . This is known as maximum a posteriori or MAP model selection.

The following example illustrates the concepts of Bayesian model selection.

Problem:

Given a tub containing 100 six-sided dice, in which one die is known to be loaded towards the six to a specified extent,derive an expression for the probability that, after a given set of throws, an arbitrarily chosen die is the loaded one?Assume the other 99 dice are all fair (not loaded in any way). The loaded die is known to have the following pmf: ${p}_{L}(1)=0.05$ $\{{p}_{L}(2), \dots , {p}_{L}(5)\}=0.15$ ${p}_{L}(6)=0.35$ Here derive a good strategy for finding the loaded die from the tub.

Solution:

The pmfs of the fair dice may be assumed to be: $\forall i, i=\{1, \dots , 6\}\colon {p}_{F}(i)=\frac{1}{6}$ Let each die have one of two states, $S=L$ if it is loaded and $S=F$ if it is fair. These are our two possible models for the random process and they have underlying pmfs given by $\{{p}_{L}(1), \dots , {p}_{L}(6)\}$ and $\{{p}_{F}(1), \dots , {p}_{F}(6)\}$ respectively.

After $N$ throws of the chosen die, let the sequence of throws be ${\Theta }_{N}=\{{\theta }_{1}, \dots , {\theta }_{N}\}$ , where each ${\theta }_{i}\in \{1, \dots , 6\}$ . This is our evidence .

We shall now calculate the probability that this die is the loaded one. We therefore wish to find the posterior $({\Theta }_{N}, S=L)$ .

We cannot evaluate this directly, but we can evaluate the likelihoods , $(S=L, {\Theta }_{N})$ and $(S=F, {\Theta }_{N})$ , since we know the expected pmfs in each case. We also know the prior probabilities $(S=L)$ and $(S=F)$ before we have carried out any throws, and these are $\{0.01, 0.99\}$ since only one die in the tub of 100 is loaded. Hence we can use Bayes' rule:

$({\Theta }_{N}, S=L)=\frac{(S=L, {\Theta }_{N})(S=L)}{({\Theta }_{N})}$
The denominator term $({\Theta }_{N})$ is there to ensure that $({\Theta }_{N}, S=L)$ and $({\Theta }_{N}, S=F)$ sum to unity (as they must). It can most easily be calculated from:
$({\Theta }_{N})=(,({\Theta }_{N}, S=L))+(,({\Theta }_{N}, S=F))=(S=L, {\Theta }_{N})(S=L)+(S=F, {\Theta }_{N})(S=F)$
so that
$({\Theta }_{N}, S=L)=\frac{(S=L, {\Theta }_{N})(S=L)}{(S=L, {\Theta }_{N})(S=L)+(S=F, {\Theta }_{N})(S=F)}=\frac{1}{1+{R}_{N}}$
where
${R}_{N}=\frac{(S=F, {\Theta }_{N})(S=F)}{(S=L, {\Theta }_{N})(S=L)}$
To calculate the likelihoods, $(S=L, {\Theta }_{N})$ and $(S=F, {\Theta }_{N})$ , we simply take the product of the probabilities of each throw occurring in the sequence of throws ${\Theta }_{N}$ , given each of the two modules respectively (since each new throw is independent of all previous throws, giventhe model). So, after $N$ throws, these likelihoods will be given by:
$(S=L, {\Theta }_{N})=\prod_{i=1}^{N} {p}_{L}({\theta }_{i})$
and
$(S=F, {\Theta }_{N})=\prod_{i=1}^{N} {p}_{F}({\theta }_{i})$
We can now substitute these probabilities into the above expression for ${R}_{N}$ and include $(S=L)=0.01$ and $(S=F)=0.99$ to get the desired a posteriori probability $({\Theta }_{N}, S=L)$ after $N$ throws using .

We may calculate this iteratively by noting that

$(S=L, {\Theta }_{N})=(S=L, {\Theta }_{N-1}){p}_{L}({\theta }_{n})$
and
$(S=F, {\Theta }_{N})=(S=F, {\Theta }_{N-1}){p}_{F}({\theta }_{n})$
so that
${R}_{N}={R}_{N-1}\frac{{p}_{F}({\theta }_{n})}{\frac{{p}_{L}({\theta }_{n})}{}}$
where ${R}_{0}=\frac{(S=F)}{(S=L)}=99$ . If we calculate this after every throw of the current die being tested (i.e. as $N$ increases), then we can either move on to test the next die from the tub if $({\Theta }_{N}, S=L)$ becomes sufficiently small (say $<(10^{-4})$ ) or accept the current die as the loaded one when $({\Theta }_{N}, S=L)$ becomes large enough (say $>(0.995)$ ). (These thresholds correspond approximately to ${R}_{N}> 10^{4}$ and ${R}_{N}< 5E-3$ respectively.)

The choice of these thresholds for $({\Theta }_{N}, S=L)$ is a function of the desired tradeoff between speed of searching versus the probability of failure to findthe loaded die, either by moving on to the next die even when the current one is loaded, or by selecting a fair dieas the loaded one.

The lower threshold, ${p}_{1}=10^{-4}$ , is the more critical, because it affects how long we spend before discarding each fair die. The probability ofcorrectly detecting all the fair dice before the loaded die is reached is $(1-{p}_{1})^{n}\approx 1-n{p}_{1}$ , where $n\approx 50$ is the expected number of fair dice tested before the loaded one is found. So the failure probability due toincorrectly assuming the loaded die to be fair is approximately $n{p}_{1}\approx 0.005$ .

The upper threshold, ${p}_{2}=0.995$ , is much less critical on search speed, since the loaded result only occurs once, so it is a good idea to set it very close to unity. The failureprobability caused by selecting a fair die to be the loaded one is just $1-{p}_{2}=0.005$ . Hence the

In problems with significant amounts of evidence (e.g. large $N$ ), the evidence probability and the likelihoods can both get very very small, sufficientto cause floating-point underflow on many computers if equations such as and are computed directly. However the ratio of likelihood to evidenceprobability still remains a reasonable size and is an important quantity which must be calculatedcorrectly.

One solution to this problem is to compute only the ratio of likelihoods, as in . A more generally useful solution is to computelog(likelihoods) instead. The product operations in the expressions for the likelihoods then become sums oflogarithms. Even the calculation of likelihood ratios such as ${R}_{N}$ and comparison with appropriate thresholds can be done in the log domain. After this, it is OK to return tothe linear domain if necessary since ${R}_{N}$ should be a reasonable value as it is the ratio of very small quantities.

Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
what does nano mean?
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
it is a goid question and i want to know the answer as well
Maciej
Abigail
for teaching engĺish at school how nano technology help us
Anassong
Do somebody tell me a best nano engineering book for beginners?
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
what is fullerene does it is used to make bukky balls
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
so some one know about replacing silicon atom with phosphorous in semiconductors device?
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
for screen printed electrodes ?
SUYASH
What is lattice structure?
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
Got questions? Join the online conversation and get instant answers!