Almost three quarters
In 1733 Georges-Louis Leclerc, later the Comte de Buffon, read a memoir to the Académie royale des sciences about a game called franc-carreau, "clean tile". The game was simple. Someone throws a coin, an écu, into the air over a tiled floor. One player bets it will come to rest entirely inside a single tile. Another bets it will lie across a joint. Buffon asked what each player's chances were, and he answered with areas instead of counting. Draw a smaller copy of the tile inside it, set in from every edge by the coin's radius. The coin lands clean whenever its centre falls inside that inner figure, so the odds are the inner area against the border strip around it. Nobody had worked out chances that way before. The usual cases came from dice and cards, which have a finite list of outcomes to count, and here the outcomes form a region to be measured.
He printed it properly forty-four years later, in 1777, as article XXIII of his Essai d'arithmétique morale in the fourth supplementary volume of the Histoire naturelle. I read it in the English translation by John Hey, Tibor Neugebauer and Carmen Pasca (2010, PDF). After the coin, almost as an afterthought, comes a stick. If you throw "a squared Spanish pistole, or a needle, a stick" instead of a round coin, he says, "the problem demands a little more geometry."
The stick. He describes a room whose floor is "simply divided by parallel joints", like a floor of boards. Throw a stick into the air. One player bets it will cross no joint, the other that it will cross one. The stick is shorter than the boards are wide, so it can cross at most one joint. "One can play this game on a checkerboard with a sewing needle or a headless pin." He works the chances out by the same move as before, with lines drawn half a stick's length in from each joint, plus an integral over the angle at which the stick lies. That integral is the first appearance of what is now called Buffon's needle. The answer, in modern form, is that a stick of length L on boards d wide crosses a joint with probability 2L/πd.
What Buffon wanted from that formula was a fair game. Set the two players' chances equal and solve for the stick, and he finds that "the length of the stick must be almost three quarters of the distance of the floor-joints." The exact figure is π/4, about 0.785, so his "almost" is a little generous, since that is slightly more than three quarters. He was answering a gambler's question, which is how long a pin has to be before nobody has the edge. The π is in the answer only because the stick can lie at any angle. Buffon did not suggest turning the game round and throwing the stick to find π.
He was not shy of experiment, either. A few articles earlier, in the same essay, he tests the St Petersburg game by having "a child throw the coin in the air" two thousand and forty-eight times, and he lists the payouts. For the stick he gives no throws at all.
The stick turned round. It was Laplace, in his Théorie analytique des probabilités of 1812, who saw that the formula could be read backwards. Throw the stick n times, count the h crossings, and π ≈ 2Ln/dh. In other words, a floor and a needle make a slow and noisy way of measuring π. People tried it. Between 1849 and 1853 the Zurich astronomer Rudolf Wolf threw a needle 36 mm long onto lines 45 mm apart five thousand times and counted 2,532 crossings, which gives 3.1596. That is wrong in the second decimal place, about as wrong as five thousand throws ought to be.
3,408 throws. In 1901 Mario Lazzarini, an Italian mathematics teacher, reported in the Periodico di matematica per l'insegnamento secondario that he had done much better. He used a needle 2.5 cm long on lines 3 cm apart, so the needle was five sixths of the spacing. He described a machine that dropped the needle onto a grid of wires and marked a paper strip whenever it touched one. He reported 1,808 crossings in 3,408 throws. That gives 3.1415929, correct to six decimal places, from fewer throws than Wolf made.
It is too good, and the arithmetic shows why. 1,808 is 16 × 113 and 3,408 is 16 × 213, so the estimate reduces to 5 × 213 / (3 × 113), which is exactly 355/113. That fraction has been known as an approximation to π since Zu Chongzhi in fifth-century China. No fraction with a smaller denominator comes nearer. Each crossing moves the estimate a long way. With one more crossing the result would have been 3.1399, and with one fewer, 3.1433. With 3,408 honest throws the estimate wanders about 0.05 either side of π, so all six decimals depend on landing on the one integer that hits 355/113. Lee Badger took the report apart in Mathematics Magazine in 1994, in a paper titled "Lazzarini's Lucky Approximation of π" (vol. 67, pp. 83–91).
The likeliest explanation is not that Lazzarini invented every number. It is that he stopped at the right moment. With his needle, the expected number of crossings in 213 throws is 113.00001, because that ratio is built into the needle. So a man who throws in batches of 213 and checks after each batch whether his crossings make an exact multiple of 113 will, sooner or later, catch the count sitting exactly on it and can write up a perfect 355/113. I ran that procedure a couple of hundred thousand times with a simulated needle. The count landed on a multiple of 113 at the very first check about one time in eighteen. It had done so by the sixteenth check about 29 times in a hundred, a little more often than a coin comes up heads twice running. Every throw in such a run can be honest. What is not honest is choosing n after you have seen h, and then printing only the n you chose.
That is not the only reading of the report. In 2018 the Dutch science journalist Hans van Maanen argued, in Skepter, that the apparatus Lazzarini described could not have worked, and that the paper may never have been meant to be taken seriously. It appeared in a journal for teachers, so a lesson is a plausible purpose. Either way, the number was chosen before the needle fell.
What I keep is Buffon's version. He did not want π out of the floor. He wanted to know how long to make the pin so that two people could bet on it fairly, and π turned up in the answer whether he wanted it or not.
The piece Stop when it agrees drops the needles. It can play Buffon's fair game, follow Wolf's honest running estimate, or stop the way Lazzarini probably did.