Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/30/03 07:52
Read: times


 
#61556 - RE: Random number from 1 to 8
Responding to: ???'s previous message
Mahmood:

I think you have the correct view point about the "randomness" factor. It only really has to be "good enough". I do think as Kai pointed out that the bursts of 3 in a row could be problematic. I messed around with Keil C51 using the debugger in the simulator and created the following small program:
#include <stdlib.h>

unsigned char xdata array[300];

void main(void)
{
    int r;
    unsigned char rr;
    int i;

    for(i=0; i<300; i++)
    {
        r = rand();
        rr = ((r / 7) % 8) + 1;
        array[i] = rr;
    }
    while(1)
    {
    }
}


I then exported the data out of the µVision2 Watch Window for the array[] variable into Excel and created a chart similar to yours as shown below:



Is this more "random"? Good question.
Does it have a "pattern"? Maybe.
Is it "good enough"? I think so!!

Michael Karas



List of 39 messages in thread
TopicAuthorDate
Random number from 1 to 8            01/01/70 00:00      
   P.S            01/01/70 00:00      
   RE: Random number from 1 to 8            01/01/70 00:00      
      RE: Random number from 1 to 8            01/01/70 00:00      
         RE: Random number from 1 to 8            01/01/70 00:00      
            RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
                  RE: Random number from 1 to 8            01/01/70 00:00      
         RE: Random number from 1 to 8            01/01/70 00:00      
            RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
            RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
   RE: Random number from 1 to 8            01/01/70 00:00      
      RE: Random number from 1 to 8            01/01/70 00:00      
         RE: Random number from 1 to 8            01/01/70 00:00      
            RE: Random number from 1 to 8            01/01/70 00:00      
            RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
                  RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
                  RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
                  RE: Random number from 1 to 8            01/01/70 00:00      
                     RE: Random number from 1 to 8            01/01/70 00:00      
                  RE: Random number from 1 to 8            01/01/70 00:00      
   Prime polynomials over GFn            01/01/70 00:00      
   ways to get the pseudo out            01/01/70 00:00      
      RE: ways to get the pseudo out            01/01/70 00:00      
         RE: ways to get the pseudo out            01/01/70 00:00      
            RE: ways to get the pseudo out            01/01/70 00:00      
               RE: ways to get the pseudo out            01/01/70 00:00      
                  RE: ways to get the pseudo out            01/01/70 00:00      
                     RE: ways to get the pseudo out            01/01/70 00:00      
                        RE: ways to get the pseudo out            01/01/70 00:00      
                           RE: ways to get the pseudo out            01/01/70 00:00      
   RE: Random number from 1 to 8            01/01/70 00:00      

Back to Subject List