Wednesday, July 04, 2012

GeekDad Puzzle of the Week: Poaching Berries

Red Raspberries, photofarmer@FlickrGeekDad Puzzle of the Week: Poaching Berries:
Q: Leif and Kestrel are willing to give GeekDad a 20% cut of berries they poach for turning a blind eye. Imagine that Leif picks five berries per poach and Kestrel picks three berries per poach and that they attempt to poach once every day, with the exception of any day just after they’ve been caught. Now imagine that each time they poach berries, they have a 15% chance of getting caught. How many berries can GeekDad expect to eat each each week, averaged over time?
I'll post my thoughts on the answer after the answer is revealed (generally early next week).

Edit: The following answer was what I submitted to end up winning the puzzle:

Let's assume a few things:
1) Leif and Kestrel start in a state where they haven't ever been caught.
2) Each time they are caught, the berries that day don't count. Also, they must skip the next day until trying again.

There are essentially 3 states that each child could be in. Since the probabilities for each child are the same we can group them together, though in reality the puzzle allows for one child to be caught and the other not. The results work out the same, so let's just simplify it to a pair of children trying to poach 8 berries a day.

The children could be:
1) Caught the day before and therefore have no chance of getting berries that day (must sit out).
2) Caught today (15%, if not caught the day before)
3) Not caught today (85%, if not caught the day before)

Each day, the chance of being caught the day before is just carried forward. So on day 2, the chance is 15% they are sitting out. That leaves 85% chance they are attempting poaching. Of that 85%, there's a 15% chance they are caught (0.85 x 0.15 = 12.75%) and an 85% chance they poach successfully (0.85 x 0.85 = 72.25%).

If you repeat this, the next day (Day 3) they have a 12.75% chance of sitting out and a 87.25% chance of attempting poaching. Day 4, the chance of sitting out is 0.15 x 87.25% = 13.0875% and not sitting out is 86.9125%. Day 5, the chance of sitting out is 0.15 x 86.9125% = 13.036875% and not sitting out is 86.963125%. You can continue this progression and you will see that the chance they are sitting out approaches a value of about 13.043478%. The chance they are caught that day is equivalently about 13.043478%. That leaves a 73.913043% chance they are able to poach 8 berries with an expected return of 5.913043478 berries a day.

That equates to approximately 41.39130435 berries a week. With a 20% "commission" after awhile you will be eating approximately 8.27826087 berries each week.

Note: For a more accurate answer (rather than just a decimal approximation) we can solve this algebraically as follows:

Let p be the chance that you ARE sitting out.
Let q be the chance you are NOT sitting out.

Together these are mutually exclusive and therefore add up to 100% (or mathematically we say 1)
p + q = 1
p = 1 - q

The chance you are NOT sitting out, but CAUGHT is 0.15q
The chance you are NOT sitting out, and SUCCESSFULLY POACHED is 0.85q

We know that eventually the two values p and 0.15q end up being the same, so equate them
p = 0.15q

Substitute in 1-q:
1 - q = 0.15q

Rearrange:
1 = 1.15q
q = 1/1.15

The chance we are caught that day is 0.15q
0.15q = 0.15(1/1.15) = 0.15/1.15 = 15/115 = 3/23
And the chance we poach some berries is 0.85q
0.85q = 0.85(1/1.15) = 0.85/1.15 = 85/115 = 17/23

For the sake of completeness that means you have:
3/23 = chance child is sitting out
3/23 = chance child was caught today
17/23 = chance child was able to poach successfully

Now multiply this last number by 8 berries attempted times 7 days and then times 1/5 (20% commission) to get the expected number of berries poached each week.
Berries per week = 17/23 x 8 x 7 x 1/5

If you reduce that to a fraction you end up with:
952/115 = 8 32/115 berries each week.

A: 8 32/115 berries each week.
8.27826086956521739130434... (underlined portion repeats indefinitely)

Thursday, June 28, 2012

NPR Sunday Puzzle (Jun 24, 2012): The Cat is Away

Computer Mouse, Pockafwye@FlickrNPR Sunday Puzzle (Jun 24, 2012): The Cat is Away:
Since I'm not going to be around to comment on the puzzle, I'm putting this week's puzzle on "auto-pilot". Please play nicely and don't give the puzzle answer away.
Here's my standard reminder... don't post the answer or any hints that could lead directly to the answer (e.g. via Google or Bing) before the deadline of Thursday at 3pm ET. If you know the answer, click the link and submit it to NPR, but don't give it away here.

You may provide indirect hints to the answer to show you know it, but make sure they don't give the answer away. You can openly discuss your hints and the answer after the Thursday deadline. Thank you.

Edit: From my comment, We just reached our destination (goal line). After the family got settled here inside... (go all in)
A: GO ALL IN + E --> GOAL LINE

Thursday, June 21, 2012

NPR Sunday Puzzle (Jun 17, 2012): Est-ce que tu parles français?

French word puzzleNPR Sunday Puzzle (Jun 17, 2012): Est-ce que tu parles français?:
Q: Think of a common French word that everyone knows. Add a "v" (as in "violin") to the beginning and an "e" at the end. The result will be the English-language equivalent of the French word. What is it?
Well, I never expected it to take me this long to figure out the puzzle answer. I spent much of last night pouring through lists of common French words as well as English words starting with V and ending with E. My wife was similarly stymied so we gave up and assumed that there must be a typo in the wording of the puzzle. Unfortunately, when I listened to the on-air puzzle, the wording was the same as what is posted. Perhaps it was the clearer head of the morning, but I finally figured out what Will wanted us to do.

It's actually refreshing, for a change, to have a puzzle that takes some time to solve, but I expect there will be some that want to voice a small complaint when the answer is revealed especially since you may find me guilty of not giving a very obvious clue either.

Edit: I think I was actually rather generous with the hints this time:
  • "Well, I never expected" --> initial letters spell WINE
  • "pouring" --> deliberate misspelling of poring, as in pouring WINE
  • "wife + typo" --> WINE
  • "clearer head of the morning" --> no personal experience with this, but...
  • "what Will wanted" --> string of words starting with W
  • "refreshing" --> another indirect hint to a beverage, coupled with France = WINE
  • "takes some time" --> as in aging a fine WINE
  • "voice a small complaint" --> WHINE
  • "Find Me Guilty" --> Movie starring VIN Diesel
  • "giving" --> hides the word VIN


  • The key for me was actually listening to the on-air puzzle and hearing Will say the puzzle was tricky. But what finally caused the "Aha!" moment was searching for the puzzle submitter "Kate MacDonald" "Murphys, California" and finding her listed as the Winemaker of Stevenot Winery in Murphys, California. In the end this puzzle was challenging but not impossible.
    A: French word: VIN, English word: WINE (VV = W)

    Saturday, June 16, 2012

    GeekDad Puzzle of the Week: When Are the Odds Even?

    Black and white marblesGeekDad Puzzle of the Week: When Are the Odds Even?:
    Q: If we have a bag containing equal numbers of black and white marbles, and we pull out one marble, the odds of it being black are even. If we have a bag containing 120 marbles, 85 of which are black, the odds of us pulling out two marbles and them both being black is also even — (85/120)x(84/119) = 0.5 or 50%.

    If the largest bag we have can hold 1,000,000 marbles, for how many sets of marbles (i.e., the 120 marbles described above are one set) can we pull two marbles and have a 50% chance of them being the same designated color? Are there any sets of marbles for which we can pull three marbles and have a 50% chance of them being the same designated color? If so, how many?
    After the solution is revealed, I'll post the details of my answer.

    Edit: GeekDad Puzzle Solution:
    In the first case you are essentially looking for integer solutions to:
    a(a-1) = 2b(b-1)

    There are EIGHT sets under 1 million that will result in even odds when 2 balls are drawn.

    4 marbles (3 black) --> 4 x 3 = 2(3 x 2)
    21 marbles (15 black) --> 21 x 20 = 2(15 x 14)
    120 marbles (85 black) --> 120 x 119 = 2(85 x 84)
    697 marbles (493 black) --> 697 x 696 = 2(493 x 492)
    4,060 marbles (2,871 black) --> 4,060 x 4,059 = 2(2,871 x 2,870)
    23,661 marbles (16,731 black) --> 23,661 x 23,660 = 2(16,731 x 16,730)
    137,904 marbles (97,513 black) --> 137,904 x 137,903 = 2(97,513 x 97,512)
    803,761 marbles (568,345 black) --> 803,761 x 803,760 = 2(568,345 x 568,344)

    Interestingly, the next number in each sequence can be computed as follows:
    a(n) = 6a(n-1) - a(n-2) - 2

    So for example, the next numbers in the sequence would be:
    Total balls: 6 x 803,761 - 137,904 - 2 = 4,684,660 marbles
    Black balls: 6 x 568,345 - 97,513 - 2 = 3,312,555 black

    Integer sequences: A011900 and A046090

    In the second case you are looking for integer solutions to:
    a(a-1)(a-2) = 2b(b-1)(b-2)

    There is only ONE set under 1 million that will result in even odds when 3 balls are drawn.

    6 marbles (5 black) --> 6 x 5 x 4 = 2(5 x 4 x 3)

    Thursday, June 14, 2012

    NPR Sunday Puzzle (Jun 10, 2012): Have a Seat

    Where NOT to sitNPR Sunday Puzzle (Jun 10, 2012): Have a Seat:
    Q: Name something to sit on. Divide the letters of this exactly in half. Move the second half to the front, without changing the order of any letters. The result will name some things seen on computers. What are they?
    Add the letters D-E-M to the answer, rearrange to name something that might be affected the longer you sit on one of these.

    Edit: BARSTOOL + DEM --> BLOODSTREAM
    A: BARSTOOL --> TOOLBARS

    Thursday, June 07, 2012

    NPR Sunday Puzzle (Jun 3, 2012): Stay Tuned

    TV RerunNPR Sunday Puzzle (Jun 3, 2012): Stay Tuned:
    Q: Take the names of two state capitals. Change one letter in each one, resulting in a phrase naming someone you will see soon on TV. Who is it? (Hint: You don't really have to know anything about TV to solve this puzzle.)
    Whenever I wade through the channels to see what is on TV, I see nothing but re-runs.

    Edit: My hint was "wade" which is a hint to the states of WA and DE as well as an indirect hint to water and diving.
    A: Olympic Diver
    Olympia, WA --> Olympic
    Dover, DE --> Diver

    Sunday, June 03, 2012

    GeekDad Puzzle of the Week: Waffle Cuts

    GeekDad Puzzle of the Week: Waffle Cuts: Waffle, no cuts
    Q: If we only cut along the ridges of a circular waffle, and if each cut traverses the waffle in a straight line from edge to edge, how many different ways can the waffle be cut?
    Note: rotations, horizontal flips, and vertical flips of a set of cuts should only be counted once.
    Given that there are 6 places to cut vertically and 6 places to cut horizontally, that's a total of 12 cut lines. If you allow for any combination of these 12 lines to be cut or not, you have a total of 2^12 = 4096 ways to divide the waffle. But of course, the puzzle asks for the number of unique ways to cut the waffle, not including any mirrored or rotationally symmetric sets of cuts.

    After the official answer to the puzzle is posted, I'll post my solution here.

    Edit: The solution is posted, but just the number without any detail. Also, I disagree with their counting of the "no cuts at all" solution as one of the ways to "cut" the waffle. In any case, a full detailing of my solution along with an enumeration of all 665 (or 666) ways to uniquely cut the waffle can be found in Blaine's Solution to the GeekDad Waffle Puzzle.

    Thursday, May 31, 2012

    NPR Sunday Puzzle (May 27, 2012): Types of Wool - Actor Puzzle

    Types of woolNPR Sunday Puzzle (May 27, 2012): Types of Wool - Actor Puzzle:
    Q: Name two different kinds of wool. Take the first five letters of one, followed by the last three letters of the other. The result will spell the first and last name of a famous actor. Who is it?
    Take the actor's first name and add a type of idol. Anagram the letters to get the actor's first movie.

    Edit: Al + Matinee = Me, Natalie
    A: Alpac(a) + (Mer)ino = Al Pacino

    Saturday, May 26, 2012

    GeekDad Puzzle of the Week Answer: That Darn Achilles

    That Darn Achilles:
    Q: You, Paris, have the luxury of launching an arrow at faraway Achilles either from the ramparts above the Hesperian Gate at a height of exactly 8 meters. Or you can stand atop Priam’s palace. This gains you another 7 meters of launch height, but it costs you 15 meters of horizontal distance. If the arrow leaves your bow at a somewhat modest 70 meters per second, are you best taking your pot-shot at far-off Achilles from the ramparts or the palace? Which perch offers the farthest reach?

    I had to look up the formulas for determining the maximum range of a projectile when fired on uneven ground. The following page was invaluable.
    Wikipedia: Range of a Projectile

    Because several things weren't stated, I'm going to assume that we can use acceleration of gravity (g) at sea level, we can assume no wind resistance and also assume that the ground is level between the target and the firing point (except for the elevation change and horizontal offset provided by the ramparts (0,8) and the palace (-15, 15).

    While the ideal case (firing on even ground) results in an optimal angle of 45°, when you are firing from a height, then you want to angle down slightly to maximize distance. I won't bore you with going through the details on that page, but basically there's an equation for the horizontal and vertical positions at time t, given an initial angle (theta) and velocity v. You can then set the final height to be 0 and solve for t. Using that you can get an equation for distance given an angle and by taking the derivative and setting it to zero, you can get a formula for the optimal angle to get the longest distance.

    Rampart (x0,y0) = (0,8)
    Palace (x0,y0) = (-15,15)
    Velocity (v) = 70 m/s
    Gravity (g) = 9.80665 m/s^2

    Optimal angle (θ) = cos-1 [ √(2*g*y0 + v^2) / (2*g*y0 + 2v^2) ]

    Rampart angle (θ) = 0.777519 Radians or 44.54853°
    Palace angle (θ) = 0.7708234 Radians or 44.164927°
    Distance (d) = [ v*cos θ [v*sin θ + √((v*sin θ)^2 + 2*g*y0) ] /g + x0

    Rampart distance = 507.5979m
    Palace distance = 499.44231m

    A: When firing from the ramparts (8m), the optimal angle is around 44.55° and will net you a distance of 507.6 meters.

    When firing from the palace (15m), the optimal angle is around 44.16° but because of the -15m offset you only reach 499.4 meters.

    Thursday, May 24, 2012

    NPR Sunday Puzzle (May 20, 2012): Present and Past Tense Verbs

    Drawing a blankNPR Sunday Puzzle (May 20, 2012): Present and Past Tense Verbs:
    Q: Think of a common three-letter word and five-letter word that together consist of eight different letters of the alphabet. Put the same pair of letters in front of each of these words, and you will have the present and past tense forms of the same verb. What words are these?
    I appear to be drawing a blank...

    Edit: My hints were "drawing" (with ink) and "blank" (as in zero/ought). In the comments I had other hints like "I'm not kidding" (i.n.k.), "last decade" (the oughts), "Oops, unfortunately good hints take..." (o.u.g.h.t.), "I now know" (i.n.k.), "I figured" (thought) and "just assume" (think).
    A: INK & OUGHT --> THINK & THOUGHT