Skip to content

lachjames/trapped_knight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

trapped_knight

An examination of the "Trapped Knight" problem, as discussed in the Numberphile video "The Trapped Knight - Numberphile", found at https://www.youtube.com/watch?v=RGQe8waGJ4w.

Based on a comment by user "Smt Smt": "What happens if you mark 2084 as already visited before you start the game? Will it still get trapped somewhere else?" - https://www.youtube.com/watch?v=RGQe8waGJ4w&lc=UgxnOQujJFUbGTf13Tp4AaABAg

It appears that other users responding to that Numberphile comment have written code which does the same sort of thing as this code does. By looking at this discussion I was able to improve my code's efficiency considerably and also add some analysis of n-traps.

Interestingly, the sequence is non-monotonic but appears to be increasing on average. It would be interesting to look at the distribution of knight-stops probabilistically (what is the probability that the knight will stop at step n, or at value k, etc.)

There is a very interesting discussion in the YouTube comments section about "double traps", "triple traps", etc - I had trouble implementing the code recursively and this appears to be why (the idea of an n-trap is that, when your knight is trapped in a position, that position is an n-trap if you have to recurse n positions before you have another position you can go to).

Some questions that arise from the sequence:

Similar/interesting results were found in the comments section by the following users (with sincere apologies if I missed anyone - if I did miss you, please know that it was not intentional):

  • Harrison Harris
  • dLichti
  • Darryl4779
  • Shirou97
  • John Merritt
  • SBGif

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages