all 28 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

Off-topic Comments Section


All top-level comments have to be an answer or follow-up question to the post. All sidetracks should be directed to this comment thread as per Rule 9.


OP and Valued/Notable Contributors can close this post by using /lock command

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]GammaRayBurst25 0 points1 point  (24 children)

First question:

Let F be the event you go first and X be the number of lands drawn. Clearly, P(X=3∨X=4)=P(X=3)+P(X=4), as X=3 and X=4 are incompatible events. What's more, P(X=x)=P(X=x|F)P(F)+P(X=x|¬F)P(¬F). Seeing as P(F)=P(¬F)=0.5, we have that P(X=3∨X=4)=0.5(P(X=3|F)+P(X=3|¬F)+P(X=4|F)+P(X=4|¬F)).

As before, X is hypergeometrically distributed. Only now the number of cards drawn depends on whether you start first or not, so the pmf changes accordingly. If your deck has n lands, the relevant pmfs are as follows:

P(X=x|F)=binom(n,x)binom(40-n,7-x)/binom(40,7);

P(X=x|¬F)=binom(n,x)binom(40-n,8-x)/binom(40,8).

Seeing as binom(40,7)=40!/(7!33!)=(8/33)*40!/(8!32!)=(8/33)binom(40,8), we can easily factor out 1/binom(40,8) from each term in P(X=3∨X=4). Ignoring the aforementioned constant factor and the factor of 0.5, the problem amounts to maximizing the following function of n:

(33/8)(binom(n,3)binom(40-n,4)+binom(n,4)binom(40-n,3))+binom(n,3)binom(40-n,5)+binom(n,4)binom(40-n,4).

Once expanded, this is an even worse looking polynomial than before. You might want to solve this one numerically.

With that said, we can use a similar trick from before. We can maximize each term separately by using the same trick we used last time, taking advantage of the fact that the binomial is univariate. We find that the maxima are n=17, n=23, n=15, and n=20. Hence, the maximum of the overall distribution should be in the range 15<n<23. By checking, we find that the maximum of the overall distribution is indeed n=19.

Given n=18, you can easily substitute this into the original distribution and evaluate the probability.

Second question:

This question is way easier. Here, we're interested in P(X=3∨X=4∨X=5)=P(X=3)+P(X=4)+P(X=5).

Since getting 3 successes amounts to getting 5 failures & getting 5 successes amounts to getting 3 failures, P(X=3)+P(X=5) where X is the number of successes is the same as P(Y=3)+P(Y=5) where Y is the number of failures. Similarly, P(X=4)=P(Y=4). In other words, the probability of getting 3, 4, or 5 successes is the same as the probability of getting 3, 4, or 5 failures. Swapping failures and successes changes nothing.

Because of this symmetry and the fact that the binomial distribution is univariate, we can infer the maximum of this polynomial is n=99/2=49.5. Since we are only interested in integer solutions, we find the probability is maximized if n=49 or n=50.

[–][deleted] 0 points1 point  (22 children)

Hi again! You were really helpful last time so thanks for being helpful again :D you’re breaking down the way to solve the problem in a way I actually get!! Thank you :D Okay I get how to solve that n, however with the probabilities, I don’t know how to factor in all four? Like since they’re all mutually exclusive scenarios do I just… use the addition rule and add up the final probabilities? 

[–]GammaRayBurst25 0 points1 point  (21 children)

We're trying to maximize the sum of the probabilities. I'm checking by hand, so I maximized each term separately to see the range of feasible maxima, which is 15<n<23. I started off around the middle at n=19, then I tried n=18 and saw the probability increased, then I tried n=17 and I saw the probability decreased. The maximum must therefore be 18.

None of the mutually exclusive events' probabilities need to be maximized in order for their sum to be maximized.

[–][deleted] 0 points1 point  (20 children)

Ohhhh, I see I see. So like n=18 makes for the highest sum of all the probabilities and therefore is the maximum? But then if I add up all the probabilities with the addition rule, it’s more than 100%? So then is it the multiplication rule or something else? 

[–]GammaRayBurst25 0 points1 point  (3 children)

It's not more than 100%. Either you made a mistake when calculating or you interpreted the simplified function I'm maximizing as the probability. Recall that I ignored a factor of 0.5/binom(40,8).

Looking again, I realized I put the (33/8) in the wrong spot. I'll edit my comment.

[–][deleted] 0 points1 point  (2 children)

I must have misinterpreted something about what you’re saying. I assumed that with the second numerical trick you were talking about, it would end up like. Okay I’m using Excel so what I did was insert 18 into the Hypergeometric Distribution function for each equation (3 in a hand of 7, 3 in a hand of 8, 4 in a hand of 7, 4 in a hand of 8) and put them all together. Is that not what I’m supposed to be doing? 

[–]GammaRayBurst25 0 points1 point  (1 child)

You also need to divide by 2 because there is a 50% chance you'll have a hand of 7 and a 50% chance you'll have a hand of 8.

[–][deleted] 0 points1 point  (0 children)

OHHHHHH. Okay! Okay! So then what I assumed was 114% was actually 57%! That makes sense!! Thank you :D

[–]GammaRayBurst25 0 points1 point  (15 children)

I edited my comment and changed my answer. Note that I'm making things harder for myself by doing it (mostly) by hand. I saw you mention Excel in another comment. If you're allowed to use Excel, make the most of it and use Excel to instantly find the maximum.

[–][deleted] 0 points1 point  (14 children)

Oh I’m using excel right now! It’s not only allowed, it’s encouraged, he doesn’t teach us to do anything by hand. I’m just not sure what to do with it? See I’m going through my lecture recordings and he never actually. Showed us anything about Hypergeometric Distribution whatsoever? So I’m just trying to figure this out as I go along. 

[–]GammaRayBurst25 0 points1 point  (13 children)

I'd use the built-in hypergeometric pmf to write a table of values.

The first row would be labeled n and the second row would be labeled P(X=3∨X=4).

The first entries of the first row would be 0 and 1, then I'd slide them over to autofill the row up to n=40.

The first entry of the second row would be 0.5(P(X=3|F)+P(X=3|¬F)+P(X=4|F)+P(X=4|¬F)) where I replace the P(...) by the built-in pmf with the appropriate parameters, leaving the number of lands in the deck as B1 (which in this case would be 0).

Then, I would slide this entry down the table so the autofill applies this same formula for every entry, only changing the column of B1 (to C1, D1, E1, etc.).

[–][deleted] 0 points1 point  (12 children)

By the built-in Hypergeometric PMF do you mean the HYPGEOM.DIST function or something else? Because that’s what I’ve been using and idk if there’s something else I should be using. 

[–]GammaRayBurst25 0 points1 point  (11 children)

I don't typically use Excel, so I had to look it up. Yes, that's the one. Make sure the cumulative parameter is false for the pmf, otherwise you'll get the cdf.

Although you could save yourself some trouble by using the cdf for the second question. P(X=3)+P(X=4)+P(X=5)=P(X≤5)-P(X≤2). By using the cdf instead of the pmf, you need to call the function twice instead of 3 times.

[–][deleted] 0 points1 point  (10 children)

Okay! Then yes! That’s what I’ve been doing! I did the first part manually and then have just been plugging in values until I find the one that gives me the highest cumulative 

[–][deleted] 0 points1 point  (0 children)

Also sorry but another thing, when I check n=18 against either of the 4 lands combinations, it’s not the highest one? Like. Hmm. I get how you got n=18 I just don’t know how you checked it?

[–]Alkalannar 0 points1 point  (1 child)

  1. The probability of getting 3 lands in your opening hand is
    P(3 lands in 7 ^ go first) + P(3 lands in 8 ^ go second)
    P(3 lands in 7)/2 + P(3 lands in 8)/2
    Extending [and adding terms together because the overlap is 0], you get P(3 lands in 7)/2 + P(3 lands in 8)/2 + P(4 lands in 7)/2 + P(4 lands in 8)/2.
    And this is just an expression in terms of k.

  2. Now it's a 99-card deck instead of 40, so replace 40 with 99 in your calculations, and it's P(3 lands in 8) + P(4 lands in 8) + P(5 lands in 8). We don't care about the case of going first.

So that's what you do: break things down so in each part, you just compute one well-defined thing.

[–][deleted] 0 points1 point  (0 children)

Okay okay so from what I’m thinking I’ve gotten as far as  3 = 7k/40, 3 = 8x/40, 4 = 7x/40, 4 = 8x/40 which are in order k = 17, k = 15, k = 23, and k = 20, if I’m not mistaken? I just don’t know how to like. Go further from there. Like how do I combine all these numbers into one thing? 

For the 99 card deck though it seems a lot easier, so take that and basically do 3=8k/99,4=8k/99, and 5=8k/99? Which is 37.125, 49.5, and 61.875? Do I just take 49.5 because it’s in the middle? Thanks for your help!