Riddler Express, July 24 2020

Got the Classic from two weeks ago correct, although I hadn’t got the closed-form solution; I needed to spend more time playing with toy examples, but I’m not sure I would have discerned the pattern anyway. It’s neat though.

This week’s Express is not too difficult (please don’t let me get it wrong!). The thing that surprised me on thinking about it is that the total number of combinations of shires is only 1024. That’s  210, since there are 10 shires, each of which can be in or out of any particular subset.

Half of the possibles combinations of shires don’t have enough votes to win, and of those combinations that do, many of them could lose a shire and still win, so they can be ignored as well.

My 33 lines of code will print out an answer in about a millisecond. I assume in Haskell it could be done in about four lines! I should take a look at that language sometime.

Riddler Express, June 26 2020

Simple question for this one:

In Riddler City, the city streets follow a grid layout, running north-south and east-west. You’re driving north when you decide to play a little game. Every time you reach an intersection, you randomly turn left or right, each with a 50 percent chance.

After driving through 10 intersections, what is the probability that you are still driving north?

Read more

Riddler, May 15 2020

Since I’m still learning my way through Jupyter, I tried the Classic as a notebook.

I’m also not sure what the best way to present a notebook is, if I have a WordPress site? The include I used last time wasn’t that great.

For the Express, the best score I can manage is 6. In this grid, there’s no legal place to put a 1 in the top row.

Riddler Classic, January 24 2020

EDIT: Nope! Not far wrong, but definitely wrong.

My strategy of starting with the easy cases and building out to more complex cases was used successfully by other solvers. My analysis of the easy cases was correct, but there was a mistake in the way I built out. My diagram probably didn’t help; the one drawn by the winner didn’t distinguish between the larger and smaller piles, and I think that’s where my error crept in.

For example, when I considered (9, 5), I thought it was a losing position because I didn’t see that taking six coins from the larger pile produced (5, 3), since the larger pile became the smaller pile in that move. So the “simplification” I introduced, of specifying one pile as larger, while not wrong, made it easier for me to make a mistake. It helped to break my mental model by suggesting an identity for the piles (“larger” or “smaller”) that isn’t persistent, but depends on the progress of the game. Will try not to do that again!

EDIT 2: Revised the original spread sheet showing the rows that I had calculated wrongly, and producing a correct game state table.


 

Another week of being fairly confident about this week’s Riddler Classic. (Bolstered by getting exactly the right answer for the last one I did, if by a slightly inefficient method.)

The puzzle is a coin-picking game, with the usual aim of taking the last coins, but the unusual condition of having two coin stacks:

Read more

Riddler Classic, November 22 2019

Most of the Classics look too difficult for me to be able to solve, but this week’s looked like I could approach it. No code required, either.

Here’s the question:

Five friends … are playing the … Lottery, in which each must choose exactly five numbers from 1 to 70. After they all picked their numbers, the first friend notices that no number was selected by two or more friends. Unimpressed, the second friend observes that all 25 selected numbers are composite (i.e., not prime). Not to be outdone, the third friend points out that each selected number has at least two distinct prime factors. After some more thinking, the fourth friend excitedly remarks that the product of selected numbers on each ticket is exactly the same. …

What is the product of the selected numbers on each ticket?


There might be a neat, elegant way of solving this, but I chipped away at it bit by bit.

Read more