Commonly Used Distributions • Random Number Generation Algorithms for Distributions Commonly Used by Computer Systems Performance Analysts

Commonly Used Distributions • Random Number Generation Algorithms for Distributions Commonly Used by Computer Systems Performance Analysts

Commonly Used Distributions ² Random number generation algorithms for distributions commonly used by computer systems performance analysts. ² Organized alphabetically for reference ² For each distribution: { Key characteristics { Algorithm for random number generation { Examples of applications °c 1994 Raj Jain 29.1 Bernoulli Distribution ² Takes only two values: failure and success or x = 0 and x = 1, respectively. ² Key Characteristics: 1. Parameters: p = Probability of success (x = 1) 0 · p · 1 2. Range: x = 0; 1 8 > > > 1 ¡ p; if x = 0 > <> 3. pmf: f(x) = > p; if x = 1 > > > :> 0; Otherwise 4. Mean: p 5. Variance: p(1 ¡ p) °c 1994 Raj Jain 29.2 ² Applications: To model the probability of an outcome having a desired class or characteristic: 1. A computer system is up or down. 2. A packet in a computer network reaches or does not reach the destination. 3. A bit in the packet is a®ected by noise and arrives in error. ² Can be used only if the trials are independent and identical ² Generation: Inverse transformation Generate u » U(0; 1) If u · p return 0. Otherwise, return 1. °c 1994 Raj Jain 29.3 Beta Distribution ² Used to represent random variates that are bounded ² Key Characteristics: 1. Parameters: a; b = Shape parameters, a > 0, b > 0 2. Range: 0 · x · 1 xa¡1(1¡x)b¡1 3. pdf: f(x) = ¯(a;b) ¯(:) is the beta function and is related to the gamma function as follows: Z 1 a¡1 b¡1 ¯(a; b) = 0 x (1 ¡ x) dx ¡(a)¡(b) = ¡(a + b) 4. Mean: a=(a + b) 5. Variance: ab=f(a + b)2(a + b + 1)g ² Substitute (x ¡ xmin)=(xmax ¡ xmin) in place of x for other ranges °c 1994 Raj Jain 29.4 ² Applications: To model random proportions 1. Fraction of packets requiring retransmissions. 2. Fraction of remote procedure calls (RPC) taking more than a speci¯ed time. ² Generation: 1. Generate two gamma variates γ(1; a) and γ(1; b), and take the ratio: γ(1; a) BT (a; b) = γ(1; a) + γ(1; b) 2. If a and b are integers: (a) Generate a + b + 1 uniform U(0,1) random numbers. (b) Return the the ath smallest number as BT(a; b). °c 1994 Raj Jain 29.5 3. If a and b are less than one: (a) Generate two uniform U(0,1) random numbers u1 and u2 1=a 1=b (b) Let x = u1 and y = u2 . If (x + y) > 1, go back to the previous step. Otherwise, return x=(x + y) as BT(a; b). 4. If a and b are greater than 1: Use rejection °c 1994 Raj Jain 29.6 Binomial Distribution ² The number of successes x in a sequence of n Bernoulli trials has a binomial distribution. ² Characteristics: 1. Parameters: p = Probability of success in a trial, 0 < p < 1. n = Number of trials; n must be a positive integer. 2. Range: x = 0; 1; : : : ; n 0 1 B C B n C B C x n¡x 3. pdf: f(x) = B C p (1 ¡ p) @ x A 4. Mean: np 5. Variance: np(1 ¡ p) °c 1994 Raj Jain 29.7 ² Applications: To model the number of successes 1. The number of processors that are up in a multiprocessor system. 2. The number of packets that reach the destination without loss. 3. The number of bits in a packet that are not a®ected by noise. 4. The number of items in a batch that have certain characteristics. ² Variance < Mean ) Binomial Variance > Mean ) Negative Binomial Variance = Mean ) Poisson ² Generation: 1. Composition: Generate n U(0,1). The number of RNs that are less than p is BN(p; n) °c 1994 Raj Jain 29.8 2. For small p: (a) Generate geometric random numbers ln(ui) Gi(p) = dln(1¡p)e. (b) If the sum of geometric RNs so far is less than or equal to n, go back to the previous step. Otherwise, return the number of RNs generated minus one. Pm If i=1 Gi(p) > n, return m ¡ 1. 3. Inverse Transformation Method: Compute the CDF F(x) for x = 0; 1; 2;:::, n and store in an array. For each binomial variate, generate a U(0,1) variate u and search the array to ¯nd x so that F (x) · u < F (x + 1); return x. °c 1994 Raj Jain 29.9 Chi-Square Distribution ² Sum of squares of several unit normal variates ² Key Characteristics: 1. Parameters: º=degrees of freedom, º must be a positive integer. 2. Range: 0 · x · 1 (º¡2)=2 ¡x=2 3. pdf: f(x) = x e 2º=2¡(º=2) Here, ¡(:) is the gamma function de¯ned as follows: Z 1 ¡x b¡1 ¡(b) = 0 e x dx 4. Mean: º 5. Variance: 2º °c 1994 Raj Jain 29.10 ² Application: To model sample variances. ² Generation: 1. Â2(º) = γ(2; º=2): For º even: 0 1 2 1 BQº=2 C  (º) = ¡2 ln @ i=1 uiA For º odd: Â2(º) = Â2(º ¡ 1) + [N(0; 1)]2 2. Generate º N(0,1) variates and return the sum of their squares. °c 1994 Raj Jain 29.11 Erlang Distribution ² Used in queueing models ² Key characteristics: 1. Parameters: a = Scale parameter, a > 0 m = Shape parameter; m is a positive integer 2. Range: 0 · x · 1 xm¡1e¡x=a 3. pdf: f(x) = (m¡1)!am 2 i 3 6P 7 ¡x=a 6 m¡1 (x=a) 7 4. CDF: F (x) = 1 ¡ e 4 i=0 i! 5 5. Mean: am 6. Variance: a2m °c 1994 Raj Jain 29.12 ² Application: Extension to the exponential distribution if the coe±cient of variation is less than one 1. To model service times in a queueing network model. 2. A server with Erlang(a; m) service times can be represented as a series of m servers with exponentially distributed service times. 3. To model time-to-repair and time-between-failures. ² Generation: Convolution Generate m U(0,1) random numbers ui and then: 0 1 B mY C B C Erlang(a; m) »¡a ln @ uiA i=1 °c 1994 Raj Jain 29.13 Exponential Distribution ² Used extensively in queueing models. ² Key characteristics 1. Parameters: a = Scale parameter = Mean, a > 0 2. Range: 0 · x · 1 1 ¡x=a 3. pdf: f(x) = ae 4. CDF: F (x) = 1 ¡ e¡x=a 5. Mean: a 6. Variance: a2 ² Memoryless Property: Past history is not helpful in predicting the future °c 1994 Raj Jain 29.14 ² Applications: To model time between successive events 1. Time between successive request arrivals to a device. 2. Time between failures of a device. The service times at devices are also modeled as exponentially distributed. ² Generation: Inverse transformation Generate a U(0,1) random number u and return ¡a ln(u) as Exp(a) °c 1994 Raj Jain 29.15 Memoryless Property ² Remembering the past does not help in predicting the time till the next event. F (¿) = P (¿ < t) = 1 ¡ e¡¸tt ¸ 0 ² At t = 0, the mean time to the next arrival is 1=¸. ² At t = x, the distribution of the time remaining till the next arrival is: P (¿ ¡ x < tj¿ > x) P (x < ¿ < x + t) = P (¿ > x) P (¿ < x + t) ¡ P (¿ < x) = P (¿ > x) (1 ¡ e¡¸(x+t)) ¡ (1 ¡ e¡¸x) = e¡¸t = 1 ¡ e¡¸x This is identical to the situation at t = 0. °c 1994 Raj Jain 29.16 F Distribution ² The ratio of two chi-square variates has an F distribution. ² Key characteristics: 1. Parameters: n = Numerator degrees of freedom; n should be a positive integer. m = Denominator degrees of freedom; m should be a positive integer. 2. Range: 0 · x · 1 3. pdf: f(x) = (n=m)n=2 (n¡2)=2 n ¡(n+m)=2 ¯(n=2;m=2)x (1 + mx) m 4. Mean: m¡2, provided m > 2. 2 5. Variance: 2m (n+m¡2) , provided n(m¡2)2(m¡4) m > 4. °c 1994 Raj Jain 29.17 ² High quantiles: 1 F[1¡®;n;m] = F[®;m;n] ² Applications: To model ratio of sample variances In the F-test for regression and analysis of variance ² Generation: Characterization Generate two chi-square variates Â2(n) and Â2(m) and compute: Â2(n)=n F (n; m) = Â2(m)=m °c 1994 Raj Jain 29.18 Gamma Distribution ² Generalization of Erlang distribution Allows noninteger shape parameters ² Key Characteristics: 1. Parameters: a = Scale parameter, a > 0 b = Shape parameter, b > 0 2. Range: 0 · x · 1 x b¡1 ¡x=a (a) e 3. pdf: f(x) = a¡(b) ¡(:) is the gamma function. 4. Mean: ab 5. Variance: a2b. °c 1994 Raj Jain 29.19 ² Applications: To model service times and repair times ² Generation: 1. If b is an integer, the sum of b exponential variates has a gamma distribution. 2 3 6 Yb 7 6 7 γ(a; b) »¡a ln 4 ui5 i=1 2. For b < 1, generate a beta variate x » BT(b; 1 ¡ b) and an exponential variate y » Exp(1). The product axy has a gamma(a,b) distribution. 3. For non-integer values of b: γ(a; b) » γ(a; bbc) + γ(a; b ¡ bbc) °c 1994 Raj Jain 29.20 Geometric Distribution ² Discrete equivalent of the exponential distribution ² Key characteristics: 1. Parameters: p = Probability of success, 0 < p < 1. 2. Range: x = 1; 2;:::; 1 3. pmf: f(x) = (1 ¡ p)x¡1p 4. CDF: F (x) = 1 ¡ (1 ¡ p)x 5.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    62 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us