PUZZLE IBM-284
Galton Board
IBM Research · Ponder This · 2021-12
IBM Ponder This #284 · December 2021
A Galton board consists of a set of cells (9, in our example) above which are places rows of pins, such that if a ball hits a pin, it as equal probability to fall to the right or to the left. The down-most row has 8 pins, the one above has 7 pins and so forth, up to the first row which consists of one pin and above it a funnel from which balls drop balls on the pins.

The cell where a ball lands is determined by the random sequence of "left/right" choices determined as it fell. For example, to end up in the middle cell exactly four left bounces and four right bounces must occur, or be chosen. There are exactly
The Galton board can be made deterministic by replacing each fixed pin by a moveable pin which can be in "LEFT" or "RIGHT" orientation, such that if a ball falls on a "LEFT" pin, the ball goes to the left but the pin changes orientation and becomes "RIGHT", and vice verse.

We can also use static pins which always point to left or right.
The score for a deterministic Galton board is computed as follows: Given a board with
You are given the number of cells
The orientation of the pins can be described as a string of length
- "L" means a dynamic pin which drops the ball to the left and then becomes "R"
- "R" means a dynamic pin which drops the ball to the right and then becomes "L"
- "<" means a static pin which drops the ball to the left and remains "<"
- ">" means a static pin which drops the ball to the right and remains ">"
The symbols denote the status of the pins beginning from the top row (single pin) to the bottom row (
For example, in the case of
Your goal: For
A bonus "*" will be given for finding a score of at least 20 for n=10 m=150 and permutation [4, 8, 2, 7, 10, 6, 3, 9, 1, 5]
Solution
Best opened after a real attemptTo be added.