Skip to content

aquantumreality/Puzzles-101

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Puzzles-101

Nim Game

There are 8 piles of coins. Chahel and Shaun play a coins game, in which they take turns in choosing a pile and removing arbitrary number of coins from that particular pile. Chahel starts first. Whoever doesn’t have a move (i.e. all piles are empty) loses. Let the numbers of coins in the piles be 1, 2, 3, 3, 8, 7, 5, x. What should x be, such that Shaun wins the game, regardless of what Chahel plays?

Solution

(Inspired by Nim)

Tower of Hanoi

In front of Sreejaa are three poles. One pole is stacked with 64 rings ranging in weight from one kg (at the top) to 64kg (at the bottom). Her task is to move all the rings to one of the other two poles so that they end up in the same order (bottom most is 64kg and top most is 1kg). But the rules are: you can move only one ring at a time and you can move a ring only from one pole to another, and you cannot temporarily place a ring on top of a lighter ring. What is the minimum number of moves for Sreejaa to achieve this?

Solution

(Inspired by Tower of Hanoi)

Pirates Dilemma

130 pirates stand in a circle. They start shooting alternatively in a cycle such that the 1st pirate shoots the 2nd, then 3rd shoots the 4th and so on. The pirates who got shot are eliminated from the game. They continue in circles, shooting the next standing pirate, till only one pirate is left. Which position should someone stand to survive? What would be your choice if there were 129 pirates?

Solution

(Inspired by Josephus Problem]

Other handy resources:

  1. https://fivethirtyeight.com/tag/the-riddler/
  2. https://github.com/gowen100/Jane-Street-Solutions/tree/master

Pirates Dilemma

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published