You are not logged in.
Of each possible draw? Yes, but maybe they should be done separately.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
The simulation process is as separate as I can manage.
I've increased the number of draws from 200000 to 1 million...which has had no effect on the results.
Here's an image from my spreadsheet for group A (the one with 21 marbles). For coding simplicity, I've used digits 1,2,3,4 for marbles r,w,b,g respectively.
Groups A, B & C are as per post #19:
A. r = 11, w = 3, b = 2, g = 5 (21 marbles)
B. r = 10, w = 3, b = 2, g = 5 (20 marbles)
C. r = 9, w = 3, b = 2, g = 5 (19 marbles)
A5 = 111111111112223344444, representing 21 marbles that comprise 11 reds ("1"), 3 whites ("2"), 2 blues ("3") and 5 greens ("4").
B5 = 3121 (for example), which is a random (using RANDBETWEEN) selection of 4 marbles from A5.
C5 = 1123, which is B5 arranged in ascending digit order.
D5 = 1234, representing the rwbg draw (but in ascending digit order).
F5 = 1123, representing the wbrr draw (but in ascending digit order).
H5 = 1113, representing the brrr draw (but in ascending digit order).
J5 = 1111, representing the rrrr draw.
E5, G5, I5 & K5 test D5, F5, H5 & J5 for a match with C5 & then record "1" for a successful draw, blank for fail.
So in this case...
E5 = blank
G5 = 1
I5 = blank
K5 = blank
Row 5 is copied down to row 1000004 for the operation to occur 1000000 times. Successful draws are then totalled (see row 3) and proportions (%) calculated (see row 4).
For the calculations of the other two groups (B & C) I deleted a "1" from A5 for group B and a further "1" for group C. In each case the spreadsheet automatically copied the new contents of A5 down column A.
Of the number of draws of 4 marbles from the bag, 22% from Group A are successful, as are 20% from group B and 19% from group C.
I ran the full simulation 5 times for each group A, B & C, with very similar results per group.
I can't see yet where I've gone wrong...
Last edited by phrontister (2017-02-25 22:11:45)
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
...and I don't know what you guys are talking about.
Offline
Hi;
Have you tried with the correct number of each to start?
...and I don't know what you guys are talking about.
Another way to get an answer to any probability question is to run a simulation.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Is this what you meant?
Anyway, your suggestion has helped to uncover a flaw in my column C code. Thanks! So in the image I dispensed with column C's code and instead just used the contents of column A.
The random selection formula is wrong, which must be the reason for the strange results. My code wasn't selecting only unused digits from column A (which means that in some draws I was choosing one or more already-chosen marbles), but I think I've got an answer for that with a UDF.
My simulation idea is probably on the right track, and I hope it will work fine after I fix the flaw.
Back to the drawing board...
Last edited by phrontister (2017-02-25 22:10:41)
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
Hi;
Just make sure you get an answer of 21 as above.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
My simulation isn't set up to get the answer 21. I'm using that answer to see if I can verify the required 25% success rate for each of the four draw options (1), (2), (3) & (4).
And the good news is......after fixing the column C code, the simulation now results in a 1-in-4 chance for each of those options.
Last edited by phrontister (2014-12-23 23:00:29)
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
Then by varying the composition of the urn ( 4 loops ) you could use it to get the answer of 21.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
I can't see how I could manage that with my spreadsheet. I'd probably have to switch over to M for that.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
Actually, I don't think I understand what you said...
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
There are no
For red = 1 to...
For white = 1 to ...
For blue = 1 to ...
For green = 1 to ...
Simulate to see if all probabailities are equal
Next green, blue, white, red
constructs for excel?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
I'd have to think. That sounds more like something for Visual Basic or Excel 4 Macro...or LB. And M, of course.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
I was just asking, it is not necessary. Hope you are having a good holiday.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Yes...some feet-up time without work pressures certainly is very good.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
Yes, enjoy it. How did you like this problem?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
I really enjoyed doing the Excel simulation. Because of some shortcomings in Excel functions (or absence of) I sometimes had to jump through hoops to put together suitable formulas. Good brain-scratching stuff!
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
It is a difficult problem even to program.
See you a bit later, couple of chores need to be done.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline