Add nbviewer links

This commit is contained in:
Peter Norvig 2018-11-02 15:02:24 -07:00 committed by GitHub
parent 7044a32f41
commit 7eea7bdabf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,64 +4,66 @@
This project contains **pytudes**—Python programs for perfecting programming skills.
Some are in Jupyter (IPython) notebooks, some in `.py` files. You can view the files here, or clone the project, or run the notebooks online by clicking this button: [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/norvig/pytudes/master)
Some are in Jupyter (IPython) notebooks, some in `.py` files. You can view the files here (or if Github fails to load a notebook page, as it sometimes does, click the **NB** link to view on [nbviewer](http://nbviewer.jupyter.org/)); or clone the project, or run the notebooks online by clicking this button: [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/norvig/pytudes/master)
# Index of Jupyter (IPython) Notebooks
    [NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/.ipynb)
|Programming Examples|
|---|
|[Advent of Code 2017](https://github.com/norvig/pytudes/blob/master/ipynb/Advent%202017.ipynb)<br>*Puzzle site with a coding puzzle each day for Advent 2017.*|
|[Advent of Code 2016](https://github.com/norvig/pytudes/blob/master/ipynb/Advent%20of%20Code.ipynb)<br>*Puzzle site with a coding puzzle each day for Advent 2016*.|
|[Project Euler Utilities](https://github.com/norvig/pytudes/blob/master/ipynb/Project%20Euler%20Utils.ipynb)<br>*My utility functions for the Project Euler problems, including `Primes` and `Factors`.*|
|[Translating English Sentences into Propositional Logic Statements](https://github.com/norvig/pytudes/blob/master/ipynb/PropositionalLogic.ipynb)<br>*Automatically converting informal English sentences into formal Propositional Logic.*|
|[Beal's Conjecture Revisited](https://github.com/norvig/pytudes/blob/master/ipynb/Beal.ipynb)<br>*A search for counterexamples to Beal's Conjecture*|
|[WWW: Who Will Win (NBA Title)?](https://github.com/norvig/pytudes/blob/master/ipynb/WWW.ipynb)<br>*Computing the probability of winning the NBA title, for my home town Warriors, or any other team.*|
|[Pickleball Tournament](https://github.com/norvig/pytudes/blob/master/ipynb/Pickleball.ipynb)<br>*Scheduling a doubles tournament fairly and efficiently.*|
|[Conway's Game of Life](https://github.com/norvig/pytudes/blob/master/ipynb/Life.ipynb)<br>*The cellular automata zero-player game.*|
|[A Chaos Game with Triangles](https://github.com/norvig/pytudes/blob/master/ipynb/Sierpinski.ipynb)<br>*A surprising appearance of the Sierpinski triangle in a random walk between vertexes.*|
|[Generating Mazes](https://github.com/norvig/pytudes/blob/master/ipynb/Maze.ipynb)<br>*Make a maze by generating a random tree superimposed on a grid.*|
|[Can't Stop](https://github.com/norvig/pytudes/blob/master/ipynb/Cant-Stop.ipynb)<br>*Optimal play in a dice board game.*|
|[Bike Speed Versus Grade](https://github.com/norvig/pytudes/blob/master/ipynb/Bike%20Speed%20versus%20Grade.ipynb)<br>*How fast can I bike as the route gets steeper?*|
|[Properly Ordered Card Hands](https://github.com/norvig/pytudes/blob/master/ipynb/Orderable%20Cards.ipynb)<br>*Can you get your hand of cards into a nice order with just one move?*|
|[Advent of Code 2017](https://github.com/norvig/pytudes/blob/master/ipynb/Advent%202017.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Advent%202017.ipynb)**<br>*Puzzle site with a coding puzzle each day for Advent 2017.*|
|[Advent of Code 2016](https://github.com/norvig/pytudes/blob/master/ipynb/Advent%20of%20Code.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/dvent%20of%20Code.ipynb)**<br>*Puzzle site with a coding puzzle each day for Advent 2016*.|
|[Project Euler Utilities](https://github.com/norvig/pytudes/blob/master/ipynb/Project%20Euler%20Utils.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Project%20Euler%20Utils.ipynb)**<br>*My utility functions for the Project Euler problems, including `Primes` and `Factors`.*|
|[Translating English Sentences into Propositional Logic Statements](https://github.com/norvig/pytudes/blob/master/ipynb/PropositionalLogic.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/PropositionalLogic.ipynb)**<br>*Automatically converting informal English sentences into formal Propositional Logic.*|
|[Beal's Conjecture Revisited](https://github.com/norvig/pytudes/blob/master/ipynb/Beal.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Beal.ipynb)**<br>*A search for counterexamples to Beal's Conjecture*|
|[WWW: Who Will Win (NBA Title)?](https://github.com/norvig/pytudes/blob/master/ipynb/WWW.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/WWW.ipynb)**<br>*Computing the probability of winning the NBA title, for my home town Warriors, or any other team.*|
|[Pickleball Tournament](https://github.com/norvig/pytudes/blob/master/ipynb/Pickleball.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Pickleball.ipynb)**<br>*Scheduling a doubles tournament fairly and efficiently.*|
|[Conway's Game of Life](https://github.com/norvig/pytudes/blob/master/ipynb/Life.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Life.ipynb)**<br>*The cellular automata zero-player game.*|
|[A Chaos Game with Triangles](https://github.com/norvig/pytudes/blob/master/ipynb/Sierpinski.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Sierpinski.ipynb)**<br>*A surprising appearance of the Sierpinski triangle in a random walk between vertexes.*|
|[Generating Mazes](https://github.com/norvig/pytudes/blob/master/ipynb/Maze.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Maze.ipynb)**<br>*Make a maze by generating a random tree superimposed on a grid.*|
|[Can't Stop](https://github.com/norvig/pytudes/blob/master/ipynb/Cant-Stop.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Cant-Stop.ipynb)**<br>*Optimal play in a dice board game.*|
|[Bike Speed Versus Grade](https://github.com/norvig/pytudes/blob/master/ipynb/Bike%20Speed%20versus%20Grade.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Bike%20Speed%20versus%20Grade.ipynb)**<br>*How fast can I bike as the route gets steeper?*|
|[Properly Ordered Card Hands](https://github.com/norvig/pytudes/blob/master/ipynb/Orderable%20Cards.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Orderable%20Cards.ipynb)**<br>*Can you get your hand of cards into a nice order with just one move?*|
|Logic and Number Puzzles|
|---|
|[When is Cheryl's Birthday?](https://github.com/norvig/pytudes/blob/master/ipynb/Cheryl.ipynb)<br>*Solving the "Cheryl's Birthday" logic puzzle.*|
|[When Cheryl Met Eve: A Birthday Story](https://github.com/norvig/pytudes/blob/master/ipynb/Cheryl-and-Eve.ipynb)<br>*Inventing new puzzles in the Style of Cheryl's Birthday.*|
|[The Devil and the Coin Flip Game](https://github.com/norvig/pytudes/blob/master/ipynb/Coin%20Flip.ipynb)<br>*How to beat the Devil at his own game.*|
|[The Puzzle of the Misanthropic Neighbors](https://github.com/norvig/pytudes/blob/master/ipynb/Mean%20Misanthrope%20Density.ipynb)<br>*How crowded will this neighborhood be, if nobody wants to live next door to anyone else?*|
|[Four 4s, Five 5s, and Countdown to 2016](https://github.com/norvig/pytudes/blob/master/ipynb/Countdown.ipynb)<br>*Solving the equation 10 _ 9 _ 8 _ 7 _ 6 _ 5 _ 4 _ 3 _ 2 _ 1 = 2016. From an Alex Bellos puzzle.*|
|[Sicherman Dice](https://github.com/norvig/pytudes/blob/master/ipynb/Sicherman%20Dice.ipynb)<br>*Find a pair of dice that is like a regular pair of dice, only different.*|
|[Sol Golomb's Rectangle Puzzle](https://github.com/norvig/pytudes/blob/master/ipynb/Golomb-Puzzle.ipynb)<br>*A Puzzle involving placing rectangles of different sizes inside a square. Bonus: cryptarithmetic.*|
|[The Riddler: Battle Royale](https://github.com/norvig/pytudes/blob/master/ipynb/Riddler%20Battle%20Royale.ipynb)<br>*A puzzle involving allocating your troops and going up against an opponent.*|
|[When is Cheryl's Birthday?](https://github.com/norvig/pytudes/blob/master/ipynb/Cheryl.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Cheryl.ipynb)**<br>*Solving the "Cheryl's Birthday" logic puzzle.*|
|[When Cheryl Met Eve: A Birthday Story](https://github.com/norvig/pytudes/blob/master/ipynb/Cheryl-and-Eve.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Cheryl-and-Eve.ipynb)**<br>*Inventing new puzzles in the Style of Cheryl's Birthday.*|
|[The Devil and the Coin Flip Game](https://github.com/norvig/pytudes/blob/master/ipynb/Coin%20Flip.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Coin%20Flip.ipynb)**<br>*How to beat the Devil at his own game.*|
|[The Puzzle of the Misanthropic Neighbors](https://github.com/norvig/pytudes/blob/master/ipynb/Mean%20Misanthrope%20Density.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Mean%20Misanthrope%20Density.ipynb)**<br>*How crowded will this neighborhood be, if nobody wants to live next door to anyone else?*|
|[Four 4s, Five 5s, and Countdown to 2016](https://github.com/norvig/pytudes/blob/master/ipynb/Countdown.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Countdown.ipynb)**<br>*Solving the equation 10 _ 9 _ 8 _ 7 _ 6 _ 5 _ 4 _ 3 _ 2 _ 1 = 2016. From an Alex Bellos puzzle.*|
|[Sicherman Dice](https://github.com/norvig/pytudes/blob/master/ipynb/Sicherman%20Dice.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Sicherman%20Dice.ipynb)**<br>*Find a pair of dice that is like a regular pair of dice, only different.*|
|[Sol Golomb's Rectangle Puzzle](https://github.com/norvig/pytudes/blob/master/ipynb/Golomb-Puzzle.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Golomb-Puzzle.ipynb)**<br>*A Puzzle involving placing rectangles of different sizes inside a square. Bonus: cryptarithmetic.*|
|[The Riddler: Battle Royale](https://github.com/norvig/pytudes/blob/master/ipynb/Riddler%20Battle%20Royale.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Riddler%20Battle%20Royale.ipynb)**<br>*A puzzle involving allocating your troops and going up against an opponent.*|
|Word Games|
|---|
|[xkcd 1970: Name Dominoes](https://github.com/norvig/pytudes/blob/master/ipynb/xkcd-Name-Dominoes.ipynb)<br>*Lay out dominoes legally; the dominoes have people names, not numbers.*|
|[Ghost](https://github.com/norvig/pytudes/blob/master/ipynb/Ghost.ipynb)<br>*The word game Ghost (add letters, try to avoid making a word).*|
|[World's Longest Palindrome](https://github.com/norvig/pytudes/blob/master/ipynb/pal3.ipynb)<br>*Searching for a long Panama-style palindrome, this time letter-by-letter.*|
|[Refactoring a Crossword Game Program](https://github.com/norvig/pytudes/blob/master/ipynb/Scrabble.ipynb)<br>*Refactoring the Scrabble / Word with Friends game from Udacity 212.*|
|[xkcd 1313: Regex Golf](https://github.com/norvig/pytudes/blob/master/ipynb/xkcd1313.ipynb)<br>*Find the smallest regular expression; inspired by Randall Monroe.*|
|[xkcd 1313: Regex Golf (Part 2: Infinite Problems)](https://github.com/norvig/pytudes/blob/master/ipynb/xkcd1313-part2.ipynb)<br>*Regex Golf: better, faster, funner. With Stefan Pochmann.*|
|[Let's Code About Bike Locks](https://github.com/norvig/pytudes/blob/master/ipynb/Fred%20Buns.ipynb)<br>*A tale of a bicycle combination lock that uses letters instead of digits. Inspired by Bike Snob NYC.*|
|[Gesture Typing](https://github.com/norvig/pytudes/blob/master/ipynb/Gesture%20Typing.ipynb)<br>*What word has the longest path on a gesture-typing smartphone keyboard?*|
|[How to Do Things with Words, or Statistical Natural Language Processing in Python](https://github.com/norvig/pytudes/blob/master/ipynb/How%20to%20Do%20Things%20with%20Words.ipynb)<br>*Spelling Correction, Secret Codes, Word Segmentation, and more: grab your bag of words.*|
|[xkcd 1970: Name Dominoes](https://github.com/norvig/pytudes/blob/master/ipynb/xkcd-Name-Dominoes.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/xkcd-Name-Dominoes.ipynb)**<br>*Lay out dominoes legally; the dominoes have people names, not numbers.*|
|[Ghost](https://github.com/norvig/pytudes/blob/master/ipynb/Ghost.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Ghost.ipynb)**<br>*The word game Ghost (add letters, try to avoid making a word).*|
|[World's Longest Palindrome](https://github.com/norvig/pytudes/blob/master/ipynb/pal3.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/pal3.ipynb)**<br>*Searching for a long Panama-style palindrome, this time letter-by-letter.*|
|[Refactoring a Crossword Game Program](https://github.com/norvig/pytudes/blob/master/ipynb/Scrabble.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Scrabble.ipynb)**<br>*Refactoring the Scrabble / Word with Friends game from Udacity 212.*|
|[xkcd 1313: Regex Golf](https://github.com/norvig/pytudes/blob/master/ipynb/xkcd1313.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/xkcd1313.ipynb)**<br>*Find the smallest regular expression; inspired by Randall Monroe.*|
|[xkcd 1313: Regex Golf (Part 2: Infinite Problems)](https://github.com/norvig/pytudes/blob/master/ipynb/xkcd1313-part2.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/xkcd1313-part2.ipynb)**<br>*Regex Golf: better, faster, funner. With Stefan Pochmann.*|
|[Let's Code About Bike Locks](https://github.com/norvig/pytudes/blob/master/ipynb/Fred%20Buns.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Fred%20Buns.ipynb)**<br>*A tale of a bicycle combination lock that uses letters instead of digits. Inspired by Bike Snob NYC.*|
|[Gesture Typing](https://github.com/norvig/pytudes/blob/master/ipynb/Gesture%20Typing.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Gesture%20Typing.ipynb)**<br>*What word has the longest path on a gesture-typing smartphone keyboard?*|
|[How to Do Things with Words, or Statistical Natural Language Processing in Python](https://github.com/norvig/pytudes/blob/master/ipynb/How%20to%20Do%20Things%20with%20Words.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/How%20to%20Do%20Things%20with%20Words.ipynb)**<br>*Spelling Correction, Secret Codes, Word Segmentation, and more: grab your bag of words.*|
|Math Concepts|
|---|
|[A Concrete Introduction to Probability](https://github.com/norvig/pytudes/blob/master/ipynb/Probability.ipynb)<br>*Code and examples of the basic principles of Probability Theory.*|
|[Probability, Paradox, and the Reasonable Person Principle](https://github.com/norvig/pytudes/blob/master/ipynb/ProbabilityParadox.ipynb)<br>*Some classic paradoxes in Probability Theory, and how to think about disagreements.*|
|[Symbolic Algebra, Simplification, and Differentiation](https://github.com/norvig/pytudes/blob/master/ipynb/Differentiation.ipynb)<br>*A computer algebra system that manipulates expressions, including symbolic differentiation.*|
|[Economics Simulation](https://github.com/norvig/pytudes/blob/master/ipynb/Economics.ipynb)<br>*A simulation of a simple economic game.*|
|[How to Count Things](https://github.com/norvig/pytudes/blob/master/ipynb/How%20To%20Count%20Things.ipynb)<br>*Combinatorial math: how to count how many things there are, when there are a lot of them.*|
|[Euler's Sum of Powers Conjecture](https://github.com/norvig/pytudes/blob/master/ipynb/Euler's%20Conjecture.ipynb)<br>*Solving a 200-year-old puzzle by finding integers that satisfy a<sup>5</sup> + b<sup>5</sup> + c<sup>5</sup> + d<sup>5</sup> = e<sup>5</sup>.*|
|[A Concrete Introduction to Probability](https://github.com/norvig/pytudes/blob/master/ipynb/Probability.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Probability.ipynb)**<br>*Code and examples of the basic principles of Probability Theory.*|
|[Probability, Paradox, and the Reasonable Person Principle](https://github.com/norvig/pytudes/blob/master/ipynb/ProbabilityParadox.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/ProbabilityParadox.ipynb)**<br>*Some classic paradoxes in Probability Theory, and how to think about disagreements.*|
|[Symbolic Algebra, Simplification, and Differentiation](https://github.com/norvig/pytudes/blob/master/ipynb/Differentiation.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Differentiation.ipynb)**<br>*A computer algebra system that manipulates expressions, including symbolic differentiation.*|
|[Economics Simulation](https://github.com/norvig/pytudes/blob/master/ipynb/Economics.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Economics.ipynb)**<br>*A simulation of a simple economic game.*|
|[How to Count Things](https://github.com/norvig/pytudes/blob/master/ipynb/How%20To%20Count%20Things.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/How%20To%20Count%20Things.ipynb)**<br>*Combinatorial math: how to count how many things there are, when there are a lot of them.*|
|[Euler's Sum of Powers Conjecture](https://github.com/norvig/pytudes/blob/master/ipynb/Euler's%20Conjecture.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Euler's%20Conjecture.ipynb)**<br>*Solving a 200-year-old puzzle by finding integers that satisfy a<sup>5</sup> + b<sup>5</sup> + c<sup>5</sup> + d<sup>5</sup> = e<sup>5</sup>.*|
|Computer Science Algorithms and Concepts|
|---|
|[BASIC Interpreter](https://github.com/norvig/pytudes/blob/master/ipynb/BASIC.ipynb)<br>*How to write an interpreter for the BASIC programming language.*|
|[Bad Grade, Good Experience](https://github.com/norvig/pytudes/blob/master/ipynb/Snobol.ipynb)<br>*As a student, did you ever get a bad grade on a programming assignment? (Snobol, Concordance)*|
|[The Convex Hull Problem](https://github.com/norvig/pytudes/blob/master/ipynb/Convex%20Hull.ipynb)<br>*A classic Computer Science Algorithm.*|
|[The Traveling Salesperson Problem](https://github.com/norvig/pytudes/blob/master/ipynb/TSP.ipynb)<br>*Another of the classics.*|
|[BASIC Interpreter](https://github.com/norvig/pytudes/blob/master/ipynb/BASIC.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/BASIC.ipynb)**<br>*How to write an interpreter for the BASIC programming language.*|
|[Bad Grade, Good Experience](https://github.com/norvig/pytudes/blob/master/ipynb/Snobol.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Snobol.ipynb)**<br>*As a student, did you ever get a bad grade on a programming assignment? (Snobol, Concordance)*|
|[The Convex Hull Problem](https://github.com/norvig/pytudes/blob/master/ipynb/Convex%20Hull.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/Convex%20Hull.ipynb)**<br>*A classic Computer Science Algorithm.*|
|[The Traveling Salesperson Problem](https://github.com/norvig/pytudes/blob/master/ipynb/TSP.ipynb)&nbsp; &nbsp; **[NB](https://raw.githubusercontent.com/norvig/pytudes/master/ipynb/TSP.ipynb)**<br>*Another of the classics.*|
# Index of Python Files