Search:

Type: Posts; User: usb

Search: Search took 0.00 seconds.

  1. >>for a match of 3 numbers in 6, so the user...

    >>for a match of 3 numbers in 6, so the user should still enter a ticket of 6 numbers
    That is what I was missing. I was not making the other 3 possible numbers available to be checked for a match. I...
  2. match probability is correct for a full match but not for a partial match

    I created a C program that provides stats on random number (lotto) matches. The calculated probability of a full match equals the programs average output for a full match, but a partial match, like...
  3. Replies
    11
    Views
    3,928

    I used mod to generate the numbers from a...

    I used mod to generate the numbers from a specific max as when I used rand(). It works, however one of the comments posted seemed to state that using mod is not the best way.

    In both rand() and...
  4. Replies
    11
    Views
    3,928

    I found and downloaded this random number...

    I found and downloaded this random number generator: mt19937int.c

    This is a step beyond my scope.

    I deleted main and renamed the file to random.h
    In my program I entered: #include...
  5. Replies
    11
    Views
    3,928

    To jim mcnamara and Brian: At the start of the...

    To jim mcnamara and Brian:
    At the start of the code I run srand((unsigned)time(NULL)); once. It never runs again.

    To Thantos:
    I am using mod. This is the function:


    int roll (int max) {
    ...
  6. Replies
    11
    Views
    3,928

    rand() is producing patterns

    I created a lottery-type program that you pick 6 numbers from a given range.

    The program randomly selects 6 numbers from the same range and determines how many tries it takes to choose 6 numbers...
Results 1 to 6 of 6