Train Tracks with Gaps

Author William Kuszmaul

Thumbnail PDF


  • Filesize: 487 kB
  • 11 pages

Document Identifiers

Author Details

William Kuszmaul
  • Massachusetts Institute of Technology, CSAIL, Cambrige, MA, USA


The author would like to thank Michael A. Bender, Bradley C. Kuszmaul, and Charles E. Leiserson for several useful conversations about train tracks. The author would also like to thank Jake Hillard for offering his engineering expertise, and observing that train tracks with an asymptotically small number of pillars would likely encounter practical difficulties in the real world.

Cite AsGet BibTex

William Kuszmaul. Train Tracks with Gaps. In 10th International Conference on Fun with Algorithms (FUN 2021). Leibniz International Proceedings in Informatics (LIPIcs), Volume 157, pp. 19:1-19:11, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2020)


We identify a tradeoff curve between the number of wheels on a train car, and the amount of track that must be installed in order to ensure that the train car is supported by the track at all times. The goal is to build an elevated track that covers some large distance 𝓁, but that consists primarily of gaps, so that the total amount of feet of train track that is actually installed is only a small fraction of 𝓁. In order so that the train track can support the train at all points, the requirement is that as the train drives across the track, at least one set of wheels from the rear quarter and at least one set of wheels from the front quarter of the train must be touching the track at all times. We show that, if a train car has n sets of wheels evenly spaced apart in its rear and n sets of wheels evenly spaced apart in its front, then it is possible to build a train track that supports the train car but uses only Θ(𝓁 / n) feet of track. We then consider what happens if the wheels on the train car are not evenly spaced (and may even be configured adversarially). We show that for any configuration of the train car, with n wheels in each of the front and rear quarters of the car, it is possible to build a track that supports the car for distance 𝓁 and uses only O((𝓁 log n)/n) feet of track. Additionally, we show that there exist configurations of the train car for which this tradeoff curve is asymptotically optimal. Both the upper and lower bounds are achieved via applications of the probabilistic method. The algorithms and lower bounds in this paper provide simple illustrative examples of many of the core techniques in probabilistic combinatorics and randomized algorithms. These include the probabilistic method with alterations, the use of McDiarmid’s inequality within the probabilistic method, the algorithmic Lovász Local Lemma, the min-hash technique, and the method of conditional probabilities.

Subject Classification

ACM Subject Classification
  • Theory of computation
  • probabilistic method
  • algorithms
  • trains
  • Lovász Local Lemma
  • McDiarmid’s Inequality


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Noga Alon and Joel H Spencer. The probabilistic method. John Wiley & Sons, 2004. Google Scholar
  2. Andrei Z Broder. On the resemblance and containment of documents. In Proceedings. Compression and Complexity of Sequences 1997 (Cat. No. 97TB100171), pages 21-29. IEEE, 1997. Google Scholar
  3. Andrei Z Broder, Moses Charikar, Alan M Frieze, and Michael Mitzenmacher. Min-wise independent permutations. Journal of Computer and System Sciences, 60(3):630-659, 2000. Google Scholar
  4. Moses Charikar, Ofir Geri, Michael P Kim, and William Kuszmaul. On estimating edit distance: Alignment, dimension reduction, and embeddings. In 45th International Colloquium on Automata, Languages, and Programming (ICALP 2018). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2018. Google Scholar
  5. Paul Erdős and László Lovász. Problems and results on 3-chromatic hypergraphs and some related questions. In Colloquia Mathematics Societatis Janos Bolai 10. Infinite and Finite Sets, Keszthely (Hungary). Citeseer, 1973. Google Scholar
  6. William Kuszmaul. Efficiently approximating edit distance between pseudorandom strings. In Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1165-1180. Society for Industrial and Applied Mathematics, 2019. Google Scholar
  7. Mark S Manasse. On the efficient determination of most near neighbors: horseshoes, hand grenades, web search and other situations when close is close enough. Synthesis Lectures on Information Concepts, Retrieval, and Services, 4(4):1-88, 2012. Google Scholar
  8. Colin McDiarmid. On the method of bounded differences. Surveys in combinatorics, 141(1):148-188, 1989. Google Scholar
  9. Robin A Moser and Gábor Tardos. A constructive proof of the general lovász local lemma. Journal of the ACM (JACM), 57(2):11, 2010. Google Scholar
  10. Brian D Ondov, Todd J Treangen, Páll Melsted, Adam B Mallonee, Nicholas H Bergman, Sergey Koren, and Adam M Phillippy. Mash: fast genome and metagenome distance estimation using minhash. Genome biology, 17(1):132, 2016. Google Scholar