US 11,907,682 B2
Device and method for generating a random number drawn according to a nonuniform distribution
Thomas Hiscock, Grenoble (FR)
Assigned to Commissariat A L'Energie Atomique et aux Energies Alternatives, Paris (FR)
Filed by Commissariat A L'Energie Atomique et aux Energies Alternatives, Paris (FR)
Filed on Jan. 11, 2021, as Appl. No. 17/145,787.
Claims priority of application No. 20 00335 (FR), filed on Jan. 14, 2020.
Prior Publication US 2021/0216283 A1, Jul. 15, 2021
Int. Cl. G06F 7/58 (2006.01)
CPC G06F 7/58 (2013.01) 11 Claims
OG exemplary drawing
 
1. A device for generating a discrete random number, this random number being coded on Nk bits and drawn according to a nonuniform, discrete and bounded probability distribution ρ, this device comprising:
a microprocessor configured to implement
a generator of random numbers that are coded on Nr bits and drawn according to a uniform distribution, the number Nr being a positive integer number higher than or equal to the number Nk,
a slow sampler comprising:
a complete table associating, with each possible probability F(k) of the cumulative probability density F of the distribution ρ, the corresponding sample k coded on Nk bits, each probability F(k) being coded on NF bits, the number NF being higher than the number Nk and lower than or equal to the number Nr,
a first searching module able:
to receive the Nr bits of a random number r generated by the generator,
in response, to select, from the complete table, the only probability F(k) such that F(k−1)<r≤F(k), then
to transmit the sample k, associated by the complete table with the selected probability F(k), of as the discrete random number drawn according to the distribution ρ,
a fast sampler (ERi) comprising:
a truncated table, which is smaller than the complete table, associating with truncated random numbers rmsb coded only on Nmsb bits, the only sample k for which, whatever a number rlsb belonging to an interval [0; 2Nr−Nmsb−1], the following condition is met: F(k−1)<(rmsb, rlsb)≤F(k), where:
(rmsb, rlsb) is the binary number coded on Nr bits and the Nmsb most significant bits of which are equal to the Nmsb bits of a truncated random number rmsb and the (Nr−Nmsb) least significant bits of which are equal to the (Nr−Nmsb) bits of the number rlsb,
Nmsb is a positive integer number lower than Nr,
a second searching module able:
to acquire the Nmsb most significant bits of the random number r generated by the generator, these Nmsb bits forming a received truncated random number rmsb,
in response, to search for the received truncated random number rmsb in the truncated table, and
if the search is successful, to transmit the sample k, associated, by the truncated table, with the received truncated random number rmsb, as the discrete random number drawn according to the distribution ρ, and, alternatively, if the search is unsuccessful, to send a failure signal, and
the slow sampler is able to:
receive the failure signal and the random number r generated by the generator and the Nmsb most significant bits of which are equal to the truncated random number rmsb that led to this failure signal being sent, then
in response, to select, using the complete table, and to transmit the only sample k that meets the condition F(k−1)<r≤F(k) and that was unable to be transmitted by the fast sampler,
the generator is able to generate a new random number r at the start of each sampling interval, these sampling intervals being repeated periodically,
wherein the device comprises:
a plurality of fast samplers each able to work in parallel with the other fast samplers and in parallel with the slow sampler, and
an arbitrating module able to activate, on each new sampling interval, a new fast sampler different from the fast sampler activated in the preceding sampling interval, to process the Nmsb bits of the random number r generated at the start of this new sampling interval, with this new activated fast sampler.