Solution

ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2023/discrete-mathematics-probability-and-continuous-mathematics/8/b/i/solution

Take an independent and identically distributed sequence with , independent of . Conditional on , the random sum has binomial distribution with parameters , including the empty sum at . This construction therefore has exactly the prescribed joint law of and represents as the required random sum.
For a literal representation that retains an already given pair , enlarge the probability space by auxiliary randomness. Conditional on , choose uniformly a size- subset of , put ones at those indices and zeros at the others, and append independent Bernoulli variables of parameter . Given , a specified length- pattern with ones has probability . Thus the entire sequence is independent and identically distributed and independent of , while its first terms sum to the original .

New to topics? Read the docs here!