Lets say you have a deck with 10 cards each of 8 different colors. You then deal 40 card to someone. So you would expect their hand to be 5 cards of each color. You then get the additional knowledge through play that 6 of those 40 cards are yellow. So now what is the expected number of yellow cards out of the 40? What is the expected number of green cards?
The way I calculated the answer for yellow, is that it would be the sum of the P(that they got exactly 6 yellow cards) * 6 + P(that they got exactly 7 yellow cards) * 7 + P(that they got exactly 8 yellow cards) * 8 + P(that they got exactly 9 yellow cards) * 9 +P(that they got exactly 10 yellow cards) * 10: $$E(yellow)\sum_{k=6}^{10} P(k) * k$$
If we were to calculate the P(that they got exactly k cards) it can be done using the hypergeometric distribution function. Or in google sheets: =hypgeomdist(k,40, 10, 80)
but since we know that k 0..5 didn't happen I normalized it by dividing by the sum of the probabilities that it could still be: $$P(6) = hypgeomdist(6,40, 10, 80) / \sum_{k=6}^{10} hypgeomdist(k,40, 10, 80) $$ or 0.578.
Doing likewise for the other numbers and plugging into the formula for expected values I got 6.5609691926 yellow cards in the original 40 dealt. Does this seem correct to you?
For the green or other colors I would think that they then no longer can be 5 but something less. I would think I could calculated it by $$\sum_{k=6}^{10} P(k) * E(green)$$. where $$E(green) = 10/(80 - k) * (40 - k)$$ because if we remove k yellow ones from the deck and there will be at 10/(80-k)
chance each time of getting a green and we would still have been picking 40-k
other cards. However that ends up working out to be E(green) = 4.55
but this seems wrong, because I should also be able to calculate it with $ E(green) = (40 - E(yellow)) / 7 $ since the other colors should have the same probability, and that works out to: 4.777. What am I doing wrong? How can I get to 4.777 without relying on E(yellow) for if the number of cards of the other colors weren't the same in the original deck I wouldn't be able to do that?