Saturday, September 6, 2008

Mousehunt Math Quiz #6: Mega Quiz

* QUESTIONS

1) 100 hunters catch 400 mice in 80 hours
How long does it take for 500 hunters to catch 250 mice?

2) Super brie market on discussion board
demand function is Q = 1000 / P + 200
supply function is Q = 2*P - 500
where Q = hourly quantity of super brie and P = price per piece of super brie
What is the super brie price at market equilibrium?
Please round off your answer to four decimal places.

3) Without mousehunters, mouse population doubles every 5 days. Without assassins, mousehunter population doubles every 100 days. State a possible hunting condition that sufficiently makes the mouse population ramain constant.

4) Speaking of our super brie donators, Jadey is taller than Barry but shorter than Emma. Gro's height is exactly the average of Emma's and Laura's. Jadey's height is closest to Gro's, but Laura's height is not closet to Gro's. Laura is not the shortest.
Please rank them in a descending order according to height.

5) How much does a donator, in average, donated to mousehunt math quizzes? (Super brie valued at 400 gold per piece)
Hint: visit the group's page for stats.

6) There are 7 white mice, 9 grey mice, 11 mutated white mice, 13 mutated grey mice.
How many arms, how many ears and how many colors are there in total?
Each mouse has two legs. Please don't be confused with arms.

7) This is from an investigation of Colleen - F.B.I.
A trusted trader always tell the truth.
A scammer always tell the lies.

Matt: I am a scammer OR Mickey is a scammer.
Michael: I am a scammer AND Michelle is a scammer.
Mickey: More than half of us are trusted traders.
Mark: Michelle is a trusted trader.
Mario: Muhammad is a trusted trader.
Muhammad: I am a trusted trader.
Michelle: I love martini, bon bon and M & M. **winks**

Please name all scammers.

8) Once upon a time, there were many bugs in Mousehunt application. Coding devs played bughunt. Dave was using pesticide, Giorgio - a pingpong racket, and Joel - a gun. Joel spotted a bug on Dave's forehead at the same moment that Dave spotted a bug on Giorgio's mustache and that Giorgio spotted a bug between Joel's thighs.
What is the 'aftermath' in your imagination?

9) Please help Townsend decipher King's reward code.
34429 = DIGBY
787372743 = ?

10) At a super brie reverse auction (minimum decrement = 5 gold apiece):

1st bid = x+20 apiece
2nd bid = y-30 apiece
3rd bid = x+y-50 apiece
...
7th bid = 0 apiece (wins)

Plot all possible x's and y's in a graph and calculate the area of the feasible region.

* SOLUTION

*****1)
1 hunter catch 400 mice in 80*100 = 8000 hours
1 hunter catch 1 mouse in 8000/400 = 20 hours
1 hunter catch 250 mice in 20*250 = 5000 hours
500 hunters catch 250 mice in 5000/500 = 10 hours

*****2)
At market equilibrium, quantity demanded = quantity supplied
1000/P + 200 = 2*P - 500
1000 + 200*P = 2*P*P - 500*P
500 + 100*P = P*P - 250*P
P*P - 350*P - 500 = 0
(P + 1.4228) (P - 351.4228) = 0
P + 1.4228 = 0 OR P - 351.4228 = 0
P = -1.4228 OR P = 351.4228
Since a price cannot be negative, P = 351.4228

*****3)
Population growth problem.

Your answer should implicitly or explicitly address that:
(1) Mousehunters can interfere mouse population growth.
(2) Mousehunters do something to mouse population so that net difference between births, deaths and migration is zero. 
(3) If there are mousehunters, mouse population increases by its own.

Statement (3) is given, so it should not be contradicted by your answer. The statement also implies that only mousehunters could 'possibly' interfere mouse population growth. Thus, statement (1) should follow.

There are many possibilities to answer this question.

Here is a very simple yet smart answer.
- Immigration of mice is not possible due to powerful military force. Mousehunters capture all the mice and imprison them separately in a controlled environment. Dead mice are immediately replaced by their clones.

Here is a simple answer.
- Immigration is prohibited, all mice are immortal, and mousehunters deport all new-born mice to somewhere outside the "universe" (area of study).

Here is a more complicated answer.
- Migration is prohibited, and 14.8698% of mice are killed by mousehunters every day.

You can calculate daily net growth rate for mouse population.
(1+g)^5 = 2
1+g = 1.148698
g = 14.8698%
We can say that without mousehunters, every day there are roughly 15% more mice.

An even more complicated answer might go through control of population structures in terms of gender and age (mice and mousehunters alike), assumptions of minimum reproduction age, fertility rate and even mouse-catch-per-day-per-hunter rate.

However, no one has gone that far.. lol

*****4)
Emma > Jadey > Barry.
Jadey's height is closest to Gro's. Therefore, Emma > Gro.
Gro's height is exactly the average of Emma's and Laura's. Therefore, Emma > Gro > Laura.
Laura is not the shortest. Therefore, Laura > Barry.
Emma > Jadey > Laura > Barry 
Laura's height is not closest to Gro's. As Chew Zi-Yen pointed out, this might not be clear. I tried to mean 'closest' as "adjacent in order"
Answer: Emma > Gro > Jadey > Laura > Barry

*****5)
Last entry is...
SB balance: 255
Gold balance: 230 000 

Add up all spendings:
SB balance: 255
Gold balance: 230 000 + 35 287 = 265 287

Total value = 255*400 + 265 287 = 367 287
Average = 367287/7 donators = 52469.5714 pieces of gold per donator

*****6)
White mouse: 2 arms, 2 ears
Grey mouse: 2 arms, 2 ears
Mutated white mouse: 2 arms, 3 ears (one extra ear)
Mutated grey mouse: 5 arms, 2 ears (three extra arms)

7+9+11+13=40 mice have 80 arms and 80 ears...plus 11 extra ears for mutated white mice and 3*13=39 extra arms for mutated grey mice.

Answer: 119 arms, 91 ears and two colors.

*****7)
Logic question. You should know about logical operators. Please search for a wikipedia article "Truth table" for reference.

- Matt cannot be a scammer. If Matt is a scammmer, what he says must be false. That is, he is not a scammer and Mickey is not a scammer. Then this contradicts with our assumption that Matt is a scammer. Thus, Matt is a trusted trader, and Mickey must be a scammer.
- Michael cannot be a trusted trader. If he is a trusted trader, what he says must be true. That is, he is a scammer and Michelle is a scammer. Then this contradicts with our assumption that Matt is a scammer. Thus, Michael is a scammer, and Michelle is a trusted trader.
- Mickey is a scammer. So, we know that from what he says, at least 4 of them are scammers.
- Mark's words confirm that he is a trusted trader.
- Mario's words imply that for Mario and Muhammad, both are trusted trader, or neither are trusted trader. 
- So far, we know that Matt, Michelle and Marks are trusted trader while Mickey and Michael are scammers. Because at least 4 of them are scammers, both Mario and Muhammad must be scammers.

Answer: Michael, Mickey, Mario, Muhammad

*****8)
Some of you complained about this question. Have you watched Jurassic Park? A mathematician had predicted that the park would collapse, using "Chaos theory".

But no, we don't go that far. We seem to have a event chain of "circular reference". Joel -> Dave -> Giorgio -> Joel. I expect that you have a mathematical sense of "dynamical systems". In other words, a point's position in its ambiant space depends on time. 

For example:
Pesticide has a "butterfly effect" yet accuracy depends greatly on distance.
A gunshot, if Joel decided to shoot, should have happened first if distance between the three was more than a few steps.

Well, to make it easy, I will give some SB to everyone who sent an answer to this question.

*****9)
SUPERBRIE
It's a cellphone dial code. Very easy. I know.

*****10)
We know that first bid must be greater than or equal to 30. Also, first bid must be at least 5 gold apiece more than second bid.
x + 20 >= y - 30 + 5 >= 30
Similarly,
y - 30 >= x + y - 50 + 5 >= 25
x + y - 50 >= 20

After simiplification,
y <= x + 45
15 >= x >= 10
y >= 55
y >= 70 - x

The feasible region is a triangle { (15, 55), (15, 60), (12.5, 57.5) }
Area = 1/2 * base * height = 1/2 * 5 * 2.5 = 6.25 square unit.

Monday, August 25, 2008

MouseHunt Math Quiz #5: Forcefield or Deathbot?

* PROBLEM

There is only one hunting location. You can buy cheese and traps by mail orders only. Goods are magically delivered within a few seconds after placing an order. But you can order goods only at midnight times.

You need cheese equivalent of 10 gold for hunting for a day (regardless of trap).
No minimum order value, but delivery charge of 200 gold per order will be applied, regardless of order value.

Forcefield cost = 500 gold
Deathbot cost = 550 gold
Drillbot cost = 1000 gold

You can use only one trap at a time, but you can switch traps whenver you wish.

The following is revenue for each trap.
Swiss army ~ 20 gold / day
Forcefield ~ 50 gold / day
Deathbot ~ 60 gold / day

Mice do not drop loot and do not steal gold.

In your inventory, you have:
a swiss army trap, 500 gold, but no cheese at all. Now it's midnight time, make a purchase decision now!

* EXAMPLE SCENARIO

You have 500 gold on day 0. Then you order cheese enough for 30 days (300 gold). Now you have no gold left (delivery charge = 200 gold).

On day 30, you have 600 gold (with a swiss army trap, you earn 20 gold per day). Then you spend all your gold for cheese enough for 40 days.

On day 70 (40 days later), you have 800 gold. Then you order a forcefield trap (500 gold) and cheese enough for 10 days (100 gold). Now you have no gold left.

On day 80 (10 days later), you have 500 gold (with a forcefield trap, you earn 50 gold per day).

* OBJECTIVE

Acquire digby drillbot as soon as possible.

* QUESTION

How many days do you need before you can purchase a drillbot?

***********************
* UPDATES

- Please start with: a swiss army trap, 500 gold, but no cheese at all. Please do not continue from the example scenario.
- Each and every order charges 200 gold for delivery, including an order of a trap without cheese
- Bonus question: assume that other things remain the same, but drillbot costs 800 gold (instead of 1000 gold).


***** ANSWER KEY *****

I use Wilbert Ho's format (Hope you don't mind :D)

MAIN QUESTION

Day 0 (START): Swiss/500 gold/No cheese
Buying 30 days' worth of cheese. (0 Gold left)
Day 30 (30d Later): Swiss/600 gold/No cheese
Buying 40 days' worth of cheese. (0 Gold left)
Day 70 (40d Later): Swiss/800 gold/No cheese
Buying the DEATHBOT (550g) and 5 days' worth of cheese. (0 Gold left)
Day 75 (5d Later): DeathBot/300 gold/No cheese
Buying 10 days' worth of cheese. (0 Gold left)
Day 85 (10d Later): DeathBot/600 gold/No cheese
Buying 16 days' worth of cheese. (240 Gold left)
Day 101 (16d Later): DeathBot/1200 gold/No cheese
Buying Digby Drillbot. (0 Gold left)

ANSWER = 101 days.


BONUS QUESTION

Day 0 (START): Swiss/500 gold/No cheese
Buying 30 days' worth of cheese. (0 Gold left)
Day 30 (30d Later): Swiss/600 gold/No cheese
Buying 38 days' worth of cheese. (20 Gold left) ***IT IS TRICKY RIGHT HERE***
Day 68 (38d Later): Swiss/760+20 gold/No cheese
Buying the FORCEFIELD (500g) and 8 days' worth of cheese. (0 Gold left)
Day 76 (8d Later): ForceField/400 gold/No cheese
Buying 20 days' worth of cheese. (0 Gold left)
Day 96 (20d Later): ForceField/1000 gold/No cheese
Buying Digby Drillbot. (0 Gold left)

ANSWER = 96 days.


***** EXPLANATION *****

There are two main decisions that you need to make.

(1) When/what to upgrade?

You can do a quick trial-and-error test and see that an upgrade is necessary for both main and bonus questions. So, an upgrade is necessary to acquire a drillbot sooner.

If you upgrade TOO EARLY (when you have little gold on hand), you will have to order several times and the delivery cost is very expensive. If you upgrade TOO LATE, you will lose an opportunity to harvest much higher earnings from Forcefield or Deathbot.

Timing is the toughest variable that you need to optimize. Did you realize that? lol...

(2) When/how much cheese to buy?

This is my recommended strategy: you should upgrade earlier if the number of orders remain the same.

For instance, you want to try Forcefield in the BONUS QUESTION. At the moment before upgrade, if you have 760-770 gold, you will need to order three more times; 780-890 gold -> order two more times; 900 gold -> you have enough gold to upgrade to FF and buy cheese that generates income of 1000 gold (drillbot 800 gold + delivery 200 gold) in one order. NOTE: If you have 750 gold or less, your progress will not go anywhere! Excel will help you determine these intervals quite quickly :).

In the example, you had better upgrade when you have 760 gold than 770 gold and 780 gold than 850 gold. This is because an early upgrade will give you higher profits from FF but will not cost you more delivery charges.

OK, now you should try 760, 780 and 900 gold for FF route. You need to work back a bit and calculate the day you have 1000 gold on hand.
760 gold -> hunt with Swiss Army for 66 days and earn 1000 gold on day 100.
780 gold -> hunt with Swiss Army for 68 days and earn 1000 gold on day 96.
900 gold -> hunt with Swiss Army for 110 days and earn 1000 gold on day 130.

Do the same thing for DB route:
800 gold -> hunt with Swiss Army for 70 days and earn 1000 gold on day 97.
820 gold -> hunt with Swiss Army for 92 days and earn 1000 gold on day 115.
920 gold -> hunt with Swiss Army for 102 days and earn 1000 gold on day 119.

Bear in mind that if you don't upgrade at all, you need 110 days. You see? 96 days is the optimum point!

That's the bonus question.

For the main question, many people just got lucky because the optimum route does not require you to carry gold until the end.
Here are numbers.
FF route:
760 gold -> hunt with Swiss Army for 66 days and earn 1200 gold on day 105.
790 gold -> hunt with Swiss Army for 69 days and earn 1200 gold on day 102.
940 gold -> hunt with Swiss Army for 104 days and earn 1200 gold on day 128.

DB route:
800 gold -> hunt with Swiss Army for 70 days and earn 1200 gold on day 101.
820 gold -> hunt with Swiss Army for 92 days and earn 1200 gold on day 119.
950 gold -> hunt with Swiss Army for 105 days and earn 1200 gold on day 125.

Bear in mind that if you don't upgrade at all, you need 130 days.


***** SOMETHING COOL *****

Here are some interesting facts:

Profit = Earning - cost of cheese
Trap cost breakeven = Trap cost / daily profit
Delivery cost breakeven = Delivery cost / daily profit

Swiss army
# profit = 10 gold/day
# delivery cost breakeven = 20 days

Forcefield
# profit = 40 gold/day
# trap cost breakeven = 12.5 days
# delivery cost breakeven = 5 days

Deathbot
# profit = 50 gold/day
# trap cost breakeven = 11 days
# delivery cost breakeven = 4 days


The delivery cost is the most challenging part in this quiz. Without it, this problem would have been a piece of cake. Now you know that under certain circumstances you should carry some gold before you upgrade, right? :)

Sunday, August 3, 2008

MouseHunt Math Quiz #4: SuperBrie @ 520 gold apiece

*** THE ARGUMENT (PART A) - DEMAND FROM GNAWNIA HUNTERS

Facts and assumptions
  • Normal brie has 90% attraction rate at the price of 200 gold
  • Super brie has 99% attraction rate at the price of x (variable)
  • average gold earned per mouse in Gnawnia = 400
  • your best trap gives a catch rate = 80%
  • if you successfully attract but fail to catch a mouse, expect that the bait is stolen for sure and average gold stolen (or cheese equivalent in addition to the bait) = 40 gold
  • cheese staleness probability = 30% per hunt that fails attract a mouse)
  • revenue is generated only when you successfully catch a mouse
  • cheese bait cost incurs only when a mouse is successfully attracted
  • cheese staleness cost incurs only when you fail to attract a mouse, 30% of the time
  • steal cost incurs only when a mouse is successfully attracted but not caught

*Normal brie
90% attraction rate -> 10% you fail to attract a mouse; 90%*80% = 72% you catch a mouse; 18% you can attract but fail to catch a mouse. your bait is stolen (and probably something else)

PER HUNT figures:
revenue = 72%*400 = 288 gold
cheese bait cost = 90%*200 = 180 gold
cheese staleness cost = 10%*30%*200 = 6 gold
steal cost = 18%*40 = 7.2 gold
profit = 288 - 180 - 10.8 - 7.2 = 94.8 gold

*Super brie
99% attraction rate -> 1% you fail to attract a mouse; 79.2% you catch a mouse; 19.8% you can attract but fail to catch a mouse.

PER HUNT figures:
revenue = 79.2%*400 = 316.8 gold
cheese bait cost = 99%*x = 0.99x gold
cheese staleness cost = 1%*30%*x = 0.003x gold
steal cost = 19.8%*40 = 7.92 gold
profit = 316.8 - 0.99x - 0.003x - 7.92 = 308.88 - 0.993x gold

To make SuperBrie as economically attractive as Brie,

94.8 gold = 308.88 gold - 0.993x
A superbrie is worth x = 215.59 gold in the eyes of an economically rational Gnawnia hunter.


*** THE ARGUMENT (PART B) - DEMAND FROM BURROUGH HUNTERS

In Burrough, you need radioactive blue cheese in order to be successful, especially at the Mousoleum.

You can have Radioactive Blue cheese (RB) in three ways:
1) A curd potion (collected as a loot in the lab by steel mice or bionic mice) + 30 SB can be converted to 30 RB.
2) A curd potion + 5 normal brie + (300 gold/pc of normal brie) can be converted to 5 RB.
3) Collect a RB as a loot (extremely rare).

Making RB from normal brie:
5 RB = 5 Normal brie + 1500 gold + 1 potion ..........(1)

Substituing: 1 Normal brie = 200 gold in (1):
5 RB = 1000 gold + 1500 gold + 1 potion
5 RB = 2500 gold + 1 potion
30 RB = 15000 gold + 6 potion ..........(2)

Making RB from normal brie:
30 RB = 30 SuperBrie + 1 potion ............(3)

(2)=(3):
15000 gold + 6 potion = 30 SuperBrie + 1 potion
15000 gold + 5 potion = 30 SuperBrie
500 gold + 1/6 potion = 1 SuperBrie

This is to say that one piece of SuperBrie should be worth at least 500 gold in the eyes of an economically rational Burrough hunter. The curd potion is a rare object though. If a potion is worth more than 60 gold apiece, then the current regulated price ceiling of 510 gold at the market place interferes the market equilibrium somehow.

Let's say a potion is worth 120 gold. Then, an economically rational Burrough hunter can pay up to 520 gold apiece for SuperBrie!


*** THE ARGUMENT (PART C) - AGGREGATE DEMAND

Since SuperBrie is in unlimited supply - you can donate as much as you want to get SuperBrie, only demand will determine the price of SuperBrie.

In the old days before the Mousoleum was discovered, the needs for radioactive blue cheese is not high. This makes SuperBrie prices go more towards 215.59 (Gnawnia) than towards 520 (Burroughs).

Why SuperBrie was traded at 300 gold per piece a few months ago?

Because about 70% of cheese demand accounts for Gnawnia hunts!
70%*215.59 + 30%*520 = 306.913 gold

How about now? I think 40% of cheese demand accounts for Gnawnia hunts!
40%*215.59 + 60%*520 = 398.236 gold

So, this is why SuperBrie is traded at 400 gold apiece right now.


*** YOUR TASK

Your task is to:
- Criticize reasoning of the argument. Why do you agree or disagree?
- Attack or support other people's arguments in this thread POLITELY.
- Suggest a better method to estimate a reasonable price of SuperBrie (if possible)

I am looking for replies with:
- logical and analytical reasoning (validity, limitation, implied assumption, etc)
- economic sense as well as mathematical sense
- objectivity and clarity of your critical/analytical standpoint

A plus: suggest a reasonable price of SuperBrie. Make assumptions as appropriate and show your calculations.

Some tips:
- there are points that were overlooked in the argument. Think about some other factors that might affect the argument, or scenarios to which the argument might not apply.
- there is no right or wrong answer. But it is important that you rationalize your thinking process well.
- think along the logical flow of the argument carefully. I have made some fallacies here and there, intentionally!

Tuesday, July 8, 2008

MouseHunt Math Quiz #3: 'Orny 'Unting

* HUNTERS

There is a group of five mouse hunters. They are you, John, Joe, Jack and Jim (in order of seniority - you are the most senior). You guys are hanging out at night in the mountain.

* HUNTER'S HORN

The five hunters share the same Hunter's Horn. Only when this Horn is sounded, a mouse visits each hunter's trap, and on average (per mouse visit) awards you 199 points. The Horn cannot be sounded again until 15 minutes after previous sounding.

When you sound a horn, you get a courage award of [hunting size]*100 points. The hunting size is determined by the number of active hunters in your hunting group. A hunter is active for 60 minutes after the last time he "visits" the Horn (no matter he sounds the horn or not).

* EXAMPLE

For illustration, John visits and sounds the Horn at 9:45. Joe visits the Horn at 9:50 and cannot sound the Horn because it is just 5 minutes after previous sounding. So, John is active from 9:45 to 10:44, and Jack is active from 9:50 to 10:49. If no one else is active and you sound the Horn between 10:00 and 10:44 (inclusive), then the hunting size is 3 (you and John and Joe) and you can expect 300+199 points from this hunting. Later if anyone sounds the Horn while you are still being active, you can expect 199 points from each sounding too.

* THE AGREEMENT

OK Now it is so late. You are going to your own tent. So are your friends. But because you guys are so addicted to mouse hunting.... that each of you agrees to wake up at their wish and visit the Horn exactly four times between 1:00 AM and 8:00 AM (inclusive). Very sleepy, your friends will wake up, visit the Horn, sound it if possible, and then go back to bed immediately. If more than one person visit the Horn at the same time, the most senior one will sound the Horn.

* THE PROPHECY

Fortunately, you are a fortune teller and can tell the exact times that your friends will visit the Horn. This is your prophecy:

Wake-up times:
John: 1 AM, 3 AM, 4:45 AM, 6:30 AM
Joe: 1:30 AM, 1:45 AM, 2:30 AM, 5:15 AM
Jack: 3:15 AM, 3:45 AM, 6 AM, 7 AM
Jim: 2 AM, 3 AM, 3:15 AM, 4:45 AM

* OBJECTIVE

You too, have only four chances to visit the Horn (because of the agreement). However, you are not sleepy at all. You look forward to earn as many points as possible.

* QUESTION

What are the four times between 1:00 AM and 8:00 AM (inclusive) that you should visit the Horn?

* UPDATE (Clarification)
  • only John is active as of 1 AM (he sounds the Horn at that time).
  • the last time that the Horn was sounded is a long time ago.


* SOLUTION

  1. Set up time line when each hunter will sound (please see the following table). Who will eventually sound it is not important.
  2. Calculate hunting size (including yourself).
  3. Determine whether or not this time is horn time by other people (Column "Horn time"; Y=Yes; N=No).
  4. Calculate courage points if you sound the horn yourself (Courage pts = Hunting size * 100).
  5. Calculate active points if you are still active at the time and somebody else sounds the horn (Active pts = if Horn time = 'Y' then 199 else 0).
  6. Calculate total points if you sound the horn at the exact times. For example, if you sound the horn at exactly 1:15, you will get courage points of 200 plus active points til 2:14 (199 at 1:30+199 at 1:45+199 at 2:00).
  7. Calculate total points if you sound the horn a bit later than the times in the first column (1-14 minutes late). Examples:
    • If you sound the horn at 1:16, you will get courage points of 200 plus active points from 1:31 til 2:15 (199 at 1:45 + 199 at 2:00 + 0 at 2:15). Please note that Joe will be unable to sound the horn at 1:30; thus, you cannot collect active points at 1:30.
    • You cannot sound the horn a bit late than 1:00 (that is, 1:01 to 1:14). This is because John will sound it at 1:00. You have to wait for 15 minutes after the previous sounding.
  8. Optimize.
Please note that Pts (exact time) and Pts (a bit late) columns are assuming that you do not sound the horn more than once within an hour. One way to solve it is ignoring the that assumption and conducting a brute-force search. But this case is a bit obviously easy, as there are not many times that give higher points than 600.

We can try a bit of greedy algorithm. Start with selecting four highest total points (in red). You can see that 3:00 and 3:15 are two times within an hour. You should get rid of one of the two times. If you get rid of 699, the best replacement is 598 (any time between 4:16 and 4:30). But if you get rid of 798, the best replacement is 698 at 2:15. The latter is a better replacement. You can also see that this is already optimized as further replacements will do more harms than good.

* ANSWER

The four times are:
  • 1:15
  • 2:15
  • 3:15
  • between 5:31 and 5:44
Total points earned = 797+698+699+798 + (199*4 from hunts when you sound the horn yourself) = 3788 points.

199*4 does not affect the optimization process at all because you will sound the horn four times anyway. This is fixed.


Time John Joe Jack Jim Hunting size Horn time Courage pts Active pts Pts (exact time) Pts (a bit late)
1:00 Sound


2
Y 200 199 598 -99999
1:15 Active


2
N 200 0 797 598
1:30 Active Sound

3
Y 300 199 698 -99999
1:45 Active Sound

3
Y 300 199 698 -99999
2:00
Active
Sound 3
Y 300 199 499 -99999
2:15
Active
Active 3
N 300 0 698 698
2:30
Sound
Active 3
Y 300 199 698 -99999
2:45
Active
Active 3
N 300 0 698 698
3:00 Sound Active
Sound 4
Y 400 199 798 -99999
3:15 Active Active Sound Sound 5
Y 500 199 699 -99999
3:30 Active
Active Active 4
N 400 0 599 400
3:45 Active
Sound Active 4
Y 400 199 400 -99999
4:00

Active Active 3
N 300 0 499 499
4:15

Active
2
N 200 0 399 598
4:30

Active
2
N 200 0 598 399
4:45 Sound

Sound 3
Y 300 199 499 -99999
5:00 Active

Active 3
N 300 0 499 499
5:15 Active Sound
Active 4
Y 400 199 599 -99999
5:30 Active Active
Active 4
N 400 0 599 798
5:45
Active

2
N 200 0 598 399
6:00
Active Sound
3
Y 300 199 499 -99999
6:15

Active
2
N 200 0 598 399
6:30 Sound
Active
3
Y 300 199 499 -99999
6:45 Active
Active
3
N 300 0 499 300
7:00 Active
Sound
3
Y 300 199 300 -99999
7:15 Active
Active
3
N 300 0 300 300
7:30

Active
2
N 200 0 200 200
7:45

Active
2
N 200 0 200 200
8:00



1
N 100 0 100 100

Friday, July 4, 2008

MouseHunt Math Quiz #2: Hunting Strategy

* MICE

there are unlimited numbers of mice but there are only two breeds of mice, white and brown.

a white mouse will give you 50 points and 75 gold.
a brown mouse will give you 150 points and 25 gold.

75% of mouse population are white.

on average, one mouse, randomly, visits your camp every hour. but only cheese can attracts the mouse to your trap. you can

place only one cheese at a time on your trap. unfortunately, there are only two kinds of cheese.

* CHEESE

a cheddar costs 5 gold.
a brie costs 50 gold.

cheddar has a 50% probability of attracting a white mouse (to the trap) and 25% probability of attracting a brown mouse.
brie has a 25% probability of attracting a white mouse and 75% probability of attracting a brown mouse.

* TRAP

there are also only two kinds of traps. you already have both traps in possession. after you cheese successfully attracts a mouse, it is now the job of your trap to catch it.

glue has a 50% probability of catching a white mouse and 25% probability of catching a brown mouse.
deathbot has a 25% probability of catching a white mouse and 75% probability of catching a brown mouse.

* LOCATION

there are also only two locations.

in the town, if you successfully attract a mouse but fail to catch it, you lose just the bait (just one piece of cheese).

in the lab, there is 220% gold bonus (for example, 240 gold for white mouse) but if you fail to catch it. the mouse will steal something in addition to the bait:
a white mouse -> 20% steals 500 gold, 80% steals 5 points.
a brown mouse -> 80% steals 250 gold, 20% steals nothing else than the bait.

traveling is free.

you start with a large number of gold.

* QUESTION

as a hunter, what is your hunting strategy if you want to maximize points but do not want to lose gold in the long run?

* UPDATE (Clarification)
  1. no mixing two cheeses together to create a new kind of cheese
  2. no mixing two traps together to create a new kind of trap
  3. you can assume no staleness should cheese fails to attract a mouse.
  4. if the bait successfully attracts a mouse, the bait (cheese) will be gone, no matter you can catch it or not.
  5. you can use only one trap and one cheese at a time.


* SOLUTION

step 1: establish understanding

note that there are three possible outcomes:
1) fail- fail to attract a mouse
2) catch- successfully catch a mouse
3) steal- a mouse steals your cheese (and probably something else)

step 2: calculate hunting results probabilities

(lab/cheddar/deathbot example)

brown mouse calculation:

a cheddar has 25% attraction rate to brown mice, and deathbot has 75% success rate to catch a brown mouse.

fail% = 100% - attraction rate = 75%
catch% = successful attraction and successful catch = 25% * 75% = 18.75%
steal% = successful attraction but unsuccessful catch = 25% * (100% - 75%) = 6.25%

similarly, white mouse calculation:

fail% = 50%
catch% = 12.5%
steal% = 37.5%

overall mouse hunting results probabilities:

note that brown mice account for 25% and white mice account for 75%.

brown mouse fail% = 25% * 75% = 18.75%
brown mouse catch% = 25% * 18.75% = 4.6875%
brown mouse steal% = 25% * 6.25% = 1.5625%
white mouse fail% = 75% * 50% = 37.5%
white mouse catch% = 75% * 12.5% = 9.375%
white mouse steal% = 75% * 37.5% = 28.125%

what does this mean? this means that every 100 hours, you can expect 18.75 times, on average, that you fail to catch a brown mouse.

step 3: calculate hourly-average stats (or per-mouse stats)

(lab/cheddar/deathbot example)

net points and profit (gold) are two important derived variables.

revenue is generated only when you successfully catch a mouse (220% bonus at lab)
cheese cost incurs only when a mouse is successfully caught or it steals your cheese
steal cost incurs only when a mouse steals your gold

revenue = brown catches + white catches = (25*320%*4.6875%) + (75*320%*9.375%) = 26.25 gold
cheese cost = brown catches + brown steals + white catches + white steals = 5 * (4.6875%+1.5625%+9.375%+28.125%) = 2.1875 gold

steal cost = brown steals + white steals = (250*80%*1.5625%) + (500*20%*28.125%) = 31.25 gold

profit = revenue - cheese cost - steal cost = -7.1875 gold (loss)

points earned = brown catches + white catches = (150*4.6875%) + (50*9.375%) = 11.71875 points

points stolen = white steals = 5*80%*28.125% = 1.125 points

net points = points earned - points stolen = 10.59375 points


step 4: Set up optimization model

Please note that you are free to change trap/cheese/location at any time.
So you should set time-allocation strategy wisely.

locationcheesetrap
profit net point time allocation
town cheddar glue 12.265625 11.71875 x1
town cheddar deathbot 6.015625 11.71875 x2
town brie glue -10.546875 11.71875 x3
town brie deathbot -11.71875 23.4375 x4
lab cheddar glue 15.9375 10.96875 x5
lab cheddar deathbot -7.1875 10.59375 x6
lab brie glue -30 11.34375 x7
lab brie deathbot -19.6875 22.875 x8


Objective: maximize points; 11.71875x1 + 11.71875x2 + … + 22.875x8

Constraints:
  • sum of time allocation is 100%; x1+x2+…+x8 = 1
  • time allocation is between 0 and 100%; 0 <= x1, x2, …, x8 <=1
  • profit is non negative; 12.265625x1 + 6.015625x2 - … - 19.6875x8 >= 0

This is a linear programming model. You can run it on Excel (Solver add-in) or use matrix algebra like the Simplex method. If you'd like, you can exclude x2 from the model because x1 is always a better choice (and so on).

The model result: x4 = 57.6271%, x5 = 42.3729%, other x's = 0%.

step 5: ANSWER

you should spend about 57.63% of the time in the town using brie/deathbot to earn points and about 42.37% of the time in lab using cheddar/glue to recover gold. The hourly- average points (or points per mouse) = 18.1541 points. The hourly-average profit = 0.00 gold.

This solution is better than town/cheddar/glue alone in terms of net points earned.

MouseHunt Math Quiz #1: Combinatorics

Question:
There are P possibilities that ten different hunters are hunting ten different mice.
There are Q possibilities that ten different hunters are hunting ten identical mice.
P+Q = ?

Example:
There are 20 possibilities that 3 different hunters are hunting 3 identical mice.
There are 64 possibilities that 3 different hunters are hunting 3 different mice (see below).

3 identical mice and 3 different hunters, namely (A, B, C).
possibility 1: (0, 0, 0) no mouse is caught at all
possibility 2: (1, 0, 0) hunter A catches a mouse
possibility 3: (0, 1, 0) hunter B catches a mouse
possibility 4: (0, 0, 1) hunter C catches a mouse
possibility 5: (1, 1, 0) hunter A and B catch a mouse each
possibility 6: (1, 0, 1) hunter A and C catch a mouse each
possibility 7: (0, 1, 1) hunter B and C catch a mouse each
possibility 8: (1, 2, 0) hunter A catches a mouse and hunter B catches 2 mice
possibility 9: (1, 0, 2) hunter A catches a mouse and hunter C catches 2 mice
possibility 10: (2, 1, 0) hunter B catches a mouse and hunter A catches 2 mice
possibility 11: (0, 1, 2) hunter B catches a mouse and hunter C catches 2 mice
possibility 12: (2, 0, 1) hunter C catches a mouse and hunter A catches 2 mice
possibility 13: (0, 2, 1) hunter C catches a mouse and hunter B catches 2 mice
possibility 14: (2, 0, 0) hunter A catches two mice
possibility 15: (0, 2, 0) hunter B catches two mice
possibility 16: (0, 0, 2) hunter C catches two mice
possibility 17: (3, 0, 0) hunter A catches all the mice
possibility 18: (0, 3, 0) hunter B catches all the mice
possibility 19: (0, 0, 3) hunter C catches all the mice
possibility 20: (1, 1, 1) hunter A, B and C catch a mouse each

3 different mice (x, y, z) and 3 different hunters (A, B, C).
possibility 1: no mouse is caught at all
possibility 2: hunter A catches mouse x
possibility 3: hunter A catches mouse y
possibility 4: hunter A catches mouse z
possibility 5: hunter B catches mouse x
possibility 6: hunter B catches mouse y
possibility 7: hunter B catches mouse z
possibility 8: hunter C catches mouse x
possibility 9: hunter C catches mouse y
possibility 10: hunter C catches mouse z
possibility 11: hunter A catches mouse x and y
possibility 12: hunter A catches mouse x and z
possibility 13: hunter A catches mouse y and z
possibility 14: hunter B catches mouse x and y
possibility 15: hunter B catches mouse x and z
possibility 16: hunter B catches mouse y and z
possibility 17: hunter C catches mouse x and y
possibility 18: hunter C catches mouse x and z
possibility 19: hunter C catches mouse y and z
possibility 20: hunter A catches mouse x and hunter B catches mouse y
possibility 21: hunter A catches mouse x and hunter B catches mouse z
possibility 22: hunter A catches mouse y and hunter B catches mouse x
possibility 23: hunter A catches mouse y and hunter B catches mouse z
possibility 24: hunter A catches mouse z and hunter B catches mouse x
possibility 25: hunter A catches mouse z and hunter B catches mouse y
possibility 26-31: hunter A and hunter C catches one mouse each
possibility 33-37: hunter B and hunter C catches one mouse each
possibility 38-40: a hunter catches all the mice
possibility 41-43: hunter A catches two mice and hunter B catches the last one
possibility 44-46: hunter A catches two mice and hunter C catches the last one
possibility 47-49: hunter B catches two mice and hunter A catches the last one
possibility 50-52: hunter B catches two mice and hunter C catches the last one
possibility 53-55: hunter C catches two mice and hunter A catches the last one
possibility 56-58: hunter C catches two mice and hunter B catches the last one
possibility 59-64: each hunter catches a mouse


Solution:

This quiz is all about combinatorics. Read more here:
http://en.wikipedia.org/wiki/Combinatorics

P = 11^10
P is quite easy. Each mouse has 11 possibilities (not caught at all, caught by hunter#1, .., caught by hunter#10). 10 mice -> 11^10

Q = Combination (20, 10) = Factorial (20) / (Factorial (10)*Factorial(10)) = (20*19*18*17*..*11) / (10*9*8*...*1)

http://en.wikipedia.org/wiki/Stars_and_bars_(probability)

It is like you have 10 stars (10 mice) and 10 bars (10 hunters + one fake hunter for mice that are not caught at all).