Publications by Todd Schneider
Using R to Solve a Geography Puzzle
The puzzle: find two points inside the United States such that Both points are in the same state The straight line segment (shortest great circle) connecting them crosses the largest number of distinct states This came up during a recent road trip through Pennsylvania, Maryland, West Virginia, and Virginia, where I noticed that it’s possible to...
6817 sym R (298 sym/1 pcs) 24 img
The Traveling Salesman with Simulated Annealing, R, and Shiny
I built an interactive Shiny application that uses simulated annealing to solve the famous traveling salesman problem. You can play around with it to create and solve your own tours at the bottom of this post. Here’s an animation of the annealing process finding the shortest path through the 48 state capitals of the contiguous United States: H...
5267 sym R (190 sym/2 pcs) 6 img 1 tbl
How Many Paths are Possible in an 18 Hole Round of Match Play Golf?
In honor of the Ryder Cup, here’s a fun puzzle for the mathematically inclined golfer to consider: how many different paths are possible in an 18 hole round of match play golf? If you’d rather not wade through the math then you can skip ahead to the “practical exploration” section of this post to see some actual match play data, but if yo...
11451 sym 14 img
The reddit Front Page is Not a Meritocracy
I was pleasantly surprised when somebody shared my traveling salesman animation to reddit and the post made it all the way to reddit’s default front page (i.e. the top 25). The gif racked up over 1.3 million pageviews on Imgur, a testament to reddit’s traffic-generating prowess. Before the post made it to the front page, though, it was brough...
17022 sym 30 img
Mortgages Are About Math: Open-Source Loan-Level Analysis of Fannie and Freddie
[M]ortgages were acknowledged to be the most mathematically complex securities in the marketplace. The complexity arose entirely out of the option the homeowner has to prepay his loan; it was poetic that the single financial complexity contributed to the marketplace by the common man was the Gordian knot giving the best brains on Wall Street a ...
23619 sym R (527 sym/5 pcs) 18 img 2 tbl
A Statistical Analysis of the LearnedLeague Trivia Competition
LearnedLeague bills itself as “the greatest web-based trivia league in all of civilized earth.” Having been fortunate enough to partake in the past 3 seasons, I’m inclined to agree. LearnedLeague players, known as “LLamas”, answer trivia questions drawn from 18 assorted categories, and one of the many neat things about LearnedLeague is ...
9411 sym 14 img 1 tbl
Analyzing 1.1 Billion NYC Taxi and Uber Trips, with a Vengeance
The New York City Taxi & Limousine Commission has released a staggeringly detailed historical dataset covering over 1.1 billion individual taxi trips in the city from January 2009 through June 2015. Taken as a whole, the detailed trip-level data is more than just a vast list of taxi pickup and drop off coordinates: it’s a story of New York. How...
26929 sym 54 img 2 tbl
A Tale of Twenty-Two Million Citi Bikes: Analyzing the NYC Bike Share System
In the conclusion of my post analyzing NYC taxi and Uber trips, I noted that Citi Bike, New York City’s bike share system, also releases public data, totaling 22.2 million rides from July 2013 through November 2015. With the recent news that the Citi Bike system topped 10 million rides in 2015, making it one of the world’s largest bike shares...
23181 sym R (471 sym/3 pcs) 36 img 1 tbl
BallR: Interactive NBA Shot Charts with R and Shiny
The NBA’s Stats API provides data for every single shot attempted during an NBA game since 1996, including location coordinates on the court. I built a tool called BallR, using R’s Shiny framework, to explore NBA shot data at the player-level. BallR lets you select a player and season, then creates a customizable chart that shows shot pattern...
6475 sym R (236 sym/2 pcs) 14 img 1 tbl
The Simpsons by the Data
The Simpsons needs no introduction. At 27 seasons and counting, it’s the longest-running scripted series in the history of American primetime television. The show’s longevity, and the fact that it’s animated, provides a vast and relatively unchanging universe of characters to study. It’s easier for an animated show to scale to hundreds of...
8985 sym 20 img