© 2020 IOP Publishing Ltd. Quantum computers provide an opportunity to efficiently sample from probability distributions that include non-trivial interference effects between amplitudes. Using a simple process wherein all possible state histories can be specified by a binary tree, we construct an explicit quantum algorithm for an important three-dimensional subspace of the parameter space that runs in polynomial time to sample from the process once. The corresponding naive Markov chain algorithm does not produce the correct probability distribution and an explicit classical calculation of the full distribution requires exponentially many operations. However, the problem can be reduced to a system of two qubits with repeated measurements, shedding light on a quantum-inspired efficient classical algorithm.