MathDB
Probability and Expected value, flash back to the AMC

Source: STEMS 2022 Cat A P1

December 20, 2021
probabilityexpected valuenumber theoryrelatively prime

Problem Statement

We have 20222022 1s1s written on a board in a line. We randomly choose a strictly increasing sequence from 1,2,...,2022{1, 2, . . . , 2022} such that the last term is 20222022. If the chosen sequence is a1,a2,...,aka_1, a_2, ..., a_k (kk is not fixed), then at the ithi^{th} step, we choose the first ai_i numbers on the line and change the 1s to 0s and 0s to 1s. After kk steps are over, we calculate the sum of the numbers on the board, say SS. The expected value of SS is ab\frac{a}{b} where a,ba, b are relatively prime positive integers. Find a+b.a + b.