Jump to content


Please note: You can easily log in to MPN using your Facebook account!

Very OT: More mathy hardness


Phred

Recommended Posts

Cookie monster has some cookies that he wants to sell at the market 1000 miles away... He has 3000 cookies, and he can only carry 1000 cookies at a time. Also, for every mile that he walks he has to eat 1 cookie. (So, he can not go anywhere with no cookies). Don't forget he needs cookies to eat for return trips too...

 

What is the maximum amount of cookies that he can bring to the market?

 

This one is certainly less controversial than the monty hall one, but I found this difficult at first...

I'm just saying', everyone that confuses correlation with causation eventually ends up dead.
Link to comment
Share on other sites



  • Replies 61
  • Created
  • Last Reply
Originally posted by MidLifeCrisis:

A mind challenge:

 

There are 2 doors. One tells only lies. One tells only the truth. What is the 1 question you would ask, and to which door, to get through?

I think this is incomplete. More information is needed. Which door do we want to go through?

 

Assuming you are trying to find out which door is the liar, you would ask "would the other door say that you always tell the truth?" A response of "no" means you are talking to the truth telling door; a reply of "yes" means you are speaking to the liar.

Link to comment
Share on other sites

Ok, how about this fun one:

 

Three students checked into a hotel and paid the clerk $30 for a room ($10 each). When the hotel manager returned, he noticed that the clerk had incorrectly charged $30 instead of $25 for the room. The manager told the clerk to return $5 to the students. The clerk, knowing that the students would not be able to divide $5 evenly, decided to keep $2 and to give them only $3.

 

The students were very happy because they paid only $27 for the room ($9 each). However, if they paid $27 and the clerk kept $2, that adds up to $29. What happened to the other Dollar?

Link to comment
Share on other sites

The question is "which door would the other door say I should go through?" The answer always has exactly one negation in it, so you do the opposite.

 

I'll have to think about the cookies, but no doubt it involves caching. How to figure the optimum, though ... hmmm.

Link to comment
Share on other sites

Originally posted by learjeff:

I'll have to think about the cookies, but no doubt it involves caching.

Optimum Cookie Caching Algorithm

In free list algorithms for cookie management, the system keeps a list of available cookies for allocation. This list is known as the "free list". When cookies needs to be allocated, the free list is traversed until a block of cookies is found that will fit the allocation needs. The exact way that this search is performed is the basis for several variations of free list algorithms.

 

When cookies are freed, after being used, they are replaced in the free list, and "coelesced" with other free cookies adjacent to them to form a large contiguous block of free cookies. For example, if I free cookies 2000 to 3000, but 1000 to 2000 were already free, then 1000 to 3000 is a single contiguous block, obtained by coelescing the two free regions. Without this coelescing process cookies would soon become deeply fragmented, and no requests for large blocks of cookies could succeed. To keep that coelescing process cheap and fast, the free list is typically kept in sorted order by cookie address.

Steve

A Lifetime of Peace, Love and Protest Music

www.rock-xtreme.com

Link to comment
Share on other sites

Originally posted by garrafon:

Ok, how about this fun one:

 

Three students checked into a hotel and paid the clerk $30 for a room ($10 each). When the hotel manager returned, he noticed that the clerk had incorrectly charged $30 instead of $25 for the room. The manager told the clerk to return $5 to the students. The clerk, knowing that the students would not be able to divide $5 evenly, decided to keep $2 and to give them only $3.

 

The students were very happy because they paid only $27 for the room ($9 each). However, if they paid $27 and the clerk kept $2, that adds up to $29. What happened to the other Dollar?

Pedestal tax.
Link to comment
Share on other sites

Originally posted by MidLifeCrisis:

They didn't pay $27 for the room.

The paid $25 ($30 original fee - $5 returned = $25)

 

Thats $8.33 each or $24.99 (effectively $25)

They get $1 each back. That's $9.33 each or $27.99 (effectively $28)

Add in the $2 for the clerk and you have $30

I know you're probably right in your answer, but to me I can't understand that the guys didn't pay 27$, because for any of them (the 3 guys) they end up as if they paid 9$ each. :confused:

 

I guess I'm not that good in maths as I thought. :freak:

Link to comment
Share on other sites

Originally posted by MidLifeCrisis:

A mind challenge:

 

There are 2 doors. One tells only lies. One tells only the truth. What is the 1 question you would ask, and to which door, to get through?

The question to ask is 'What's my mutha $%^*#^& name?', and if the door doesn't answer 'Snoop Doggy Dogg', you know that it knows nothing of hip hop, and go through the other door.
A ROMpler is just a polyphonic turntable.
Link to comment
Share on other sites

Originally posted by Phred:

Cookie monster has some cookies that he wants to sell at the market 1000 miles away... He has 3000 cookies, and he can only carry 1000 cookies at a time. Also, for every mile that he walks he has to eat 1 cookie. (So, he can not go anywhere with no cookies). Don't forget he needs cookies to eat for return trips too...

 

What is the maximum amount of cookies that he can bring to the market?

 

This one is certainly less controversial than the monty hall one, but I found this difficult at first...

Why would the cookie monster want to sell cookies?

 

He consumes 5 cookies per mile for the first 200 miles (counting the ones he leaves behind for his return trip (which birds promptly eat))

 

3 cookies per mile for the next 333 miles and 934 for the remainder of his trip. So he delivers 66 cookies to market. Perhaps a couple more as I did not calculate out the edge conditions exactly.

 

Somebody should write a perl script ...

Link to comment
Share on other sites

Originally posted by Cydonia:

Originally posted by MidLifeCrisis:

They didn't pay $27 for the room.

The paid $25 ($30 original fee - $5 returned = $25)

 

Thats $8.33 each or $24.99 (effectively $25)

They get $1 each back. That's $9.33 each or $27.99 (effectively $28)

Add in the $2 for the clerk and you have $30

I know you're probably right in your answer, but to me I can't understand that the guys didn't pay 27$, because for any of them (the 3 guys) they end up as if they paid 9$ each. :confused:

 

I guess I'm not that good in maths as I thought. :freak:

This "dilemma" is really just slight of hand if you think about it. Let's follow the real dollar trail. The students paid $30.00. Then, they got $3.00 back, the clerk kept $2.00, and the manager kept $25. You add that together ($25 + $3.00 + $2.00) and you get the full $30.00.

 

Or, think about it this way: How much money does the manager now have? $25.00. How much does the clerk have? $2.00. How much do the students have? $3.00. This adds to $30.00.

 

The "trick", if you will is that you can't consider what the students "think" they paid together with what was actually paid. To mix the two is the proverbial mixing of apples and oranges. Although they think they paid $27.00 total, they actually paid less (because the clerk kept some). They actually paid $25.00 for the room (which the manager has), the clerk stole $2.00, and they got $3.00 back, for a total of $30.00.

Link to comment
Share on other sites

This is a solution... there are better.

 

CM 1000 at a time 400 miles, eating 800 cookies on each trip (400 there, 400 back), so 200 cookies make it to 400 miles on each trip... except the last one where he doesn't have to walk back.

 

There are now 900 cookies @ the 400 mile mark.

 

CM walks them to market, eating 400 more cookies.

 

500 cookies make it... he shouldn't have gone 400 miles on the first leg or more cookies would be left, but hey... he's not that bright.

 

Lerb

Link to comment
Share on other sites

Originally posted by Hobo:

I can get him to the market with 500 spare but if he sells them he can't go home?

Ha ha ha - don't worry about getting him home... He can buy a car with the sale from his cookies..
I'm just saying', everyone that confuses correlation with causation eventually ends up dead.
Link to comment
Share on other sites

lerber...

 

First there is a math error. The second leg he has to walk 600 more miles, not 400. So he gets 300 cookies.

 

Close. The caching idea is good, but the trick is to find the ultimate place to cache.

 

HINT:

 

You start with 3000 cookies. As long as you have more than 2000 cookies, it takes 5 trips to bring all the cookies anywhere right (3 trips, and 2 return trips in between)?

 

When he has 2000 cookies or less but more than 1000, it takes 3 trips (2 trips there, and one return).

 

And finally when he has 1000 or less, he can walk straight there...

 

Does this help find the ultimate place to cache the cookies?

I'm just saying', everyone that confuses correlation with causation eventually ends up dead.
Link to comment
Share on other sites

A Census-taker stopped at a lady's house and wanted to find out how many children she had. The lady, a math teacher, wanted to see if the Census-taker still knew his math.

Census-taker to lady: How many children do you have?

 

Lady: Three.

 

Census-taker: How old are they?

 

Lady: the product of their ages is 36.

 

Census-taker: Well, that's just not enough information.

 

Lady: The sum of their ages is our house number.

 

Census-taker looks at the house number thinking this would give it away, but says: Still not enough information!.

 

Lady: My oldest child plays the piano.

 

Census-taker: AHA! I know now. Thank you!

 

How did the census-taker figure out their ages? CAN YOU? What are their ages?

Steve

A Lifetime of Peace, Love and Protest Music

www.rock-xtreme.com

Link to comment
Share on other sites

Question - does he need to eat DURING the trip? If not, he can stuff himself with 2000 cookies, one for each mile to and from the market, haul the remaining 1000 cookies to the market and retire in luxury. :)
Reality is like the sun - you can block it out for a time but it ain't goin' away...
Link to comment
Share on other sites

There must be a good formula to do all the math out (which I'm not inclined to do at this time), but it seems to me that to shuffle the 3000 cookies along, it will cost cookie monster 5 cookies per mile. Why?

 

Because he first moves 1000 cookies 1 mile at the cost of 1 cookie (net 999). But, he has to go back to get more cookies. So, the round trip (with the second load of 1000) is now 2 cookies. Now he has to do the same thing with the next set of cookies - for a total of four cookies. To move the third set of 1000, he does not need a return trip, so it only costs 1 cookie. Thus, we have a total of 5 cookies per mile at this point in time.

 

Somewhere down the line, as his cookies diminish, this cost per mile will decrease. This will likely occur where he stops having to made an extra return trip to pick up another batch (i.e. where his cookie count drops below 2000). As I'm now thinking about it, if he is consuming 5 cookies per mile, he will use 1000 cookies after 200 miles.

 

So, at 200 miles, his cookie consumption per mile rate will decrease to 3 cookies per mile (one round trip to get the first batch of 1000 (costing two cookies), and a one way trip to get the second 1000 (costing 1 cookie)). This cookie consumption rate should continue until we have less than 1000 miles.

 

So, at another 333 miles (for a total of 533 (leaving 467 remaining miles), he will have 1000 cookies left. Now his cookies consumption rate changes to 1 cookie per mile, because he doesn't need to make any more round trips (this has been an exhausting trip). That leaves him with 1000-467 cookies when he gets to market, or 533 cookies.

 

Does that make sense?

Link to comment
Share on other sites

That's right!!! Here is my solution which uses the math which is actually quite simple...

 

 

3000 cookies.

 

Every mile will cost him 5 cookies, until he hits 2000 cookies. So where does that happen? When he has eaten 1000 cookies.

 

5 x Miles = 1000

Miles = 1000/5 = 200

 

So at 200 miles he has 2000 cookies. (quick check: he brings 1000 cookies 200 miles, drops 600 bringing 200 back for the return trip. Does this two more times. Now has 600 + 600 + 600 + 200(he doesn't need to go back after the last trip)

 

Now, it costs him 3 cookies for each mile - until he hits 1000 cookies. Where does this happen?

 

3 x Miles = 1000

Miles = 1000/3 = 333.3333

 

He now has 1000 cookies left at 533.333 (200 + 333.333) miles in. He needs to walk an additional 466.666 miles. That leave him with 533 1/3 cookies to sell. Not sure if anyone will buy the 1/3 of the cookie though.

 

Peter

I'm just saying', everyone that confuses correlation with causation eventually ends up dead.
Link to comment
Share on other sites

Originally posted by MidLifeCrisis:

A Census-taker stopped at a lady's house and wanted to find out how many children she had. The lady, a math teacher, wanted to see if the Census-taker still knew his math.

Census-taker to lady: How many children do you have?

 

Lady: Three.

 

Census-taker: How old are they?

 

Lady: the product of their ages is 36.

 

Census-taker: Well, that's just not enough information.

 

Lady: The sum of their ages is our house number.

 

Census-taker looks at the house number thinking this would give it away, but says: Still not enough information!.

 

Lady: My oldest child plays the piano.

 

Census-taker: AHA! I know now. Thank you!

 

How did the census-taker figure out their ages? CAN YOU? What are their ages?

Possible choices:

 

6, 3, 2

4, 3, 3

36, 1, 1

6, 6, 1

18, 2, 1

 

Since even a 1 year old can reach up and whack the keys on a piano, that's not very helpful information. :) Were you supposed to reveal the house number?

Reality is like the sun - you can block it out for a time but it ain't goin' away...
Link to comment
Share on other sites

Originally posted by kad:

Since even a 1 year old can reach up and whack the keys on a piano, that's not very helpful information. :) Were you supposed to reveal the house number?

The house number is not to be revealed.

By playing the piano she means he actually plays (takes lessons)

Steve

A Lifetime of Peace, Love and Protest Music

www.rock-xtreme.com

Link to comment
Share on other sites

I'm going to go with 6, 3, 2.

 

The 36 year old and 18 year old are technically not "children". The 4 year old is a little too young and in the case of 6, 6, 1 there is no "oldest" child.

 

Am I correct??

Reality is like the sun - you can block it out for a time but it ain't goin' away...
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...