Math Is Fun Forum

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

You are not logged in.

#326 2010-07-27 11:09:14

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

Re: What do you think?

Thanks for your thoughts, Bobby...much appreciated.

Death was on the cards for quite a few weeks and I thought I'd be prepared for it emotionally, but not so. A few tears at first, but time's a great healer and I'm just about ok with it now.

Yes, there is a switch in M that you can turn on/off - for each program, I think. I've set it globally to come on at startup, and that works fine. There are other settings for better efficiency, but I haven't tried them yet and other than launching parallel kernels at startup I'm just using the default settings.

The Timing function doesn't work properly now, though, and reports only about a third of the actual time taken. But that still amounts to a speed increase of about 50% over the non-optimized code, so I'm still happy.


"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

#327 2010-07-27 12:36:46

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

Re: What do you think?

Glad you are recovering well.

M is one of the first programs to actually arttempt to use multiple cores. Lots of programs don't. Software is such garbage! And they want money for it!


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

#328 2010-07-28 02:27:26

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

Re: What do you think?

Hi Bobby,

M is one of the first programs to actually arttempt to use multiple cores. Lots of programs don't.

LB does...sort of. On my quad it uses 2 cores, but only up to about 50% capacity of each. If I boot up my quad as a 2-core, LB runs on just one core...at 100%. The processing time for both options is the same.

Software is such garbage! And they want money for it!

Here's a little-known (or not-known, even...although I know it) fact about the term "software". That word is actually a contraction of "soft touch beware" (in other words: "pushovers watch out"; or, in different other words: "caveat emptor").

This self-warning idea, while commendable, has nevertheless missed the intended mark (Mark probably didn't even see it), because (as I see it) those unfortunates who happen to be a 'soft touch' are hardly likely to be able to spot that word's cryptic inference.

Clearly, the coining of the term "software" is a blatant self-admission of the pitfalls surrounding the purchase of such goods ("bads", actually).

Last edited by phrontister (2010-07-28 03:15:56)


"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

#329 2010-07-28 06:57:17

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

Re: What do you think?

HI phrontister;

Reminds me, all I do is see some nice piece of hardware trying to run using those pathetic drivers that Bill provides. Okay, clearly he is a crook, so you use the drivers the company provides on the cd or dvd. Now the device doesn't work at all. Take my printer for example, takes 300 megs of drivers to get it going.


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

#330 2010-08-01 20:38:42

jimmyR
Member
Registered: 2009-05-29
Posts: 143

Re: What do you think?

Hi bobbym;

All I can  say right now, is that seems close to the right answer. So good work!
You are correct in saying if might need computer assistance. All the math ideas I am
trying are really hard work.

Elaina would very much like to see your solution. She said you wouldn't post a problem without having 3 ugly answers. She has the exact answer and will post it if you will post the method that get's it.

Offline

#331 2010-08-01 20:48:52

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

Re: What do you think?

Holmes wrote:

You know my methods, Watson.

Sure! Tell her to post what she thinks is the correct answer anywhere or anytime she wants. But I will not come clean with my solutions unless she has the exact answer. She can post her tries with you if she still has not settled in.


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

#332 2010-08-04 15:16:59

jimmyR
Member
Registered: 2009-05-29
Posts: 143

Re: What do you think?

Hi bobbym;

Elaina gave me this to post to you. I have the same answer so it looks like she has a method.

Elaina VW wrote:

For your two dice expectation problem. Tries, schmies! Is this exact enough for you? Kiss, kiss!

Offline

#333 2010-08-04 15:22:03

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

Re: What do you think?

Hi jimmyR;

She is correct. I will post my solutions as soon as I can.

To bring everything to the front it is Prob #53, post #273

Two die are thrown at once. The sample space is 2,3,4,5,6,7,8,9,10,11,12. How many times must this be done on average to get all eleven numbers?


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

#334 2010-08-06 16:22:42

Fruityloop
Member
Registered: 2009-05-18
Posts: 143

Re: What do you think?

Two die are thrown at once. The sample space is 2,3,4,5,6,7,8,9,10,11,12. How many times must this be done on average to get all eleven numbers?

I am amazed that somebody got the exact answer!  Good job! I would really like to see the solution.  I wracked my brain trying to figure it out.

Offline

#335 2010-08-06 17:07:28

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

Re: What do you think?

Hi jimmyR, Fruityloop and you too, Elaina VW.

Elaina;

Tries, schmies? My solutions are ugly?

This is a coupon collector problem. As you know most serious problems in combinatiorics fall in to one of several types. Urn problems, birthday problems, coupon collector problems...

This is the probabilities of all the possible throws of 2 dice, not in order!

Here we see the problem already, the probalities aren't equal. In the standard CCP the probabilities are uniform, for instance:

What is the expected number of throws to get all six faces of a single die? The answer involves the Harmonic series and can be proven to be:

So the expected number for 1 die is 14.7 throws. When the probabilities are not uniform we have to resort to difficult methods that require packages to assist with the math. This first method is the standard book way and only involves the evaluation of an integral.

This is a very difficult integral and can be attacked through numerical methods. I won't do any of that here as we are interested in a combinatorics problem not numerical analysis.

Mathematica does the integral for us but I am sure many other packages would do as well.

Integrate[1-Product[1-Exp[-p[[i]]*t],{i,1 ,11}],{t,0,∞}]

The answer is:

There are two ways to verify this answer's correctness. Fruittyloops simulation answer (post #312) which is quite close and by providing another method. I have another method that I developed for this problem, if you would like to see it then I will provide it. Remember this is an active area of research, working on CCP with non uniform probabilities is an open 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

#336 2010-08-13 05:06:12

Fruityloop
Member
Registered: 2009-05-18
Posts: 143

Re: What do you think?

Well, after reading your post I don't feel bad I couldn't solve it.  I knew how to solve it when the probablilities are the same but when they are different it is very complicated.  If you have come up with another method for solving this problem I'm sure that I and the other members would like to see it.  Anyways here's a couple problems I made up myself.  I'm fairly certain that I have the right answer but I'm not 100% certain.  If I'm wrong I'm sure the other members will let me know!

1.  You have 15 boxes. Five of them are empty.  Ten of them have the following dollar amounts.
     1, 5, 6, 7, 13, 14, 16, 17, 18, 25.
     You keep opening boxes and you win whatever is in the box until you open an empty box, at which point you stop.
     What is the average amount won by the player?

2. You have 3 boxes which contain $2, $3 and $5.  You pick a box and win the dollar amount inside the box.  Inside one of the three boxes along with the money is a piece of paper which has 'Play again' written on it.  If the box you pick happens to contain the slip of paper, you get to play again with exactly the same conditions.  If you don't get the box with the piece of paper you then stop.
      What is the average amount won by the player?

Last edited by Fruityloop (2010-08-13 05:18:58)

Offline

#337 2010-08-13 10:36:33

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

Re: What do you think?

Hi Fruittyloop;

Since my solution appears unique ( I have not seen it before ) I wanted the chance to clean it up. Since you are asking I will provide it as soon as I can.


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

#338 2010-08-13 13:16:52

Fruityloop
Member
Registered: 2009-05-18
Posts: 143

Re: What do you think?

BobbyM,
     I have a different answer to #1.

Last edited by Fruityloop (2010-08-13 13:36:48)

Offline

#339 2010-08-13 13:19:16

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

Re: What do you think?

Hi Fruityloop;

Did you 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

#340 2010-08-13 13:23:47

Fruityloop
Member
Registered: 2009-05-18
Posts: 143

Re: What do you think?

No I didn't, so maybe your answer is correct.
Ok.  Here's what I have...

Last edited by Fruityloop (2010-08-13 13:33:04)

Offline

#341 2010-08-13 13:40:38

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

Re: What do you think?

Hi;

Why  8 / 3?


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

#342 2010-08-13 13:54:45

Fruityloop
Member
Registered: 2009-05-18
Posts: 143

Re: What do you think?

Bobbym,
     The 5 empty boxes divide the 10 boxes into 6 segments.  So the average number of boxes with money until an empty box is reached is 10/6 = 5/3.  The empty box is next, so we have 8/3 boxes to reach an empty box.   I thought my answer was correct, but if you have wrote a simulation and done so correctly then I can't really argue with that.

Last edited by Fruityloop (2010-08-13 13:57:38)

Offline

#343 2010-08-13 14:13:57

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

Re: What do you think?

Hi;

Maybe, there is something wrong with my simulation. Let me check and I will repost.


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

#344 2010-08-13 15:22:57

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

Re: What do you think?

Hi Fruityloop;

My simulation and series idea keep checking out.

You can also reason about it like this, 1 / 3 pf the boxes are empty. The expected number to get an empty box is the reciprocal of 1 / 3,= 3. Two which have money. 2 * 12. 2 = 24.4.


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

#345 2010-08-13 16:43:32

Fruityloop
Member
Registered: 2009-05-18
Posts: 143

Re: What do you think?

Wait! I think I know what the problem is, we are thinking about two different problems.  In the problem I posted the player is supposed to pick a box, that box becomes empty, and the player continues picking boxes, emptying them along the way until he reaches an empty box.  You are thinking that the player picks a box, the situation starts all over again and the player picks again, so in theory the game could go on forever.  Maybe I should be more clear next time!

Offline

#346 2010-08-13 17:23:41

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

Re: What do you think?

Hi Fruityloop;

Yes, that would account for the difference. Sorry, I will work on it that way.

Looks to me that your #1 is correct. For a simulation of 500 000 I got 20.40, very close.

Your solution is also nice and I really cannot improve on it. I can only offer an alternative,

Using the hypergeometric distribution, the expected number of boxes picked without replacement until you hold one empty box is:

Since the last box is empty there are 8 / 3 - 1 = 5 / 3 boxes that are not. Each one has an average value of 122 / 10.

So (122 / 10)(5 / 3) = 61 / 3.


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

#347 2010-08-15 20:29:59

jimmyR
Member
Registered: 2009-05-29
Posts: 143

Re: What do you think?

Hi Bobby;

Me and you know who want to see your solution.

Offline

#348 2010-08-15 23:41:44

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

Re: What do you think?

Hi jimmyR, Fruityloop, Elaina VW;

This is one of the book ways from post #335.

The only way to illustrate my idea is to use a toy problem that is much smaller.

Suppose we have a 4 sided object and we want the number
of throws to get all 4 sides. The probabilities of each side coming up are:

The solution is very similar to the principle of inclusion exclusion.

The  probabilities are taken 1 at a time, 2 at a time etc,

This is the correct answer and can be checked using the integral.
You see the problem. For even a small list like the real problem
this method grows very cumbersome and a computer is required.

For the real problem with 2 die the list p is:

Mathematica code is required to generate the fractions.

Append[Total[1/KSubsets[p,1]],Table[(-1)^(k-1) Total[1/Total[#]&/@KSubsets[p,k]],{k,2,Length[p]}]]//Flatten

Total[%]

Same answer as the integral provided in post #335. Is this an improvement? I don't think so but it is I believe a new method. I have shown I can solve this problem in 2 different ways. Ugly or not, is another matter. Does this satisfy you Elaina? I do know of yet another way that involves markov chains but have not implemented it yet.


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

#349 2010-08-25 14:51:36

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

Re: What do you think?

So simple it is hard?

The question:

The pupil cannot understand why 0.3 = 0.30 = 0.300 etc. and both the tutor and myself are at a loss to explain it in clear terms. I have researched the internet and did not find a clear explanation either. Any idea?

The answer.

bobbym wrote:

Since in the positional number system to the base 10, .3 really is 3 / 10 and .33 is 3  / 10 + 3 / 100 and .3304 is really 3 / 10 + 3 / 100 + 0 / 1000 + 4 / 10000. when you have:

Keeping in mind that 0 / 10 = 0 and 0 / 100 = 0 and 0 / 1000 = 0 etc.




You can see that those trailing zeros are not changing the value of that decimal at all. You are adding nothing to .3 = 3 / 10 many times.

For more go here.

http://www.mathisfunforum.co/viewtopic. … 47#p148747

What do you think of the answer?

A says) What balderdash. That answer is do-do. He explained nothing and later on confused the questioner with overkill.

B says) Simply marvelous! I would like to know the fellow that answered that question. He really nailed that answer. Providing the auxiliary definition was a stroke of brilliance! Wunderbar!

C says) A is right. The OP's response shows he didn't explain anything. I can't believe they let him answer questions. The guy is a fraud.

D says) It is an okay reply. I agree it didn't answer the question.

What would you have done to answer the question and why?


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

#350 2010-08-26 01:24:30

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

Re: What do you think?

Hi allanmc0719;

Yes, we can help but you have to post them. And when you do please put them in the help section by starting a new topic. That's where they get quick answers.


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