# FiveThirtyEight: The Riddler (2016-July-08)

I hate puzzles, but for some reason I find the Riddler from FiveThirtyEight more addicting than Flavor Blasted Goldfish. Anyway, I decided to post my solution for this week. Below is the question:

The archvillain Laser Larry threatens to imminently zap Riddler Headquarters (which, seen from above, is shaped like a regular pentagon with no courtyard or other funny business). He plans to do it with a high-powered, vertical planar ray that will slice the building exactly in half by area, as seen from above. The building is quickly evacuated, but not before in-house mathematicians move the most sensitive riddling equipment out of the places in the building that have an extra high risk of getting zapped.

Where are those places, and how much riskier are they than the safest spots? (It’s fine to describe those places qualitatively.)

Doesn’t seem too difficult right? Well first things first, lets create a pentagon about the origin [0,0] and calculate its area.

Using the length of one of its edges (a), we can calculate the total pentagon area using:

$$area = \frac{1}{4}\sqrt{5(5+2\sqrt{5})}\,a^2$$

Since every edge $$a=1.17557050458$$, the total pentagon are is: $$area=2.37764129074$$. Next we need to divide the perimeter into individual points where the laser will begin its cut. And because I don’t want to spend all day working this, I’m only going to choose a single edge. Doing it this way should allow me to simply rotate the results about the origin for a final solution.

I only created twenty cut points, but this is only for visualization. I will bump that number up to several hundred for the final run.

Next we need to figure out where on the other sides of the pentagon the laser must cross in order to split the pentagon into two equal area halves.

This was accomplished by creating a series of triangles and optimizing them using Powell’s method. The cost function for this optimization was simple; the area of the colored triangles must equal exactly one half of the total pentagon area. Below is a quick animation showing the optimization.

Now that the hard part is over, we can increase the number of cut points and lower the alpha channel.

Rotating the results four more times about the origin results in the final solution seen below. The star pattern emerges because not every cut crosses the centroid of the pentagon.

Darker areas represent locations where the laser is crossing more frequently. Therefore the equipment should be moved to the midpoint of each wall to minimize damage. I think…

Below is the code:

# Update: 2016-July-17

Holy shit, I won!