Maximum likelihood- and a posteriori reasoning

75 Views Asked by At

I'm solving a problem, and I am not sure if I'm thinking entirely correctly.

Suppose we have 30 candies, 20 nougats and 10 liquorice. They're all wrapped in either green or silver wrappers. There are 10 nougats and 7 liquorice in silver wrappers. Then there are 10 nougats and 3 liquorice in green wrappers.

Now, the question is, if I pick a candy at random, that happens to be wrapped in silver. What kind of candy am I most likely to get, according to

  1. Maximum likelihood reasoning
  2. Maximum A posteriori reasoning.

My attempt to solve:

  1. Suppose event $H_1$ is to get a nougat, and event $H_2$ is to get a liquorice. Then we want to maximize $P(D|H_i)$, where $D$ is (I think) the data/information about the candies and the wrappers (not entirely sure what $D$ is to be honst).

$$P(D|H1)=\frac{P(H_1|D)\cdot P(D)}{P(H_1)}=\frac{\frac{10}{17}P(D)}{\frac{20}{30}}=\frac{15}{17}\cdot P(D)$$ and $$P(D|H2)=\frac{P(H_2|D)\cdot P(D)}{P(H_2)}=\frac{\frac{7}{17}P(D)}{\frac{10}{30}}=\frac{21}{17}\cdot P(D).$$ This means that according to the maximum likelihood reasoning we are more likely to pick a liquorice.

  1. For the next part we want to find which piece we are most likely to get according to A posteriori reasoning. Then we want to maximize $P(H_i|D)$. $$P(H_1|D)=\frac{10}{17}\quad\quad\textrm{(# of nougat in silver divided by all in silver)}$$ and $$P(H_2|D)=\frac{7}{17}\quad\quad\textrm{(# of liquirice in silver divided by all in silver)}.$$ According to this, getting a nougat would be more probable.

I'm not sure if my reasonings are correct. They seem to simple. I would appreciate any feedback.

Thanks!

1

There are 1 best solutions below

0
On

I think you've done what's intended. The 'data' is that you picked a silver and the 'hypotheses' are that the candy is a nougat / a licorice (though this is a questionable use of 'hypothesis' in my opinion), which fits with how you interpreted part 2. If my interpretation is right, then you have $P(D)= 17/30,$ which completes the first part (although you already correctly ascertained the answer).

The reason I say this is questionable is usually a 'hypothesis' is something that is either true or false at the outset of the experiment (like, in the over-used grim example, whether you have some disease or not) and that we collect data to find out about. Here that interpretation seems pretty unnatural. But it can be made to work: imagine all the candies were in identical boxes and you'd selected one at random and put it in front of you. Then you can frame your hypotheses of which type is in front of you and do the "experiment" of opening the box and seeing the wrapper color.

This seems to have confused you too, since you weren't quite sure what the 'data' was. I'd prefer to use the well-worn example of medical testing to make the point your instructor is making. (I also wouldn't have framed it as 'maximum likelihood' vs 'maximum a-posteriori', but that's getting into something else entirely.)