Click here to Skip to main content
15,886,919 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: matlab a function in m-file Pin
Sean Cundiff31-Mar-07 13:24
Sean Cundiff31-Mar-07 13:24 
Questionbandwidth question Pin
Planker29-Mar-07 19:08
Planker29-Mar-07 19:08 
AnswerRe: bandwidth question Pin
Rilhas19-May-07 10:03
Rilhas19-May-07 10:03 
Questiongenerate unrepeated serials Pin
samira forooghi28-Mar-07 20:05
samira forooghi28-Mar-07 20:05 
AnswerRe: generate unrepeated serials Pin
Nathan Addy29-Mar-07 15:19
Nathan Addy29-Mar-07 15:19 
AnswerRe: generate unrepeated serials Pin
Tim Paaschen29-Mar-07 20:18
Tim Paaschen29-Mar-07 20:18 
GeneralRe: generate unrepeated serials Pin
Nathan Addy30-Mar-07 7:38
Nathan Addy30-Mar-07 7:38 
GeneralRe: generate unrepeated serials Pin
Tim Paaschen1-Apr-07 20:40
Tim Paaschen1-Apr-07 20:40 
Nathan A. wrote:
...
The problem is that your numbers aren't very random at all (not uniformly distributed in the range 1000-9999).
...


Of cause your are right - this is why I called my "algorithm" a simple approach.

Nathan A. wrote:
...
If you switch your algorithm around, by putting the random half first, you get something MUCH better.
...


When I suggested to use two (or three) "sections" I didn't meant to place them specifically in that sequence, just that the number can be compsed of two parts, each designed to fullfill one of the requirements.

Nathan A. wrote:
...
Basically the best way to do it is just generate random numbers in that range.
...


IMO the "best way" depends on your requirements. If the numbers must be uniformly distributed, a well known and tested pseudo random nuber generator will be the best solution. The "used" numbers can be stored and each newly generated number can be compared with this list to guarantee it is unique.
However, if you just want to generate some serial numbers for your application, which must be unique and should not be consecutive (for some reason), this approach seems to be overkill.


Regards,
Tim

GeneralRe: generate unrepeated serials [modified] Pin
cp98761-Apr-07 21:13
cp98761-Apr-07 21:13 
GeneralRe: generate unrepeated serials Pin
Nathan Addy2-Apr-07 8:58
Nathan Addy2-Apr-07 8:58 
GeneralRe: generate unrepeated serials Pin
cp98762-Apr-07 15:38
cp98762-Apr-07 15:38 
Questionhelp me Pin
phowarso28-Mar-07 4:38
phowarso28-Mar-07 4:38 
AnswerRe: help me Pin
Newbie0028-Mar-07 5:34
Newbie0028-Mar-07 5:34 
GeneralRe: help me Pin
phowarso28-Mar-07 5:56
phowarso28-Mar-07 5:56 
GeneralRe: help me Pin
phowarso28-Mar-07 5:56
phowarso28-Mar-07 5:56 
AnswerRe: help me Pin
cp987628-Mar-07 17:19
cp987628-Mar-07 17:19 
QuestionChess genetic algorithm Pin
blashey25-Mar-07 4:01
blashey25-Mar-07 4:01 
AnswerRe: Chess genetic algorithm Pin
Paul Conrad14-Jul-07 10:20
professionalPaul Conrad14-Jul-07 10:20 
QuestionRough Set Algorithm Pin
kkadir24-Mar-07 14:05
kkadir24-Mar-07 14:05 
AnswerRe: Rough Set Algorithm Pin
Paul Conrad21-Jul-07 18:06
professionalPaul Conrad21-Jul-07 18:06 
QuestionCube and Rectangle Intersection Pin
jk chan23-Mar-07 3:03
jk chan23-Mar-07 3:03 
AnswerRe: Cube and Rectangle Intersection Pin
Dan Neely23-Mar-07 3:20
Dan Neely23-Mar-07 3:20 
QuestionMath research team maps E8! Pin
73Zeppelin19-Mar-07 20:09
73Zeppelin19-Mar-07 20:09 
AnswerRe: Math research team maps E8! Pin
Maximilien20-Mar-07 3:17
Maximilien20-Mar-07 3:17 
JokeRe: Math research team maps E8! Pin
Dan Neely20-Mar-07 5:33
Dan Neely20-Mar-07 5:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.