Re: question: random number in residue number representation
- From: "jiangwu.mail@xxxxxxxxx" <jiangwu.mail@xxxxxxxxx>
- Date: Wed, 6 Feb 2008 05:03:44 -0800 (PST)
On Feb 5, 1:48 pm, hru...@xxxxxxxxxxxxxxxxxxxx (Herman Rubin) wrote:
In article <dfe03304-b08c-48ed-bac9-865aeba6b...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,You mean in the case that p_i=p_j? but all p_i, p_j need to be coprime
jiangwu.m...@xxxxxxxxx <jiangwu.m...@xxxxxxxxx> wrote:
On Feb 1, 10:21 pm, d...@xxxxxxxxxxxxxxxxxxxxxxxx (David Wagner)
wrote:
Herman Rubin wrote:Exactly. Actually the problem can be better formulated: to generate
jiangwu.m...@xxxxxxxxx <jiangwu.m...@xxxxxxxxx> wrote:But that generates a random x in the range 0 <= x < g, whereas
Let p_1,...,p_n be n prime numbers. Let g=p_1p_2...p_n. Any numberJust generate separately 0 <= x_i < p_i. This can be done
0<=x<=g can be represented as x_1,...,x_n, where x_i=x mod p_i.
The question is to generate a random number r in residue number
representation (r_1,...,r_n) and 0<= r <=b where b \approx sqrt(g).
in time O(log p_i), and so one gets O(log g) altogether.
the poster asked to generate a random x in approximately the range
0 <= x <= sqrt(g).
an x such that 0<= x < p_1p_2...p_l for a given l<n.
In this case, x is determined by its residues mod p_1, ..., p_l.
I do not see any solution other than getting the residues
mod p_{l+1}, ..., p_n from the result of those. One way
of doing this, if the same p's occur often, is to preset
the constants needed to carry out the computation.
here.
--
This address is for information only. I do not claim that these views
are those of the Statistics Department or of Purdue University.
Herman Rubin, Department of Statistics, Purdue University
hru...@xxxxxxxxxxxxxxx Phone: (765)494-6054 FAX: (765)494-0558
.
- Follow-Ups:
- Re: question: random number in residue number representation
- From: Phil Carmody
- Re: question: random number in residue number representation
- References:
- Re: question: random number in residue number representation
- From: Herman Rubin
- Re: question: random number in residue number representation
- From: David Wagner
- Re: question: random number in residue number representation
- From: jiangwu.mail@xxxxxxxxx
- Re: question: random number in residue number representation
- From: Herman Rubin
- Re: question: random number in residue number representation
- Prev by Date: Re: LFSR in "Electronic Design" article
- Next by Date: Re: Truecrypt 5.0 is up
- Previous by thread: Re: question: random number in residue number representation
- Next by thread: Re: question: random number in residue number representation
- Index(es):
Relevant Pages
|