In my quest to learn more about this competition that I just recently discovered, I came across this page where the Google Code Jam problem authors discuss their process for creating well-designed competition problems. The whole thing was an enlightening read, but I mention it here to reference the section where they discuss problem difficulty, which ends with this:
This is (very roughly) what we aim for in Code Jam's qualification round: easy; easy, but insight required; medium-hard.
When I read this it made perfect sense to me in the context of the Qualification Round problems I've been documenting here. The first problem was easy. The second problem was easy, once you had the right insight about how to optimally flip the pancakes. With that said, we now move onto the third problem where the difficulty definitely ramps up.
In the second problem of the Qualification Round we find ourselves in a strange IHOP:
The Infinite House of Pancakes has just introduced a new kind of pancake! It has a happy face made of chocolate chips on one side (the "happy side"), and nothing on the other side (the "blank side").
You are the head waiter on duty, and the kitchen has just given you a stack of pancakes to serve to a customer. Like any good pancake server, you have X-ray pancake vision, and you can see whether each pancake in the stack has the happy side up or the blank side up. You think the customer will be happiest if every pancake is happy side up when you serve them.
You know the following maneuver: carefully lift up some number of pancakes (possibly all of them) from the top of the stack, flip that entire group over, and then put the group back down on top of any pancakes that you did not lift up.
What is the smallest number of times you will need to execute the maneuver to get all the pancakes happy side up, if you make optimal choices?
The first (and presumably easiest) of the four problems in the Qualification Round is a pretty straightforward counting problem:
Bleatrix Trotter the sheep has devised a strategy that helps her fall asleep faster. First, she picks a number N. Then she starts naming N, 2 × N, 3 × N, and so on. Whenever she names a number, she thinks about all of the digits in that number. She keeps track of which digits (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) she has seen at least once so far as part of any number she has named. Once she has seen each of the ten digits at least once, she will fall asleep.
What is the last number that she will name before falling asleep?
A few weeks back I saw a mention of Google Code Jam 2016. I'm relatively new to programming but I love a good challenge. So I registered, figuring it would be a good test of what I've learned so far. However, I pretty quickly forgot about it, and would've totally missed it if not for an email reminder yesterday. I felt totally unprepared but decided to give it a shot, and here's what happened...
Just in time for March Madness, a(nother) basketball-themed Riddler:
Consider the following simplified model of free throws. Imagine the rim to be a circle (which we’ll call C) that has a radius of 1, and is centered at the origin (the point (0,0)). Let V be a random point in the plane, with coordinates X and Y, and where X and Y are independent normal random variables, with means equal to zero and each having equal variance — think of this as the point where your free throw winds up, in the rim’s plane. If V is in the circle, your shot goes in. Finally, suppose that the variance is chosen such that the probability that V is in C is exactly 75 percent (roughly the NBA free-throw average).
But suppose you switch it up, and go granny-style, which in this universe eliminates any possible left-right error in your free throws. What’s the probability you make your shot now? (Put another way, calculate the probability that |Y| < 1.)
I wrote here about my solution to this week's Riddler. I wanted to expand a bit on the method, and present some simulation results.
I wrote here about my solution to this week's Riddler puzzle. I think that explanation is sufficiently convincing, but I also decided to simulate the problem to see if the results match my solution.