473,230 Members | 1,786 Online

# How to generate random numbers in C

I need to generate two uniform random numbers between 0 and 1 in C ?
How to do it ?

I looked into rand function where you need to #define RAND_MAX as 1
but will this rand function give me uniformly distributed and unique
numbers ?
Apr 11 '08 #1
24 7137
On Apr 10, 9:54*pm, pereges <Brol...@gmail.comwrote:
I need to generate two uniform random numbers between 0 and 1 in C ?
How to do it ?
If you have modern hardware and IEEE floating point, I recommend
dsfmt:
http://www.math.sci.hiroshima-u.ac.j...FMT/index.html
otherwise WELL512a.c and WELL512a.h from here:
http://www.iro.umontreal.ca/~panneton/WELLRNG.html

Are another possibility.
I looked into rand function where you need to #define RAND_MAX as 1
but will this rand function give me *uniformly distributed and unique
numbers ?
That is a read-only value for you. It's not something that you set,
it is something that you inquire upon.
Apr 11 '08 #2
"pereges" writes:
>I need to generate two uniform random numbers between 0 and 1 in C ?
How to do it ?

I looked into rand function where you need to #define RAND_MAX as 1
but will this rand function give me uniformly distributed and unique
numbers ?
There is useful information in the FAQ starting at about 13.15

http://www.c-faq.com/lib/index.html

A set of numbers shouldn't be random AND unique. One of the important
properties of a random number generator is that numbers can be repeated. To
provide what I understand you to want, look into "shuffle" as described in
13.19
Apr 11 '08 #3
pereges <Br*****@gmail.comwrote:
>I looked into rand function where you need to #define RAND_MAX as 1
RAND_MAX tells you what the maximum random number is. It doesn't
let you control it.
>but will this rand function give me uniformly distributed and unique
numbers ?
>I need to generate two uniform random numbers between 0 and 1 in C ?
rand() returns an integer between 0 and RAND_MAX. It's intended
to be uniformly distributed (though the standard doesn't seem to
say so) so you can get uniformly distributed random floating-point
numbers by something like

((double)rand()) / RAND_MAX

If you really need *unique* random numbers you're going to have to
do something more complicated. Are you sure you really do?

-- Richard
--
:wq
Apr 11 '08 #4
what about drand48() function ? Is this included in C standard ?
Apr 11 '08 #5
pereges wrote:
what about drand48() function ? Is this included in C standard ?
Why not reading it yourself? At least the drafts are available at no charge,
the latest is to be found at
http://www.open-std.org/jtc1/sc22/wg...docs/n1256.pdf

But no, drand48 is not mentioned there. I believe it is POSIX.

Bye, Jojo
Apr 11 '08 #6
On Apr 10, 9:54 pm, pereges <Brol...@gmail.comwrote:
I need to generate two uniform random numbers between 0 and 1 in C ?
How to do it ?

I looked into rand function where you need to #define RAND_MAX as 1
but will this rand function give me uniformly distributed and unique
numbers ?
http://www.pobox.com/~qed/random.html

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/
Apr 11 '08 #7
>I need to generate two uniform random numbers between 0 and 1 in C ?

Computers do not generate truly random numbers without hardware support.
Some techniques include the detection of radioactive decay and thermal
noise from a reverse-biased diode. There is some belief that there
is randomness in the timing (say, down to picoseconds) of keystrokes,
although I don't think anyone has managed to tie human typing to quantum
effects yet. Some CPU chips have hardware for random number generation
on them.

You may want pseudo-random numbers. In cryptography, random numbers
are very important and the difference between pseudo-random numbers
and real random numbers used in encryption may get you killed as a
spy.

If you try to offer casino gambling games (e.g. craps, blackjack,
roulette, etc.) for real money using pseudo-random numbers, you're
going to lose.

rand() returns the same sequence of numbers each time the program
starts up unless you call srand() with a different seed value from
the last time. Seed values are commonly derived from the time and/or
process ID (but NOT in applications where real random numbers are needed,
like gambling or cryptography: 32 bits of randomness isn't enough, and
a poor seed can cripple a good random number generator).
>How to do it ?
There are better pseudo-random number generators than rand().
These have the disadvantage that they are not included in all C
libraries.
>I looked into rand function where you need to #define RAND_MAX as 1
You do not get to redefine RAND_MAX. Also, the return type of rand()
is int, so don't expect any values where 0 < rand() < 1 . If RAND_MAX
were 1 (not allowed by the standard) all you would get is 0 and 1.
>but will this rand function give me uniformly distributed and unique
numbers ?
Consider using algebra. rand() returns [0, RAND_MAX]. You want
numbers between 0.0 and 1.0 including both endpoints. Or is that just
including 0.0 but not 1.0? Consider what these might give you:

((double)rand())/RAND_MAX
or
((double)rand())/(RAND_MAX+1)

Apr 11 '08 #8
"pereges" <Br*****@gmail.comwrote in message news:
>I need to generate two uniform random numbers between 0 and 1 in C ?
How to do it ?

I looked into rand function where you need to #define RAND_MAX as 1
but will this rand function give me uniformly distributed and unique
numbers ?
No, defining RAND_MAX as something else won't help. All it will do is make
the identifier useless in the rest of your program, without touching the
random number generator. Strictly it is UB in case RAND_MAX appears in some
standard library macro or other.

This is the generally accpeted way to do it
#define uniform() (rand() / (RAND_MAX + 1.0))
#define rnd(x) ( (x) * uniform() )

we add 1.0 to make rand() never return exactly unity, so rnd() is always in
the range 0 to x-1.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
Jun 27 '08 #9

user923005 <dc*****@connx.comwrote in message
On Apr 11, 12:20 pm, gordonb.k5...@burditt.org (Gordon Burditt) wrote:
If you try to offer casino gambling games (e.g. craps, blackjack,
roulette, etc.) for real money using pseudo-random numbers, you're
going to lose.
There is no mathematical basis for this general statement, however,
there have been cases where people caught on to the sequence coming
from a poorly- or non-reseeded pseudo-random number generator
in a casino game and won hundreds of \$thousands before the
casino realized their error...
The most important factor in gambling is the size of the house.
There is also no mathematical basis for THIS statement...you
guys are batting .000 again...
In a fair game, the player with the biggest house money volume wins.
Oh, a "fair game"...who the hell offers a "fair game"? In any event,
it's irrelevant, because the actual most important factor (to the extent
that we indulge in the pointless semantics of pronouncing a "most
important factor") is the "expectation" of the game.
Assuming a Markov process (random walk) the players will get ahead and
behind in a random, wobbling fashion. But as soon as the cash for one
player is gone, the game is over. If you have one hundred dollars and
the opponent has one trillion dollars, you are in a lot of trouble.
If you have a casino, and are stupidly offering a "fair game"
(0% "expectation"), you will eventually lose all your \$trillion
to salaries and other expenses no matter how many individual
players come in and lose \$100, because the money you win
from them will be offset by players who "get lucky" and win
\$100, \$200, \$3000, or more...

You would be correct if you asserted that there is relationship
as a fraction of that "bankroll" in terms of actually acheiving
a result of "bankroll" growth (or non-loss) that conforms to
your "expectation" for the game. But that's a slightly more
complicated concept, innit?
That's why I call gambling "A tax on stupidity."
Stupidity is kind of its own tax, innit?

---
William Ernest Reid

Jun 27 '08 #10
"Malcolm McLean" <re*******@btinternet.comwrites:
"pereges" <Br*****@gmail.comwrote in message news:
>>I need to generate two uniform random numbers between 0 and 1 in C ?
How to do it ?

I looked into rand function where you need to #define RAND_MAX as 1
but will this rand function give me uniformly distributed and unique
numbers ?
No, defining RAND_MAX as something else won't help. All it will do is
make the identifier useless in the rest of your program, without
touching the random number generator. Strictly it is UB in case
RAND_MAX appears in some standard library macro or other.

This is the generally accpeted way to do it
#define uniform() (rand() / (RAND_MAX + 1.0))
#define rnd(x) ( (x) * uniform() )

we add 1.0 to make rand() never return exactly unity, so rnd() is
always in the range 0 to x-1.
rnd(m) can be much closer to m than m-1. Did you mean:

#define rnd(x) ((int)((x) * uniform()))

perhaps? The OP wanted numbers between 0 and 1 so your uniform() is
sufficient if they mean doubles in [0,1).

--
Ben.
Jun 27 '08 #11
If you try to offer casino gambling games (e.g. craps, blackjack,
roulette, etc.) for real money using pseudo-random numbers, you're
going to lose.

There is no mathematical basis for this general statement, however,
there have been cases where people caught on to the sequence coming
from a poorly- or non-reseeded pseudo-random number generator
in a casino game and won hundreds of \$thousands before the
casino realized their error...
My statement is more based on economics and psychology than
mathematics. If there's enough to gain, people will go to great
lengths to break your scheme, including stealing a machine (or
BUYING one) and taking it apart, bribing employees or ex-employees
to get source code and procedures, dedicating huge amounts of donated
CPU time under the guise of searching for aliens or a cure for
cancer, etc.

A really clever crack will not take so much in winnings that the
casino realizes it immediately, but will take less but over a longer
period of time.

Jun 27 '08 #12

"Ben Bacarisse" <be********@bsb.me.ukwrote in message
news:87************@bsb.me.uk...
"Malcolm McLean" <re*******@btinternet.comwrites:
>"pereges" <Br*****@gmail.comwrote in message news:
>>>I need to generate two uniform random numbers between 0 and 1 in C ?
How to do it ?

I looked into rand function where you need to #define RAND_MAX as 1
but will this rand function give me uniformly distributed and unique
numbers ?
No, defining RAND_MAX as something else won't help. All it will do is
make the identifier useless in the rest of your program, without
touching the random number generator. Strictly it is UB in case
RAND_MAX appears in some standard library macro or other.

This is the generally accpeted way to do it
#define uniform() (rand() / (RAND_MAX + 1.0))
#define rnd(x) ( (x) * uniform() )

we add 1.0 to make rand() never return exactly unity, so rnd() is
always in the range 0 to x-1.

rnd(m) can be much closer to m than m-1. Did you mean:

#define rnd(x) ((int)((x) * uniform()))

perhaps? The OP wanted numbers between 0 and 1 so your uniform() is
sufficient if they mean doubles in [0,1).
That would be fine if int was 64 bits :-(

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Jun 27 '08 #13
In article <IA********************@bgtnsc04-news.ops.worldnet.att.net>,
Bill Reid <ho********@happyhealthy.netwrote:
>In a fair game, the player with the biggest house money volume wins.
>Oh, a "fair game"...who the hell offers a "fair game"? In any event,
it's irrelevant, because the actual most important factor (to the extent
that we indulge in the pointless semantics of pronouncing a "most
important factor") is the "expectation" of the game.
Actually, you can reliably win against poor odds if you have unlimited
how much you want to win. Bet enough to make that if you win. If you
do, quit. If you don't, bet enough to win back your losses plus your
desired win. If you can continue making bets in this manner, you will
eventually win, no matter how poor the odds.

In practice, you can't do this, because your resources are limited
compared to the Casino's. If they weren't, they would eventually

-- Richard
--
:wq
Jun 27 '08 #14

Gordon Burditt <go***********@burditt.orgwrote in message
news:T7ydnSMQJKBSnJzVnZ2dnUVZ_sytnZ2d@internetamer ica...
If you try to offer casino gambling games (e.g. craps, blackjack,
roulette, etc.) for real money using pseudo-random numbers, you're
going to lose.
There is no mathematical basis for this general statement, however,
there have been cases where people caught on to the sequence coming
from a poorly- or non-reseeded pseudo-random number generator
in a casino game and won hundreds of \$thousands before the
casino realized their error...

My statement is more based on economics and psychology than
mathematics. If there's enough to gain, people will go to great
There's a limit to greed; just because somebody offers \$1trillion
to run a mile in one second doesn't mean anybody is ever going
to be able to do it, no matter how motivated they are and how
hard they try.
including stealing a machine (or
BUYING one) and taking it apart, bribing employees or ex-employees
to get source code and procedures, dedicating huge amounts of donated
CPU time under the guise of searching for aliens or a cure for
cancer, etc.
Sure, this all happens now, and has always happened. Back
when I used to consult for the electronic slot machine and lottery
equipment makers, a popular method of getting money from the
machines was to zap them with about a zillion volts, hopefully
sometimes causing the CPU to fritz out and activate the hopper
dump solenoid and dump the coins in the hopper into the "loud bowl".
Then they'd scoop up as many as they could and try to hit the
doors before security locked them (they were in most cases
already detected and being tracked by security cameras
the moment the coins dropped).

A slightly more sophisticated method involved an operation
using a small drill and a procedure not unlike othroscopic
surgery to trigger a hopper dump; in any event, they still
couldn't fake the internal sequence of microprocessor events
that had to occur and were always recorded that were evidence
of a genuine jackpot, along with those omnipresent security
cameras...

Guys who REALLY knew the machines could even have
a whole set of fake EEPROMs ready to install in seconds
after they jimmied open the door; but seriously, wouldn't
it just be easier to get a friggin' job?
A really clever crack will not take so much in winnings that the
casino realizes it immediately, but will take less but over a longer
period of time.
Oh, they'll figure it out eventually, but the problem will still
be to predict a series of pseudo-random numbers seeded from
some split-second event at pseudo-random times...this would
be tough enough under the best of circumstances, and in
a casino environment, purt near impossible, even WITH
"inside information"...

---
William Ernest Reid

Jun 27 '08 #15
In article <Hh*********************@bgtnsc04-news.ops.worldnet.att.net>,
Bill Reid <ho********@happyhealthy.netwrote:
>And no, not even with "unlimited resources", because "unlimited
resources" mean infinity bets and thus, INFINITY LOSSES,
I suggest you learn some mathematics before you rant in future.
All the bets involved are finite.

-- Richard
--
:wq
Jun 27 '08 #16
On Apr 11, 12:20*pm, gordonb.k5...@burditt.org (Gordon Burditt) wrote:
I need to generate two uniform random numbers between 0 and 1 in C ?

Computers do not generate truly random numbers without hardware support.
Some techniques include the detection of radioactive decay and thermal
noise from a reverse-biased diode. *There is some belief that there
is randomness in the timing (say, down to picoseconds) of keystrokes,
although I don't think anyone has managed to tie human typing to quantum
effects yet. *Some CPU chips have hardware for random number generation
on them.

You may want pseudo-random numbers. *In cryptography, random numbers
are very important and the difference between pseudo-random numbers
and real random numbers used in encryption may get you killed as a
spy.

If you try to offer casino gambling games (e.g. craps, blackjack,
roulette, etc.) for real money using pseudo-random numbers, you're
going to lose.

rand() returns the same sequence of numbers each time the program
starts up unless you call srand() with a different seed value from
the last time. *Seed values are commonly derived from the time and/or
process ID (but NOT in applications where real random numbers are needed,
like gambling or cryptography: *32 bits of randomness isn't enough, and
a poor seed can cripple a good random number generator).
How to do it ?

There are better pseudo-random number generators than rand().
These have the disadvantage that they are not included in all C
libraries.
I looked into rand function where you need to #define RAND_MAX as 1

You do not get to redefine RAND_MAX. *Also, the return type of rand()
is int, so don't expect any values where 0 < rand() < 1 . *If RAND_MAX
were 1 (not allowed by the standard) all you would get is 0 and 1.
but will this rand function give me *uniformly distributed and unique
numbers ?

Consider using algebra. *rand() returns [0, RAND_MAX]. *You want
numbers between 0.0 and 1.0 including both endpoints. *Or is that just
including 0.0 but not 1.0? *Consider what these might give you:

* * * * ((double)rand())/RAND_MAX
or
* * * * ((double)rand())/(RAND_MAX+1)
What' the difference between random numbers and pseudo-random numbers?
Jun 27 '08 #17

Richard Tobin <ri*****@cogsci.ed.ac.ukwrote in message
news:ft***********@pc-news.cogsci.ed.ac.uk...
In article <Hh*********************@bgtnsc04-news.ops.worldnet.att.net>,
Bill Reid <ho********@happyhealthy.netwrote:
And no, not even with "unlimited resources", because "unlimited
resources" mean infinity bets and thus, INFINITY LOSSES,

I suggest you learn some mathematics before you rant in future.
"The ironing is delicious" - Bart Simpson
All the bets involved are finite.
Which, according to you, require "unlimited resources"...we
can put Las Vegas out of business, as long as we make a "finite"
series of bets with an infinite amount of money...you're a genius!!!

But it's like I've said before...you guys have GOT to stick to
the return value of main() because everything else on planet
Earth is just too complicated for you...

---
William Ernest Reid

Jun 27 '08 #18

<snip>
What' the difference between random numbers and pseudo-random numbers?
psueudo-random numbers are numbers that look random (for some definition
of look random) but are really following some sequence (and this, by the
definition of C, includes all implementations of rand()) where as random
numbers really are random.

random numbers.
--
Flash Gordon
Jun 27 '08 #19
In article <66**************@mid.individual.net>
Ian Collins <ia******@hotmail.comwrote:
>Why would you attempt to redefine RAND_MAX? ...
Not everyone starts out with the right mental model of RAND_MAX.

It may help to think of RAND_MAX as if it were a highway sign,
telling you how far away the next town or exit is. If you stop
your car, walk up to the sign, paint out the original number, and
then paint in a "1", will the next town or exit move to just 1 mile
(or 1 kilometer) away? :-)
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: gmail (figure it out) http://web.torek.net/torek/index.html
Jun 27 '08 #20
Flash Gordon wrote:

<snip>
>What' the difference between random numbers and pseudo-random
numbers?

psueudo-random numbers are numbers that look random (for some
definition of look random) but are really following some sequence (and
this, by the definition of C, includes all implementations of rand())
where as random numbers really are random.
I don't think that it can proven that real random sequences exist.
pseudo random numbers.
Jun 27 '08 #21
santosh wrote, On 26/04/08 13:11:
Flash Gordon wrote:

<snip>
>>What' the difference between random numbers and pseudo-random
numbers?
psueudo-random numbers are numbers that look random (for some
definition of look random) but are really following some sequence (and
this, by the definition of C, includes all implementations of rand())
where as random numbers really are random.

I don't think that it can proven that real random sequences exist.
I think that in Physics they have some pretty good evidence for them,
although the theories might be proven wrong later of course. This is
relevant as some real hardware actually uses some of the principals of
current physics to generate random numbers.
--
Flash Gordon
Jun 27 '08 #22
Flash Gordon wrote:
santosh wrote, On 26/04/08 13:11:
>Flash Gordon wrote:

<snip>

What' the difference between random numbers and pseudo-random
numbers?
psueudo-random numbers are numbers that look random (for some
definition of look random) but are really following some sequence
(and this, by the definition of C, includes all implementations of
rand()) where as random numbers really are random.

I don't think that it can proven that real random sequences exist.

I think that in Physics they have some pretty good evidence for them,
although the theories might be proven wrong later of course. This is
relevant as some real hardware actually uses some of the principals of
current physics to generate random numbers.
Possible, though I would've thought that presented with a sequence
that's apparently random you cannot conclude that it *is* random since
reading more of the sequence might reveal a pattern or organisation.
And for a sequence of fixed length to say definitively that it's random
would be to close the door to a possibility that future mathematics
could find an organisation not apparent now.

Anyway this is OT and I should take the advice I gave to AT. I'll stop
here. Doubtless this has been beaten to death in sci.math. Interested
lurkers might wish to go there.

Jun 27 '08 #23
santosh <sa*********@gmail.comwrites:
Flash Gordon wrote:
>santosh wrote, On 26/04/08 13:11:
>>Flash Gordon wrote:

<snip>

What' the difference between random numbers and pseudo-random
numbers?
psueudo-random numbers are numbers that look random (for some
definition of look random) but are really following some sequence
(and this, by the definition of C, includes all implementations of
rand()) where as random numbers really are random.

I don't think that it can proven that real random sequences exist.

I think that in Physics they have some pretty good evidence for them,
although the theories might be proven wrong later of course. This is
relevant as some real hardware actually uses some of the principals of
current physics to generate random numbers.

Possible, though I would've thought that presented with a sequence
that's apparently random you cannot conclude that it *is* random since
Of course you can not. There is not such thing as "defined randomness"
where you can prove a sequence is random. In the real world that is. For
all you know if you measure a sequence then that sequence might well
have been repeated had the sampling gone on. In other words its all hot
air.
reading more of the sequence might reveal a pattern or organisation.
Yes.
And for a sequence of fixed length to say definitively that it's random
would be to close the door to a possibility that future mathematics
could find an organisation not apparent now.

Anyway this is OT and I should take the advice I gave to AT. I'll stop
here. Doubtless this has been beaten to death in sci.math. Interested
lurkers might wish to go there.
Stop being such a big baby - this is a thread. People who dont like it
can kill it or ignore it. Not every one wants to discuss such things
with math egg heads who will probably roll their eyes and humiliate the
C programmer who wants a far lower understanding.

Jun 27 '08 #24

santosh <sa*********@gmail.comwrote in message
news:fu**********@registered.motzarella.org...
Flash Gordon wrote:
santosh wrote, On 26/04/08 13:11:
Flash Gordon wrote:

<snip>

What' the difference between random numbers and pseudo-random
numbers?
psueudo-random numbers are numbers that look random (for some
definition of look random) but are really following some sequence
(and this, by the definition of C, includes all implementations of
rand()) where as random numbers really are random.

I don't think that it can proven that real random sequences exist.
I think that in Physics they have some pretty good evidence for them,
although the theories might be proven wrong later of course. This is
relevant as some real hardware actually uses some of the principals of
current physics to generate random numbers.

Possible, though I would've thought that presented with a sequence
that's apparently random you cannot conclude that it *is* random since
reading more of the sequence might reveal a pattern or organisation.
And for a sequence of fixed length to say definitively that it's random
would be to close the door to a possibility that future mathematics
could find an organisation not apparent now.
I don't think you have to look at quantum effects in physics to
find something that for all intents and purposes is truly "random".
Consider, if you will, a drunk at a craps table...you can't be sure
he won't fling the cubes right off the table, drop them right in front
of himself, or actually make a legal throw to the back of the table,
hitting those little bumps that send them spinning unpredictably
to their final resting place...

And yet, with a sufficiently high-speed camera(s) to record
the approach of the dice to the wall, a super-fast super-computer
dedicated to calculate the trajectories of the dice based on the
inputs from the camera(s) and a model of the countours of the
table, could you "predict" in a split-second the result of the dice
throw AFTER the dice were thrown? Be aware that just such
a (sometimes human) system was developed to predict the
quandrant where the ball would land in roulette ("wheel clocking"),
resulting in tremendous profit for the players of the "system"...

And also, some people allegedly can or at least try to "set the
dice": hold them in a pre-determined position, and throw them in
such a way that they can somewhat predict the result. This is
so potentially profitable it is totally illegal in all casinos; if they
catch you holding the dice and throwing them in a certain way,
you will be asked to change your behavior, leave, or be arrested...

In those cases, an apparently random system becomes "non-random"
"randomizing"
process. In cases where the result was predicted by high-speed
analysis of the process, the tests that the math wonks apply to
determine randomness would still apply; of course, when the process
is "controlled", the tests will show the process is no longer "random",
at least from that perspective...

So it's always actually a matter of how you look at it, how much you
know about the process, how deftly you can analyze and/or control
the process, that is the final test of whether something is truly "random",
as in "unpredictable". History shows many examples of "unpredictable"
series of events becoming "predictable" as greater knowledge of the
underlying process and/or better analytical capabilities were developed,
and perhaps this will be the case someday for "quantum physics" as
well (Einstein: "God does not play dice with the universe").

But right now, predicting what a drunk in Vegas is going to roll BEFORE
he rolls it can be pretty safely called "impossible"...

---
William Ernest Reid

Jun 27 '08 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

### Similar topics

 2 by: Laphan | last post by: Hi All This is a strange request, but I just cannot fathom how to do it. In theory the requirement is very basic, but in practise its a noodle!! I have 10 team names like so: Team A Team... 14 by: Anthony Liu | last post by: I am at my wit's end. I want to generate a certain number of random numbers. This is easy, I can repeatedly do uniform(0, 1) for example. But, I want the random numbers just generated sum up... 12 by: Jim Michaels | last post by: I need to generate 2 random numbers in rapid sequence from either PHP or mysql. I have not been able to do either. I get the same number back several times from PHP's mt_rand() and from mysql's... 9 by: MyInfoStation | last post by: Hi all, I am a newbie to Python and would like to genereate some numbers according to geometric distribution. However, the Python Random package seems do not have implemented functionality. I am... 6 by: Anamika | last post by: I am doing a project where I want to generate random numbers for say n people.... These numbers should be unique for n people. Two people should not have same numbers.... Also the numbers... 20 by: jjmillertime | last post by: I'm new so i apologize if this is in the wrong spot. I'm also new to programming in C and i've been searching for quite a while on how to create a program using C that will generate two random... 9 by: Chelong | last post by: Hi All I am using the srand function generate random numbers.Here is the problem. for example: #include #include int main() { 19 by: Sanchit | last post by: I want to generate a randowm number between two numbers x and y i.e int randomNoBetween(int x, int y); Plz help Is there any such function?? 0 by: VivesProcSPL | last post by: Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for... 3 by: isladogs | last post by: The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In... 0 by: jianzs | last post by: Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from... 0 by: abbasky | last post by: ### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method... 2 by: isladogs | last post by: The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE... 0 by: egorbl4 | last post by: Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ... 1 by: davi5007 | last post by: Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the... 0 by: MeoLessi9 | last post by: I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines".... 0 by: Aftab Ahmad | last post by: Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...