1

Fred is answering a multiple-choice problem on an exam, and has to choose one of n options (exactly one of which is correct). Let K be the event that he knows the answer, and R be the event that he gets the problem right (either through knowledge or through luck). Suppose that if he knows the right answer he will definitely get the problem right, but if he does not know then he will guess completely randomly. Let P(K) = p

1a

Find P(K|R) (in terms of p and n): this is the probability that he knows the answer given the fact that he got the answer right.

P(K) = p

We can use Bayes’ Law to solve this problem, we know that P(K|R) is equivelant to:

\[ P(R|K)P(K) \over P(R) \] Let’s find the component parts of this problem first and see if we can solve

P(R|K): represents the probability that he get’s the ansewr right given that he knows the answer, clearly this is 1.

P(K): we are told from the problem to express this probability as p.

P(R): I think we have to use the law of total probaiblity here. That is P(R) represents is the sum of the probability of the outcomes:

  1. he knows the answer and gets the problem right and
  2. he doesn’t know the answer and get’s the problem right.
  3. is 1xp and (b) is (1/n)x(1-p) so we are left with 1 + 1/n

Plugging in the appropriate values we get:

\[ 1p \over 1p + 1/n(1-p) \]

This simplifies to:

\[ p \over p+(1-p)/n \]

\[ p \over p + (1-p)/n \]

1b

When (if ever) does P(K|R) equal p

The possible answers are:

  1. Never
  2. In the limit as n approaches infinity
  3. IN each of the following extreme cases: n=1, p=0, p=1
  4. If p = 1/2

I suppose the idea here is to start plugging in numbers for the third case.

If p is one, he definitely knows the answer, so we will always get it right If p is 0 he doesn’t know, and so the answer will be zero If n is one, there is only one problem, so he will always guess right. Therefore the answer is (c)

Problem 2

A hat contains 100 coins, where 99 are fiar but one is double-headed(alwys landing Heads). A coin is chosen uniformly at random. The chosen coin is flipped 7 times, and it lands Heads all 7 times. Given this information, what is the probability that thechosen coin is double headed? (Of course, another approach here would be to look at both sides of the coin- but this is a metaphorical coin)

Let P(A0) be the probability of selecting a fair coin: 99/100

Let P(A1) be the probability of selecting an unfair coin: 1/100

Let P(S) be the probability of getting seven heads.

P(S|A0) is just (1/2)^7, this becomes seven independent coin flips so you just multiply 1/2 together 7 times

P(S|A1) is 1, that is, everytime we get the unfair coin we will get 7 heads.

We want to find (A1|S), for which we can use Bayes’ Law:

\[ P(S|A1)P(A1) \over P(S) \]

Once again, it seems like the tricky part of this problem is finding the denominator: P(S) which I think we would find with the total probability.

P(S) = P(S|A0)xP(A0) + P(S|A1)x(A1)

p_of_s = ((99/100)*((1/2)^7)) + (1/100)
(1/100)/(p_of_s)
## [1] 0.5638767

I got the correct answer for this problem, woohoo!

Problem 3a:

3a

To start this problem off, let’s put words to the probabilities defined in the paragraph above. We can start with the prior, which is the probability that Jimmy has the disease:

\[ p = P(D) \]

Furthermore, q is the probability that he does not have the disease

\[ q = 1-p \]

And T sub j is the event that jimmy tests positive on the jth thest:

\[ T_{j} \]

We assume that the tests results are conditionally independent given Jimmy’s disease status.4

To start with a, which equals equals:

\[ a = P(T_{j}|D) \]

This is the probabably that the jth test is positive given that he does indeed have the disease. This is a true-positive.

On the other hand, b is:

\[ b = P(T_{j}|D^{c}) \]

That is, the probability that the jth test is positive given the fact that he does not have the disease. This is a false positive.

We are asked to find the posterior probability that Jimmy has the disease given that he tests positive on exactly k out of n tests.

I will write formally as:

\[ P(D|T_{kn}) \]


First, we need to find the probability that he tests positive on k out of n tests, since all of the tests are independent, we need to multiply together all the probabilities for the tests where he tested positive, which is:

\[ a^k \]

As well as the proabilities of all the tests where he tested negative and still had the disease:

\[ (1-a)^{n-k} \]

This is raised to the n-k because it is just the difference after accounting for those when he tested positive.

We have to multiply the two previous terms together as well as P(D) which is just p from the problem above, so the final numerator in our equation is

\[ a^k(1-a)^{n-k}p \]

Finally we have to add the denominator, well the denominator, includes the probability of testing positive on k out of n tests if you have the disease (which we already calculated) plus the probability of testing positive on k out of n tests if you don’t have the disease

This last part (in bold) are the false positives, and we can calculate them similarly to above:

\[ b^k(1-b)^{n-k} \]

This is analagous to the true positives and false positives above

\[ a^k(1-a)^{n-k}p \over pa^kb^{n-k} + qb^k(1-b)^{n-k} \]

Problem 3b

We are conditioning multiple times.

3b

Facts:

Definition of terms:

A sub zero is the probability that jimmy tests positive on the jth test given that has does indeed have the disease and does not have the gene (The given information is an intersection, right?)

\[ a_{0} = P(T_{j}|D, G^c) \]

On the other hand, b sub zero is the probability that Jimmy tests positive on the jth test given that he does not have the disease and does not have the gene

\[ b_{0} = P(T_{j}|D^c,G^c) \]

We want the posterior probability that Jimmy has the disease, given that he tests positive all n items.

Let X be testing positive on all n items.

So with Bayes formula we get we get:

P(D|X) = P(X|D)P(D)/P(X)

First let’s get the prior, P(X) is the probabiliy that he tests positive on all n items. I think this involves getting 1 minus a and 1 minus b but I’m trying to figure out what exactly these terms would mean.

Problem 4

4

First let’s start off by defining some terms that we already know:

The probability that someone is willing to particpate in an exit poll given they voted for candidate A is given by:

\[ P(W|A) = 0.7 \]

However, the following shows that the probaibliy of wilingness to particpate in a poll given that they didn’t vote for A is 0.3.

\[ P(W|A^{c}) = 0.3 \]

Note: it is just a coincidence that these figures add to 1.

In the exit poll, 60% of respondents say they voted for A (assume that they are all honest) suggesting a confortable victory for (a).

This last fact gives us the probability that someone voted for A given that we were willing to participate in the polling:

\[ P(A|W) = 0.6 \]

We need P(A), the true proportion of people who voted for a

Intuitively, people who voted for A were more likely to particiapte in the poll, so the 60% advantage in poll needs to be accounted for, we need to compensate for this fact. Seems like we need to solve this with Bayes theorem as well, which we can rearrange to be the following:

\[ P(A|W)P(W) = {P(W|A)P(A)} \]

Plugging in some of the numbers that we had worked out earlier, we end up with:

Let’s call this the pending expression because we are going to need it later:

\[ 0.6P(W) = 0.7P(A) \]

The tricky part here is to use the law of total probability to find P(W) and then we should be able to solve for P(A)

\[ P(W) = P(W|A)P(A) + P(W|B)P(B) \]

Let’s plug in some numbers, and, in the following equation, let P(A) equal a

\[ P(W) = 0.7a + 0.3(1-a) \]

This simplfies to:

\[ P(W) = 0.5a + 0.3 \]

Okay now we can take this expression and plug it into pending expression above, substituing P(A) as well for a:

\[ 0.6(0.5a+0.3) = 0.7a \]

Distribute the 0.6:

\[ 0.3a + 0.18 = 0.7a \]

Rearrange the equation:

\[ 0.18 = 0.4a \]

\[ a = {0.18 \over 0.4} \]

0.18/0.4
## [1] 0.45