Hi every body,

I want to genrate random variables wich are exponentially distributed.

I can't do this.

please some help

Printable View

- 01-07-2013momniarandom variable with exponential distribution
Hi every body,

I want to genrate random variables wich are exponentially distributed.

I can't do this.

please some help - 01-07-2013grumpy
Read the section entitled "Generating exponential variates" at this link. That will give you a place to start.

- 01-07-2013c99tutorial
This function is not build into the standard library. The idea of C is to be as small as possible and to provide most other things with library functions.

Two libraries that have this function are:

GSL (C library):

GSL - GNU Scientific Library - GNU Project - Free Software Foundation (FSF)

newran02 and newran03 (C++ library)

Online documentation

The second one is a C++ library. If you want to call it from C, you might also need this information:

How to call C++ function from C? - Stack Overflow - 01-07-2013shansajid
- 01-07-2013Salem
> I can't do this.

> please some help

What exactly are you complaining about?

> Hey why u r confusing by these toughest equations...

You misunderstand the nature of this board.

You post code, we help you with it.

If you just post your program spec and "I can't do it / please help me", then don't expect code to be handed to you on a plate.

At best (which is what grumpy's post is), all you're going to get is references to further reading material to help you figure it out for yourself.

Now, explain what you're really having trouble with.

Like for example, you can generate random numbers, but not with the distribution, or the distribution is "off" in some way.