Refreshment After A Long Bayes' Work
Error on line 2 of Python tag (line 3 of source): from lib601.dist import DDist ModuleNotFoundError: No module named 'lib601'
You are sitting in your apartment, wishing for a nice cold can of ProbaCola, and you wonder whether there is one in your fridge. You're comfortable on the couch, though, and so rather than getting up to check, you try to do some Bayesian state estimation first, to decide whether it's worth the effort of getting up.
You have two housemates, Jody and Sydney, each of whom sometimes buys new sodas to put in the fridge, and sometimes drinks sodas from the fridge. Jody and Sydney are also both out of the apartment a lot of the time, and you get to observe which one comes in on any given day. If Jody comes in, the number of sodas in the fridge changes according to the following distribution:
DDist({-1:.2, 0:.2, +1:.6})
If Sydney comes in, the distribution over the change in the number of sodas is:
DDist({-2:.4, -1:.2, 0:.1, +1:.3})
Of course, the number of sodas can't go negative; any probability associated with a change that would make the number go negative will accumulate on the hypothesis that there are no sodas.
1) Part 1
For some reason, you have decided that your belief over the number of sodas in the fridge is:
DDist({0:.1, 1:.2, 2:.3, 3:.3, 4:.1})
You decide to get up and look after all. However, having forgotten your glasses, you can't see exactly how many cans there are. But you are certain that there are at least 2 cans. What is your new belief over the number of sodas in the fridge?
DDist
) in the box below:2) Part 2
After retrieving your glasses, you look in the fridge. However, you are a little light-headed from having stood up too quickly, and so you aren't able to make a perfect observation. You decide that the distribution over cans in the fridge is:
DDist({1:.2, 2:.2, 3:.6})
Later, you see Jody come in and mess with the fridge. What is your belief about the number of sodas after this observation?
DDist
) in the box below:3) Part 3
You look again and see that there are exactly 2 sodas in the fridge. You decide to wait to drink one, and spend the day watching the entire first season of your favorite TV show on Netflix. During the day, you hear one of your roommates come in and mess with the fridge, but you are too engrossed in your show to look up and see who it was. You decide that there was a 50% chance of it being either roommate.
What is your new belief over the number of sodas in the fridge?
DDist
) in the box below:Later, you look and see exactly 2 sodas.
4) Part 4
You fall asleep, but only after you put an IR detector on the fridge door. You wake up to find that two people have interacted with the fridge (though you don't know who). Before these updates, your belief over the number of sodas in the fridge was:
DDist({0:.4, 1:.6})
Afterward, you look in the fridge and see that there is exactly one soda. What are the following probabilities?