I am having probability difficulties...HELP 
Author Message
 I am having probability difficulties...HELP

How can I simulate customer arrivals, in say a restaurant, using
a Negative Exponential Distribution (NED) in C?

Your help would be appreciated, greatly.



Fri, 16 Aug 1996 02:10:00 GMT  
 I am having probability difficulties...HELP


Quote:
>How can I simulate customer arrivals, in say a restaurant, using
>a Negative Exponential Distribution (NED) in C?

I'll just give some hints, since this looks like a homework problem.  

If the probability of a customer arriving in a given period is
constant, then it is fairly easy to show that the probability that a
customer will arrive after t is

   P(t) = (1/T) exp (-t/T)

where T is the mean time before a customer arrives.  Thus, in a
simulation, one selects a deviate from this distribution to represent
the time between a given point (say opening time or the arrival of the
previous customer) and the next customer.

To select a deviate t, make the change of variables

   t = -T log (Tu)

so that

   P(u) = u

Clearly, u is a uniform deviate on (0,1] -- err, I've just had a blank
on the notation, but I mean to exclude 0 and include 1.  You can
generate uniform deviates using rand() and RAND_MAX in <stdlib.h>, but
be careful to generate them on (0,1] and not [0,1), and then use log()
in <math.h> to generate a value of t.



Fri, 16 Aug 1996 14:13:23 GMT  
 I am having probability difficulties...HELP

: How can I simulate customer arrivals, in say a restaurant, using
: a Negative Exponential Distribution (NED) in C?

: Your help would be appreciated, greatly.

        Instructors are getting more and more creative every 6 monnths.

-----------------------------------------------------------------------

                Student programmers have (*NULL) free time...
-----------------------------------------------------------------------



Fri, 16 Aug 1996 16:14:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. I am having probability d

2. HELP, I am having problems with pointer...

3. Having difficulty creating a function that returns an array of structures

4. i am unable to read from a file having 26ascii character(ctrl+z)

5. I am having with my bishop

6. I am having troubles with the switch()

7. I am having problems setting up that a specified dialog is displayed before any others

8. I am having problems with MFC42.dll file

9. Having problems converting help files to html help.

10. Fitting a Probability Distribution to Random Data

11. probability density function programming problem

12. Fitting a Probability Distribution to Random Data

 

 
Powered by phpBB® Forum Software