Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#26 2014-12-22 22:40:21

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Please Post By 10:30 Eastern Time!!!

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

#27 2014-12-23 01:01:50

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,594

Re: Please Post By 10:30 Eastern Time!!!

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...

IjIxrtx.png

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

#28 2014-12-23 02:40:44

deoxysxxxx
Member
Registered: 2014-12-21
Posts: 9

Re: Please Post By 10:30 Eastern Time!!!

...and I don't know what you guys are talking about.

Offline

#29 2014-12-23 07:42:44

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Please Post By 10:30 Eastern Time!!!

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

#30 2014-12-23 11:10:47

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,594

Re: Please Post By 10:30 Eastern Time!!!

Is this what you meant?

pmufygT.png

Anyway, your suggestion has helped to uncover a flaw in my column C code. Thanks! smile 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

#31 2014-12-23 14:14:59

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Please Post By 10:30 Eastern Time!!!

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

#32 2014-12-23 22:54:58

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,594

Re: Please Post By 10:30 Eastern Time!!!

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. smile

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

#33 2014-12-23 22:59:05

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Please Post By 10:30 Eastern Time!!!

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

#34 2014-12-23 23:02:45

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,594

Re: Please Post By 10:30 Eastern Time!!!

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

#35 2014-12-23 23:04:27

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,594

Re: Please Post By 10:30 Eastern Time!!!

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

#36 2014-12-23 23:07:34

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Please Post By 10:30 Eastern Time!!!

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

#37 2014-12-23 23:17:23

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,594

Re: Please Post By 10:30 Eastern Time!!!

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

#38 2014-12-23 23:19:42

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Please Post By 10:30 Eastern Time!!!

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

#39 2014-12-23 23:28:31

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,594

Re: Please Post By 10:30 Eastern Time!!!

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

#40 2014-12-23 23:31:00

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Please Post By 10:30 Eastern Time!!!

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

#41 2014-12-23 23:38:34

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,594

Re: Please Post By 10:30 Eastern Time!!!

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

#42 2014-12-23 23:41:30

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Please Post By 10:30 Eastern Time!!!

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

Board footer

Powered by FluxBB