Let do probability!

Posted By: PrenceOfDarkness

Let do probability! - 02/14/12 15:30

Hey guys, I'm currently working on a fun project and I need some help. Imagine if you will you have a bag of balls (lawl bag of balls) and in that bag of balls are 3 red balls 4 green ball 2 blue balls(LAWL) and 1 yellow balls. Also in this bag there are 55 other balls that can be any other color other then the once already mentioned. To keep things simple lets say the other 55 balls are black.

What I want to figure out is what is if I pick 7 balls at random what is the probability that I will pick at least one of each of the non black balls?

I was thinking I'd obviously have to use Multivariate Hyper-geometric Distribution. But then I realized that I think that might not work since Multivariate Hyper-geometric Distribution is usually used for determining an exact amount as oppose to an "at least" certain amount.

If we wanted to calculate the probability of picking exactly one of each and we were only picking 5 I think the equation would look like this:

NOTE: the c is short for choose which is used to represent a combination where order doesn't matter.

Code:
(4c1 * 3c1 * 2c1 * 1c1 * 55c1)/65c5



I was thinking to solve my question I could modify it to look like so:

Code:
4c1 * 3c1 * 2c1 * 1c1 * 61c3)/65c7


My reasoning behind is this: as long as one of each color is present we don't care what the other 3 picks are. Thinking about it it seems wrong to just add 6 to the last combination. Let me know what you guys think.[i][/i]
Posted By: PrenceOfDarkness

Re: Let do probability! - 02/15/12 16:41

lol, really that hard?
Posted By: Damocles_

Re: Let do probability! - 02/15/12 16:50

10 colored balls, 55 black balls (no white balls..)

Dont remember the probability stuff anymore in detail

But if you break it down, for 2 balls, it should be:

p1=10/55
p2=9/55*p1 + 10/54*(1-p1)
p2=0.2094 = 21% chance

or?
Posted By: PrenceOfDarkness

Re: Let do probability! - 02/15/12 16:57

hey damocles.. you're still with this engine? Wow, your talent is going to waste here wink

Actually that wont be true because your calculating the exact probability of 2 balls, so if you wanted to do what your saying it's better to use the standard hypergeometric distribution. If you wanted AT LEAST 2 balls then your way unfortunately wouldn't work. I say unfortunately because that would of been soooo easy... sad face frown
Posted By: Damocles_

Re: Let do probability! - 02/15/12 17:03

Im wobbeling in the Forums a bit, most stuff I do is in Java currently.
(some small 4 kilobyte games in by signature)
But I do some trials in the engine sometimes.

---

But my calculation is the chance of picking at least 1 colored ball when doing 2 draws. (without putting the ball back)
Quote:
What I want to figure out is what is if I pick 7 balls at random what is the probability that I will pick at least one of each of the non black balls?


Wich can be continued to 7 balls in this manner)
Not the chance of drawing exact 2 colored balls.

I would have to look up the Math for probability distributions
to get a more fancy answer wink
Dont rememeber that stuff on the fly.
Posted By: PrenceOfDarkness

Re: Let do probability! - 02/15/12 17:16

Do you have any idea where I should look? I don't even know where to start. I'm 99% sure this will be a variation of Hypergeometric Distribution. Multivariate is the closes I can get but it's not what I need because Multivariate consist of EXACT amount.

I'm having a tiny bit of trouble understanding you. Maybe you can explain how I could take it to 7 balls in this manner. You don't need to go for the fancy answer since I wouldn't want to be that big a bother.
Posted By: PrenceOfDarkness

Re: Let do probability! - 02/15/12 17:21

http://saliu.com/theory-of-probability.html#Trials

Quote:

8. The Probability (Odds) of Inseparable Events, Single Trial
The calculations are based on what I call exponential sets. The Birthday Paradox is a particular case of exponential sets. Such sets consist of unique elements and also duplicates. The unique part of an exponent is equal to the arrangements type of the set. The part with at least two elements equal to one another is the difference between exponents and arrangements.

In the probability problem of four dice, the Birthday Paradox parameters are: lower bound = 1, upper bound = 6, total elements (number of dice) = 4. The probability to get at least two dice showing the same point face when throwing four dice is: 0.7222 or 1 in 1.385. Easy to verify. Throw four dice. In almost three out of four rolls, at least two dice show the same face.

Also, the probability to get the four dice show the same point face is precisely calculated by using the exponential sets. A die has six faces — always! To get exactly 1-1-1-1 = 1/1296; the probability to get exactly 6-6-6-6 = 1/1296; the probability to get exactly 1-2-3-4 = 1/1296.

The pick 3, 4 lottery games should be considered forms of dice rolling — therefore inseparable phenomena. A drawing machine is a 10-face die. The pick 3 game is like casting three 10-faceted dice. The slot machines, by extension, are the equivalent of casting multi-faceted dice (usually three dice).

~ Another probability problem that pops up in forums and newsgroups and emails. A jar contains 7 red balls, 6 black ball, 5 green balls, and 3 white balls. We can construct a huge variety of probability problems with the 21 balls. For example, the probability to draw exactly 5 balls with this exact composition: 2 red, 2 black, 1 white. We must apply the hypergeometric distribution of each color.
- exactly 2 red of 5 drawn in 7 red from a total of 21 balls: 0.375645 (1 in 2.662)
- exactly 2 black of 5 drawn in 6 red from a total of 21 balls: 0.335397 (1 in 2.982)
- exactly 1 white of 5 drawn in 3 white from a total of 21 balls: 0.4511278 (1 in 2.217)
The combined probability is the product of the three: 0.056838 or 1 in 17.6.

How about the probability to draw 5 balls and get at least one ball of each color? Applying now the W option of SuperFormula.EXE (Win at least Lotto, Powerball):
- at least 1 red of 5 drawn in 7 red from a total of 21 balls: 0.9016 (1 in 1.109)
- at least 1 black of 5 drawn in 6 red from a total of 21 balls: 0.8524 (1 in 1.173)
- at least 1 green of 5 drawn in 5 green from a total of 21 balls: 0.7853 (1 in 1.273)
- at least 1 white of 5 drawn in 3 white from a total of 21 balls: 0.5789 (1 in 1.727)
The combined probability is the product of the four: 0.3494 or 1 in 2.86.



Idk, that seems wrong to me for some reason. Anyone else have a take on it? It just looks a bit too simple. Then again, no one said it had to be hard right? lol
Posted By: Damocles_

Re: Let do probability! - 02/15/12 17:23

Hm, before drawing number 3 there are 3 situations of ball combinations

8/55 ; 9/54 ; 10/53

after the draw

7/55 ; 8/54 ; 9/53 ; 10/52

where the first 3 have at least one colored ball

You have to somehow break the chance for each combination happening down.
Then you will see the systematics popping up.

Ok, I guess Im lost here too,

but Im not a math wiz, there are some math students here too,
please help out
Posted By: PrenceOfDarkness

Re: Let do probability! - 02/15/12 17:37

Btw the reason I feel it's wrong is because all the separate probability stated in green are all dependent on each other and without replacement. I think what is said in the green text above would only work if I had 5 different sets of bags with the listed balls and I wanted to get one of each from each separate set. Does anyone agree or disagree with that way of thinking?
Posted By: Hummel

Re: Let do probability! - 02/15/12 19:00

Why donīt you write a little script which calculates reference results by randomly picking balls several million times?
Posted By: PrenceOfDarkness

Re: Let do probability! - 02/15/12 20:38

The law of large numbers hummel
Posted By: Hummel

Re: Let do probability! - 02/15/12 21:42

ok...thatīs a strange answer to the question of why you donīt make use of this law, or did I miss something?
Posted By: PrenceOfDarkness

Re: Let do probability! - 02/15/12 22:31

The law of large numbers in a nut shell means that no matter how many trials I use it wont matter because that can be just a small percentage when compared to something like infinity.

Say you take a coin and you flip it not just a few million times but a few billion, no a few trillion times. Well there is nothing stopping the results to end up being 75% heads and 25% tails because when compared to infinity even a few hundred trillion can be considered a small trial.

In other words you can't reliably determine the probability of something just by running trials. If you've ever played a game with a rare item drop you know how gay it can be.. a 1in100 drop might not trigger until the 275+ time or more. Or you might get it on the 1st kill.

put another way, the only way you'll ever truly get a 50% heads and 50% tails result 100% of the time is if you flip the coin an infinite number of times. There is no large number when comparing to infinity.
Posted By: Superku

Re: Let do probability! - 02/15/12 22:37

Quote:
Idk, that seems wrong to me for some reason. Anyone else have a take on it? It just looks a bit too simple

Then find a counterexample (i.e. with a minimal amount of balls) that the quote is wrong.
Posted By: PrenceOfDarkness

Re: Let do probability! - 02/15/12 23:25

Trust me I've looked for it superku wink I'm having no luck. For some reason the only things I can find are wikiapedia entries which the math entries are always hard to read for me. I don't understand how they present the formulas.
Posted By: Hummel

Re: Let do probability! - 02/15/12 23:51

Quote:
The law of large numbers in a nut shell means that no matter how many trials I use it wont matter because that can be just a small percentage when compared to something like infinity.

Seams to be the opposite to what Wikipedia says:
Quote:
In probability theory, the law of large numbers (LLN) is a theorem that describes the result of performing the same experiment a large number of times. According to the law, the average of the results obtained from a large number of trials should be close to the expected value, and will tend to become closer as more trials are performed.

Of course there is a chance to get 75% heads and 25% even with a few million trys but the probability converges to zero.
Also you have to compare the amount of trys to the amount of possible results you can get for one try. Not to infinity.

In less than 10 minutes of coding you could get reference results which would tell you what solution might be the right (if the random-func you use is good).
Posted By: PrenceOfDarkness

Re: Let do probability! - 02/16/12 00:25

yea that's part of it but it should also go on to explain that it wont really matter how large a finite number is.

Quote:

In less than 10 minutes of coding you could get reference results which would tell you what solution might be the right (if the random-func you use is good).


you make a perfectly valid point in that case.

I'd still would like to know with no doubt how to do this mathematically for my own person growth/education.
Posted By: Joey

Re: Let do probability! - 02/18/12 17:16

that's an easy question. just build a probiablity tree and add the branches that yield the wanted experimental outcome. shouldn't take you more than 5 minutes.
© 2024 lite-C Forums