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.

Leave a Reply

Your email address will not be published. Required fields are marked *

I accept that my given data and my IP address is sent to a server in the USA only for the purpose of spam prevention through the Akismet program.More information on Akismet and GDPR.

This site uses Akismet to reduce spam. Learn how your comment data is processed.