# Bayesian Inference

#### kangta27

##### New member
An absent minded professor goes for a walk carrying a digital audio device using 2 batteries. He has 2 fresh replacement batteries stashed away in one of four pockets. Sure enough, both batteries lose their charge and he removes them. Not wanting to throw the deplete batteries into the woods, he places them into a pocket chosen at random from the 4 available. A little while later he remembers the two fresh batteries, but he cannot remember which pocket. He fishes around in his pockets until he finds one with batteries (either 2 or 4 indistinguishable batteries). He removes 2 batteries and inserts them in the digital audio device. The digital audio device requires at least one good battery in order to play.

a. Find the probability the digital audio device works on the first try. (I wasn't sure if the pocket was a variable for solving (a.) But this is how I got this answer. (1/2) - 50% chance of choosing batteries from 2 pockets, added to (1/4 * 1/3) - choosing one out of four batteries and choosing one of three batteries.

b. Given that the digital audio device plays, calculate the prob. he chose two good batteries. (I thought that the first answer would be the 'given' for this question but it doesn't seem to be the case)

c. Given that the digital audio device plays, calculate the prob. he had placed all four batteries in the same pocket.

#### CaptainBlack

##### Well-known member
An absent minded professor goes for a walk carrying a digital audio device using 2 batteries. He has 2 fresh replacement batteries stashed away in one of four pockets. Sure enough, both batteries lose their charge and he removes them. Not wanting to throw the deplete batteries into the woods, he places them into a pocket chosen at random from the 4 available. A little while later he remembers the two fresh batteries, but he cannot remember which pocket. He fishes around in his pockets until he finds one with batteries (either 2 or 4 indistinguishable batteries). He removes 2 batteries and inserts them in the digital audio device. The digital audio device requires at least one good battery in order to play.

a. Find the probability the digital audio device works on the first try. (I wasn't sure if the pocket was a variable for solving (a.) But this is how I got this answer. (1/2) - 50% chance of choosing batteries from 2 pockets, added to (1/4 * 1/3) - choosing one out of four batteries and choosing one of three batteries.

b. Given that the digital audio device plays, calculate the prob. he chose two good batteries. (I thought that the first answer would be the 'given' for this question but it doesn't seem to be the case)

c. Given that the digital audio device plays, calculate the prob. he had placed all four batteries in the same pocket.

Lets look at a. :

$$\text{Prob(all in one pocket)=0.25})$$

$$\text{Prob(good bad in seperate pockets)=0.75)}$$

$$\text{Prob(works first time)=Prob(works first time|all in one pocket)Prob(all in one pocket) +}$$
$$\phantom{xxxxxxxxx} \text{Prob(works first time|good bad in seperate pockets)Prob(good bad in seperate pockets)}$$

$$\text{Prob(works first time|good bad in seperate pockets)=0.5 }$$

$$\text{Prob(works first time|all in one pocket)= 5/6}$$