IMO 1987 LL USA65

The runs of a decimal number are its increasing or decreasing

IMO 1987 LL USA65

Origin: USA

Problem

The runs of a decimal number are its increasing or decreasing blocks of digits. Thus 024379 has three runs: 024, 43, and 379. Determine the average number of runs for a decimal number in the set {d1d2 . . . dn | dk ̸= dk+1, k = 1, 2, . . ., n −1}, where n \geq2.