A board-game designer wants to see how often each total turns up when two dice are rolled together. The simulation must give the same counts every time it runs.
Task: write dice_totals(seed, n_rolls, sides). Each die has faces numbered from 1 to sides. Follow this exact recipe, so everyone's numbers come out the same:
rng = np.random.default_rng(seed).n_rolls times with a single call to rng.integers, using size=n_rolls.n_rolls times with a second call to the same rng, in the same way.k of the first die goes with roll k of the second. Add each pair to get a total.Return a list of counts: how many totals were 2, how many were 3, and so on up to 2 * sides. Every total in that range gets a count, even when it is 0. If n_rolls is 0, every count is 0.