This question evaluates understanding of probability theory and discrete stochastic processes, specifically reasoning about random walks and event probabilities over (potentially infinite) state spaces.
You are on an infinite 1D number line starting at position 0. Repeatedly roll a fair die that returns an integer uniformly at random from 1 to K (inclusive), and move forward by that many steps.
You win if you ever land on a position within the target interval (inclusive). You lose if you jump past the interval, i.e., your position becomes without ever landing in .
Given integers , , and (with ), compute the probability of winning starting from position 0.
Return the probability as a floating-point value (or as an exact fraction if you prefer), with acceptable error .