# Excel challenge solution: Mastermind

A few weeks back, I published an Excel challenge to score, and maybe solve, the game Mastermind in a spreadsheet. Today, I’m going to share some solutions to that challenge. To avoid repeating myself a lot, I’ll assume you’ve read the original challenge already – if you haven’t, I’d suggest you take a look at that first.

[The picture is my own Mastermind board, a particularly excellent gift from my sister-in-law which inspired this challenge.]

# Mapping divisions in the US Senate (part 1)

Unless you’ve been living under a rock for the past several years, you may have heard that partisan divisions are the new normal in US politics, with the exercise of the ‘nuclear option’ to confirm some Presidential appointments, the refusal by the Senate to hold a vote on the President’s nomination for the vacant Supreme Court seat, the brinksmanship around debt-ceiling negotiations (at the time of writing, that link goes to a disambiguation page on the term ‘United States debt-ceiling crisis’, the very existence of which kind of tells you all you need to know…), to name just a few examples.

Of course, it’s easy to think of examples of conflicts that have been in the news lately, and not so easy to get an objective view of long-term changes. So I thought it would be interesting to look at the question with some hard data on how the members of both parties actually vote. Voting data for the US Senate back as far as 1989 is very easily available through senate.gov, and similarly for the House.

# Bar games, advanced maths, and more circular references

So, I promise this blog isn’t going to only feature puzzles and Excel challenges (next ‘real’ post on Friday, if all goes according to plan), but I enjoyed this week’s Riddler enough that I thought I should write something on it.

Consider a hot new bar game. … A marker is placed at zero on [a] number line. Then [a] coin is repeatedly flipped. Every time the coin lands heads, the marker is moved one integer in a positive direction. Every time the coin lands tails, the marker moves one integer in a negative direction. You win if the coin reaches -X first, while your friend wins if the coin reaches +Y first. (Winner keeps the coin.)

How long can you expect to sit, flipping a coin, at the bar?

Here are a few ways you can tackle it (if you’re just an Excel nerd and not a general nerd, you can skip to the last one…):

# Excel challenge: Mastermind

Since the readership for this blog skews heavily toward Excel nerds, I’m going to post an Excel challenge here once in a while. This is the first one, and it comes in three parts, in increasing order of difficulty (I encourage you to have a go even if you don’t think you can do the whole thing).

# Tennis, puzzles, and circular references

I’m a big fan of FiveThirtyEight’s weekly puzzle, the Riddler, which has an interesting mix of puzzles with a mathematical flavor. This week’s puzzle asks you to pick the best starting score for a tennis game against a much stronger opponent, and it has a very neat solutions with iterative calculations (circular references) in Excel.

Here’s the full puzzle:

Your wish has been granted, and you get to play tennis against Roger Federer in his prime in the Wimbledon final. You have only a 1 percent chance to win each point, but Roger, sporting gentleman that he is, offers to let you name any score and begin the match at that point. (So, if you’ve entertained a fantasy of storming back after being down three match points in the fifth set, now’s the time to live it.) What score can you name that gives you the best chance to win, and what is your chance of winning the title?