[
[
['13','add','hl'],
['13','remove','hidden'],
['14','add','hl'],
['14','remove','hidden'],
['15','add','hl'],
['15','remove','hidden'],
['3','add','hidden'],
['9','remove','slide-up']
],
[
['13','remove','hl'],
['14','remove','hl'],
['15','remove','hl']
],
[
['25','remove','indent-1'],
['25','add','hl'],
['25','remove','hidden'],
['25','add','indent-2'],
['19','remove','slide-up'],
['9','add','slide-down']
],
[
['25','remove','hl'],
['5','add','hl'],
['13','add','hl'],
['14','add','hl'],
['30','remove','slide-up'],
['19','add','slide-down']
],
[
['32','remove','hidden'],
['25','remove','indent-2'],
['5','remove','hl'],
['5','add','hidden'],
['13','remove','hl'],
['13','add','hidden'],
['14','remove','hl'],
['14','add','hidden'],
['25','add','indent-1']
]
]
Modify $\lib{samp-rand}$ to keep track of values that have been chosen previously and record whether a repeat occurs (with a bad event). These changes are all internal to the library and do not affect its output behavior.
Modify the library to re-sample $R$ in the case of a repeat. The library's behavior changes only after a bad event, whose probability is $\Birthday(q(\secpar),2^\secpar)$, if the adversary makes $q(\secpar)$ calls to $\bdaysamp$. As mentioned above, this probability is negligible since $q$ is a polynomial. Hence, the change is indistinguishable.
The logic of the if-statement has the effect that $\bdaysamp$ ultimately samples uniformly from $\bits^\secpar \setminus \mathcal{R}$. Thus, the library's code can be simplified, resulting in $\lib{samp-uniq}$.
$\lib{samp-rand}$
$\lib{samp-uniq}$
$R \gets \bits^\secpar$
if $R \in \mathcal{R}$:
$\badvar := \mytrue$
$R \gets \bits^\secpar \setminus \mathcal{R}$
$\mathcal{R} := \mathcal{R} \cup \{ R \} $
return $R$