# Homework Help: Math: discrete probability distribution

1. Feb 13, 2016

### masterchiefo

1. The problem statement, all variables and given/known data
We ask a person to taste 18 biscuits , 8 made to butter ( the other 10 are made to margarine ) , and to identify 8 butter cookies . He does not know the exact number of butter cookies . As he sees no difference , he randomly selects those he claims to be butter . Y = the number of butter cookies correctly identified.

Indicate , the variance of the variable Y.

2. Relevant equations

3. The attempt at a solution

My work: First thing I need to make sure, do I use hypergeometric formulas or binomial or Poisson? My guess is Hypergeometric. Is that right ?

N = 18
n=8
p= 8/18
q= 1-(8/18)

I then entered those numbers into the variance formula but I do not get the correct answer. what is wrong?
which is variance= npq*(1-n/N)

thank you

2. Feb 13, 2016

### andrewkirk

That is not the variance of a hypergeometric distribution. Other than the last term it looks like the variance of a binomial.
Get the correct formula for variance of a hypergeometric and you'll get the correct answer. If you don't have your text handy, wikipedia has a formula.
By the way, how did you eliminate Poisson and binomial as possibilities? It can be done in an objective fashion - guesses should not be necessary?

3. Feb 13, 2016

### masterchiefo

This is the correct variance formula. I just simplified the last part.

You can also write it as: variance= npq*((N-n)/N-1)
Binomial is only variance=npq

It still does not work. Something is wrong.
This part right here makes it confusing. Because if he knew the exact number of butter cookies then what I did is good. But since he does not know the exact number there is something I have to change and I don't know what it is.
(He does not know the exact number of butter cookies .)

4. Feb 13, 2016

### andrewkirk

That is different from what is written in the OP. But neither is quite correct. The denominator in the last term needs to be (N-1).
Inserting two extra brackets into what you wrote in post 3 will make it correct.

5. Feb 13, 2016

### masterchiefo

variance= npq*((N-n)/(N-1))

I have used the variance formula over hundred times, I use it correctly in my calculator,

I am more worried about those info:
N = 18
n=8
p= 8/18
q= 1-(8/18)

Because something is wrong with that.

============================================================

Look this is the example I did before.

We ask a person to taste 18 biscuits , 8 made to butter ( the other 10 are made to margarine ) , and to identify 8 butter cookies . He does know the exact number of butter cookies . As he sees no difference , he randomly selects those he claims to be butter . Y = the number of butter cookies correctly identified.

In this particular problem, he DOES know the exact number of butter cookies, so I can use those info:

N = 18
n=8
p= 8/18
q= 1-(8/18)
and for this problem the variance is correct when I calculate it.

But my problem is that he DOES not know the exact number, so I need to change something but I do not know what.

6. Feb 14, 2016

### andrewkirk

That's correct, and your values of n, p, q, N look correct too.
What number did you get for the variance? I get 1.162. What answer does your textbook suggest?
Whether he knows the number of butter cookies doesn't affect the calc. All that matters is how many cookies he claims are butter. It seemed implicit in the OP that that number was 8. If it is not 8 then the problem cannot be done without more information being supplied about how he chooses how many cookies to label as butter. A distribution of the number of cookies he labels is needed. Different distributions will give different answers.

7. Feb 14, 2016

### masterchiefo

It cant be correct because this is 2 different Problem with different answer.

#1 Problem is when he does not know the exact amount.
I don't have the correct answer for this one, but it is not 1.1612, teacher said in class that both problem will have a different answer.

#2 Problem is when he does know the exact amount.
Correct answer for this one = 1.1612

8. Feb 14, 2016

### masterchiefo

n cannot be 8 because the person does not know how many butter there is and it does not say how many he will pick. It says (he randomly selects those he claims to be butter .) it could be 1 to 18...it doesnt say how many he selects.

So how many will he select? how many of those are butter?

9. Feb 14, 2016

### Ray Vickson

If I understand your problem, you have a group of 18 cookies, 8 made with butter (not TO butter!) and 10 made with margarine. A man tests all 18, but simply guesses which are the butter cookies. In other words, his probability of saying "this is a butter cookie" is 1/2 for each of the 18 cookies tasted with all guesses being independent. Is that what you mean? If so, the number of "butter" guesses is binomial with parameters n = 18 and p = 0.5. If X of his guesses are "butter", some of these may be truly butter cookies and some not; the number of "butter" guesses that are truly "butter" is Y.

Is that a correct good description of your problem? If so, it is not a simple hypergeometric or a simple binomial problem. Can you see why? Can you see how conditional probabilities come into play?

Last edited: Feb 14, 2016
10. Feb 14, 2016

### masterchiefo

How do I solve this problem with conditional probabilities ? I never done a problem like that before.
Conditional distribution
8/18= 0.4444
10/18=0.55555
Not really sure what do to with that

11. Feb 14, 2016

### Ray Vickson

(1) Was my description of your problem correct? Yes or no?
(2) Assuming your answer is yes, you then need to understand how you could calculate the probabilities $P(Y = k)$ for $k = 0,1,2, \ldots, 8$. You might not need to actually calculate them, but you do need to understand what you would need to do. Anyway, writing down numbers with zero explanation (like you just did) is not helpful.

So, don't start writing down numbers or random formulas yet; the time to write down numbers and (correct) formulas is after you understand the problem more thoroughly.

Last edited: Feb 14, 2016
12. Feb 14, 2016

### masterchiefo

I am pretty confused now.
Just to make things clear do I need to use binomial or hypergeometric for this one?
and you said n = 18 and p = 0.5 , that makes q=1-0.5
what do I need to actually find ?

13. Feb 14, 2016

### Ray Vickson

If he does not know about the 8 and the 10:

Let me repeat for one last time: in this case how would you calculate P(Y = 0)? How would you calculate P(Y = 1)? How would you calculate P(Y=2)? etc.

I will not tell you what formulas you need to use, but I will hint a little more about how you should think about the problem.

Assuming the man guesses randomly, what are the probabilities P(X = n) for n = 0,1,2, ... . Here, X = number of "butter" guesses, and could (presumably) be any number from 0 to 18 because he makes 18 random guesses.

If you know that {X = n}, what can you say about {Y = k}?

What if he knows about the 8 and the 10?
In that case he will not make more than 8 "butter" guesses, so his guesses could not be truly independent and random anymore. One simple way to deal with this would be to assume totally random and independent guesses until a total of 8 "butter"s have been reached, the declare all the remaining to be "margarine". Alternatively, if he is allowed to calculate, he could adapt his "guess" probabilities to his previous answers. For instance he could guess "butter" on his first cookie with probability 8/18. Then if he guessed "butter" first, he is left with 17 cookies among which he thinks 7 are "butter" and 10 are "marg". He could choose his second guess probability accordingly. Similarly, if he guessed "marg" first he is now looking at 17 cookies of which he thinks 8 are "butter" and 9 are "marg", etc.

14. Feb 14, 2016

### masterchiefo

The problem where he knows about the 8 butter is already resolved.

15. Feb 14, 2016

### Ray Vickson

No, I don't think it has been; I do not believe your solution.

Among other things, it does not deal with the issue I outlined above: exactly how does he "guess" when the 8 and 10 are known to him? You just ignored that aspect altogether, but it cannot be ignored.

16. Feb 14, 2016

### masterchiefo

Where he knows about the 8 butter, its resolved and corrected by the teacher himself last week.

My problem today is where he does not know about the number of butter.
Sorry, I been thinking, thinking and I still don't understand.

Before I use the correct formula for p(x).

I want to know if this is correct:
n=18
p=0.5
N1=8
N2=10
N=N1+N2=18

k=0 to 8
And I would use the Hypergeometric P(x) formula

,

17. Feb 14, 2016

### masterchiefo

This is for P(Y=K) K 0 to 8
binomPdf(18,0.5,{0,1,2,3,4,5,6,7,8})
{3.814697265625E−6,6.8664550781251E−5,5.8364868164062E−4,0.00311279296875,0.011672973632812,0.032684326171874,0.070816040039061,0.12139892578125,0.16692352294921}

18. Feb 14, 2016

### masterchiefo

Can someone please help me, I am on this problem since yesterday and I cant figure it out.
It is the first time I am that confused about a probability problem :/

19. Feb 14, 2016

### Ray Vickson

These are the probabilities P(X = n) for n = 0, ..., 8 (that is, the probability that the man guesses n). That is not what you want: you want the probability P(Y = k) for k = 0, ..., 8, which are the probabilities that k of his guesses are correct.

There is no reason for X to stop at 8, because if the man knows nothing at all about the true numbers of butter/marg cookies he can guess any number from 0 10 18. The extreme cases X=0 means he guesses there are no butter cookies and X = 18 means he guesses that all 18 are butter cookies. Of course, unknown to him (but known to US) the actual number of butter cookies is 8 exactly.

20. Feb 14, 2016

### masterchiefo

Sorry man, but I need more details about what I have to do. I am entirely clueless now about what to do.

I just calculated P(Y=k) but you said its wrong and I dont understand.
This is for P(Y=K) K 0 to 8
binomPdf(18,0.5,{0,1,2,3,4,5,6,7,8})

what is wrong with that?, or do I have to change 18 to 8?

21. Feb 14, 2016

### Ray Vickson

No, you did NOT calculate P(Y = k) for k from 0 to 8; you calculated P(X = k) for k from 0 to 8.

I have explained already what are X and Y, and will not do so again. It is against PF rules for me to tell you exactly what you need to do. I have given several hints, but that is all I am allowed to do (or am willing to do).

22. Feb 14, 2016

### masterchiefo

exactly so I just do binomPdf(8,0.5,{0,1,2,3,4,5,6,7,8})
since we know there is 8 butter biscuit

23. Feb 14, 2016

### masterchiefo

Also, why is P=0.5 like you said earlier ? We dont have the same amount of Butter biscuit and Margarine Biscuit.

24. Feb 14, 2016

### Ray Vickson

You said that the man guesses at random. He has no idea about the number of biscuit types (WE know it, but he does not). So, I just assumed he guesses both types to be equally likely each time.

Anyway, your reasoning is absent, so when you just write something down without justification that is not a correct argument. The distribution you get may or may not be correct, but you have not given any reasons why it should be! If you want to be believed you cannot just write these things down without any explanations.

25. Feb 14, 2016

### masterchiefo

If we know P=0.5 and n=18 so q=1-0.5, so why do I even need to calculate the binomial then?

I just need to know the variance and in Binomial the variance =n*p*q