how can i write C code that generate random number without using built in code

Discussion in 'C Programming' started by Sweety, Apr 4, 2004.

  1. Sweety

    Sweety Guest

    plz reply,
    thanks in advance.
    bye
     
    Sweety, Apr 4, 2004
    #1
    1. Advertisements

  2. Sweety

    Tom St Denis Guest

    Sweety wrote:

    > plz reply,
    > thanks in advance.
    > bye


    HOMEWORK QUESTION
     
    Tom St Denis, Apr 4, 2004
    #2
    1. Advertisements

  3. Re: how can i write C code that generate random number without usingbuilt in code

    Sweety wrote:
    > plz reply,
    > thanks in advance.
    > bye

    You cannot generate truly random numbers (without an external device) in
    the mathematical sense of the word. You can only generate pseudorandom
    numbers. For the discussion, google the topics "alternative rand()", etc.

    My favourie, although very slow method for generating a sequence of
    pseudorandoms in the interval [0,1] is

    next_number := after_comma_part_of ((Pi+previous_number)^5)


    --
    Best regards,
    Alex.

    PS. To email me, remove "loeschedies" from the email address given.
     
    Alexander Malkis, Apr 4, 2004
    #3
  4. Em Sun, 04 Apr 2004 20:03:48 +0000, Tom St Denis escreveu:

    > Sweety wrote:
    >
    >> plz reply,
    >> thanks in advance.
    >> bye

    >
    > HOMEWORK QUESTION


    What question? I don't see any question.

    --
    Quidquid latine dictum sit altum viditur
     
    =?iso-8859-1?q?Jos=E9_de_Paula?=, Apr 4, 2004
    #4
  5. Richard Heathfield, Apr 4, 2004
    #5
  6. Sweety

    Ben Pfaff Guest

    Re: how can i write C code that generate random number withoutusing built in code

    http://benpfaff.org/writings/clc
    --
    "The way I see it, an intelligent person who disagrees with me is
    probably the most important person I'll interact with on any given
    day."
    --Billy Chambless
     
    Ben Pfaff, Apr 4, 2004
    #6
  7. Sweety

    CBFalconer Guest

    Re: how can i write C code that generate random number without usingbuilt in code

    Sweety wrote:
    >
    > plz reply,


    Oh very well.

    --
    A: Because it fouls the order in which people normally read text.
    Q: Why is top-posting such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    CBFalconer, Apr 5, 2004
    #7
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    24
    Views:
    9,905
    Malcolm
    Oct 18, 2004
  2. RayKnight

    Generate a random number

    RayKnight, Apr 29, 2005, in forum: Java
    Replies:
    2
    Views:
    481
    Peter MacMillan
    Apr 29, 2005
  3. Acacia

    Generate a random number

    Acacia, Aug 25, 2003, in forum: C++
    Replies:
    6
    Views:
    764
    Kevin Goodsell
    Aug 26, 2003
  4. globalrev
    Replies:
    4
    Views:
    1,080
    Gabriel Genellina
    Apr 20, 2008
  5. anoop
    Replies:
    1
    Views:
    426
    Gregory A. Beamer
    Sep 22, 2009
  6. Peng Yu
    Replies:
    23
    Views:
    868
    Ted Zlatanov
    Jun 29, 2010
  7. VK
    Replies:
    15
    Views:
    1,920
    Dr J R Stockton
    May 2, 2010
  8. Kenz09
    Replies:
    3
    Views:
    191
    Dave Angel
    Jul 8, 2013
Loading...