hi ,

I think the Linear Congruential Generator is believed to be the most
simple of all PRNGs.

The sequence can be generated using the following,
X(n+1) = (a* Xn +c ) mod m

In the above , your first step would be
X1 = (a*X0 +c ) mod m

X0 is the seed value that you need to feed to the algorithm and it has
no restrictions as such.
 a is a multiplier
c is the  increment and choose some value for m

note that c and m should be relatively prime to each other - (such
that they do no have any common factor except for 1 )

 This perfectly fits you application because, LCGs are generally not
advisable to be used in Cryptographic algorithms - where randomness is
critical.



On 10/3/09, Brandon <brandon.joseph.mo...@gmail.com> wrote:
>
> Hi.
>
> I need a computationally simple algorithm to generate a random series
> of discrete values, i.e., I want to get a string of integers where
> each integer is in the range from 1 to N where N is fairly small (less
> than 100 for sure).  Has to be simple enough to run on a
> microcontroller unit.  Doesn't need to be extremely good, the sequence
> could probably repeat after only 1000 values and sitll be okay.  I
> just don't want to someone looking at the sequence to notice any
> obvious patterns.
>
> Thanks
>
> >
>


-- 
Hari

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to