• Home
  • Textbooks
  • Probability and Computing
  • Continuous Distributions and the Poisson Process

Probability and Computing

Michael Mitzenmacher , Eli Upfal

Chapter 8

Continuous Distributions and the Poisson Process - all with Video Answers

Educators


Chapter Questions

01:27

Problem 1

Let $X$ and $Y$ be independent, uniform random variables on $[0,1]$. Find the density function and distribution function for $X+Y$.

Hoan Nguyen
Hoan Nguyen
Numerade Educator
06:50

Problem 2

Let $X$ and $Y$ be independent, exponentially distributed random variables with parameter 1. Find the density function and distribution function for $X+Y$.

Aman Gupta
Aman Gupta
Numerade Educator
00:47

Problem 3

Let $X$ be a uniform random variable on $[0,1]$. Determine $\operatorname{Pr}(X \leq 1 / 2 \mid$ $1 / 4 \leq X \leq 3 / 4)$ and $\operatorname{Pr}(X \leq 1 / 4 \mid(X \leq 1 / 3) \cup(X \geq 2 / 3))$.

Hoan Nguyen
Hoan Nguyen
Numerade Educator
01:25

Problem 4

We agree to try to meet between 12 and 1 for lunch at our favorite sandwich shop. Because of our busy schedules, neither of us is sure when we'll arrive; we assume that, for each of us, our arrival time is uniformly distributed over the hour. So that neither of us has to wait too long, we agree that we will each wait exactly $15 \mathrm{~min}$ utes for the other to arrive, and then leave. What is the probability. we actually meet each other for lunch?

Prashant Bana
Prashant Bana
Numerade Educator
04:02

Problem 5

In Lemma 8.3, we found the expectation of the smallest of $n$ independent uniform random variables over $[0,1]$ by directly computing the probability that it was larger than $y$ for $0 \leq y \leq 1$. Perform a similar calculation to find the probability that the $k$ th smallest of the $n$ random variables is larger than $y$, and use this to show that its expected value is $k /(n+1)$.

Hunza Gilgit
Hunza Gilgit
Numerade Educator
02:36

Problem 6

Let $X_{1}, X_{2}, \ldots, X_{n}$ be independent exponential random variables with parameter 1 . Find the expected value of the $k$ th largest of the $n$ random variables.

Amany Waheeb
Amany Waheeb
Numerade Educator
05:22

Problem 7

Consider a complete graph on $n$ vertices. Each edge is assigned a weight chosen independently and uniformly at random from the real interval $[0,1]$. Show that the expected weight of the minimum spanning tree of this graph is at least $1-1 /\left(1+\left(\begin{array}{l}n \\ 2\end{array}\right)\right)$. Find a similar bound when each edge is independently assigned a weight from an exponential distribution with parameter 1 .

Chris Trentman
Chris Trentman
Numerade Educator
02:55

Problem 8

Consider a complete graph on $n$ vertices. Each edge is assigned a weight chosen independently and uniformly at random from the real interval $[0,1] .$ We propose the following greedy method for finding a small-weight Hamiltonian cycle in the graph. At each step, there is a head vertex. Initially the head is vertex 1 . At each step, we find the edge of least weight between the current head vertex and a new vertex that has never been the head. We add this edge to the cycle and set the head vertex to the new vertex. After $n-1$ steps, we have a Hamiltonian path, which we complete to make a Hamiltonian cycle by adding the edge from the last head vertex back to vertex 1 . What is the expected weight of the Hamiltonian cycle found by this greedy approach? Also, find the expectation when each edge is independently assigned a weight from an exponential distribution with parameter $1 .$

WZ
Wen Zheng
Numerade Educator
01:51

Problem 9

You would like to write a simulation that uses exponentially distributed random variables. Your system has a random number generator that produces independent, uniformly distributed numbers from the real interval $(0,1)$. Give a procedure that transforms a uniform random number as given to an exponentially distributed random variable with parameter $\lambda$.

Neel Faucher
Neel Faucher
Numerade Educator
03:34

Problem 10

Let $n$ points be placed uniformly at random on the boundary of a circle of circumference 1 . These $n$ points divide the circle into $n$ arcs. Let $Z_{i}$ for $1 \leq Z_{i} \leq n$ be the length of these arcs in some arbitrary order.
(a) Prove that all $Z_{i}$ are at most $c \ln n /(n-1)$ with probability at least $1-1 / n^{c-1}$.
(b) Prove that, for sufficiently large $n$, there exists a constant $c^{\prime}$ such that at least one $Z_{i}$ is at least $c^{\prime} \ln n$ with probability at least $1 / 2$. (Hint: Use the second moment method.)
(c) Prove that all $Z_{i}$ are at least $1 / 2 n^{2}$ with probability at least $1 / 2$.
(d) Prove that, for sufficiently large $n$, there exists a constant $c^{\prime}$ such that at least one $Z_{i}$ is at most $c^{\prime} / n^{2}$ with probability at least $1 / 2$. (Hint: Use the second moment method.)
(e) Explain how these results relate to the following problem: $X_{1}, X_{2}, \ldots, X_{n-1}$ are values chosen independently and uniformly at random from the real interval $[0,1]$. We let $Y_{1}, Y_{2}, \ldots, Y_{n-1}$ represent these values in increasing sorted order, and we also define $Y_{0}=0$ and $Y_{n}=1$. The points $Y_{t}$ break the unit interval into $n$ segments. What can we say about the shortest and longest of these segments?

Amany Waheeb
Amany Waheeb
Numerade Educator
07:51

Problem 11

Bucket sort is a simple sorting algorithm discussed in Section 5.2.2.
(a) Explain how to implement Bucket sort so that its expected running time is $O(n)$ when the $n$ elements to be sorted are independent, uniform random numbers that are chosen from $[0,1]$.
(b) We now consider how to implement Bucket sort when the elements to be sorted are not necessarily uniform over an interval. Specifically, suppose the elements to be sorted are numbers of the form $X+Y$, where (for each element) $X$ and $Y$ are independent, uniform random numbers chosen from $[0,1]$. How can you modify the buckets so that Bucket sort still has expected running time $O(n)$ ? What if the elements to be sorted were numbers of the form $\max (X, Y)$ instead of $X+Y ?$

Willis James
Willis James
Numerade Educator
00:38

Problem 12

Let $n$ points be placed uniformly at random on the boundary of a circle of circumference 1. These $n$ points divide the circle into $n$ arcs. Let $Z_{i}$ for $1 \leq Z_{i} \leq n$ be the length of these arcs in some arbitrary order, and let $X$ be the number of $Z_{i}$ that are at least $1 / n$. Find $\mathbf{E}[X]$ and $\operatorname{Var}[X]$.

Ethan Somes
Ethan Somes
Numerade Educator
00:56

Problem 13

A digital camera needs two batteries. You buy a pack of $n$ batteries, labeled 1 to $n$. Initially, you install batteries 1 and $2 .$ Whenever a battery is drained; you immediately replace the drained battery with the lowest numbered unused battery. Assume that each battery lasts for an amount of time that is exponentially distributed with mean $\mu$ before being drained, independent of all other batteries. Eventually, all the batteries but one will be drained.
(a) Find the probability that the battery numbered $i$ is the one that is not eventually drained.
(b) Find the expected time your camera will be able to run with this pack of batteries.

Sriparna Bhattacharjee
Sriparna Bhattacharjee
Numerade Educator
01:15

Problem 14

Let $X_{1}, X_{2}, \ldots$ be exponential random variables with parameter 1 .
(a) Argue that $X_{1}+X_{2}$ is not an exponential random variable.
(b) Let $N$ be a geometric random variable with parameter $p$. Prove that $\sum_{i=1}^{N} X_{i}$ is exponentially distributed with parameter $p$.

Victor Salazar
Victor Salazar
Numerade Educator
02:36

Problem 15

(a) Let $X_{1}, X_{2}, \ldots$ be a sequence of independent exponential random variables, each with mean 1 . Given a positive real number $k$, let $N$ be defined by
$$
N=\min \left\{n: \sum_{i=1}^{n} X_{\imath}>k\right\}
$$
That is, $N$ is the smallest number for which the sum of the first $N$ of the $X_{i}$ is larger than $k$. Determine $\mathbf{E}[N]$.
(b) Let $X_{1}, X_{2}, \ldots$ be a sequence of independent uniform random variables on the interval $(0,1)$. Given a positive real number $k$ with $0<k<1$, let $N$ be defined by
$$
N=\min \left\{n: \prod_{i=1}^{n} X_{i}<k\right\}
$$
That is, $N$ is the smallest number for which the product of the first $N$ of the $X_{l}$ is smaller than $k$. Determine $\mathbf{E}[N]$. (Hint: You may find Exercise $8.9$ helpful.)

Amany Waheeb
Amany Waheeb
Numerade Educator
View

Problem 16

There are $n$ tasks that are given to $n$ processors. Each task has two phases, and the time for each phase is given by an exponentially distributed random variable with parameter 1 . The times for all phases and for all tasks are independent. We say that a task is half-done if it has finished one of its two phases.
(a) Derive an expression for the probability that there are $k$ tasks that are half-done at the instant when exactly one task becomes completely done.
(b) Derive an expression for the expected time until exactly one task becomes completely done.
(c) Explain how this problem is related to the birthday paradox.

Victor Salazar
Victor Salazar
Numerade Educator
02:18

Problem 17

Prove Theorem 8.11.

Wendi Zhao
Wendi Zhao
Numerade Educator
03:41

Problem 18

Complete the proof of Theorem $8.13$ by showing formally that, if $N_{1}(t)$ and $N_{2}(t)$ are independent, then so are $N_{1}(t)$ and $N_{2}(u)$ for any $t, u>0$.

Ivan Kochetkov
Ivan Kochetkov
Numerade Educator
01:06

Problem 19

You are waiting at a bus stop to catch a bus across town. There are act tually $\boldsymbol{n}$ different bus lines you can take, each following a different route. Which bus you decide to take will depend on which bus gets to the bus stop first. As long as you are waiting, the time you have to wait for a bus on the $i$ th line is exponentially distrib: uted with mean $\mu_{i}$ minutes. Once you get on a bus on the $i$ th line, it will take you $t_{i}$ minutes to get across town.

Design an algorithm for deciding - when a bus arrives - whether or not you should get on the bus, assuming your goal is to minimize the expected time to cross town. (Hint: You want to determine the set of buses that you want to take as soon as they arrive. There are $2^{n}$ possible sets, which is far too large for an efficient algorithm. Argue that you need only consider a small number of these sets.)

Lauren Shelton
Lauren Shelton
Numerade Educator
03:59

Problem 20

Given a discrete space, continuous time Markov process $X(t)$, we can derive a discrete time Markov chain $Z(t)$ by considering the states the process visits. That is, let $Z(0)=X(0)$, let $Z(1)$ be the state that process $X(t)$ first moves to after time $t=0$, let $Z$ (2) be the next state process $X(t)$ moves to, and so on. (If the Markov process $X(t)$ makes a transition from state $i$ to state $i$, which can occur when $p_{l, i} \neq 0$ in the associated transition matrix, then the Markov chain $Z(t)$ should also make a transition from state $i$ to state $i$.)
(a) Suppose that, in the process $X(t)$, the time spent in state $i$ is exponentially distrib uted with parameter $\theta_{i}=\theta$ (which is the same for all $i$ ). Further suppose that the process $X(t)$ has a stationary distribution. Show that the Markov chain $Z(t)$ has the same stationary distribution.
(b) Give an example showing that, if the $\theta_{l}$ are not all equal, then the stationary distributions for $X(t)$ and $Z(t)$ may differ.

Madi Sousa
Madi Sousa
Numerade Educator
01:20

Problem 21

The Ehrenfest model is a basic model used in physics. There are $n$ particles moving randomly in a container. We consider the number of particles in the left and right halves of the container. A particle in one half of the container moves to the other half after an amount of time that is exponentially distributed with parameter f independently of all other particles. See Figure 8.6.
(a) Find the stationary distribution of this process.
(b) What state has the highest probability in the stationary distribution? Can you suggest an explanation for this?

Dominador Tan
Dominador Tan
Numerade Educator
05:27

Problem 22

We can obtain a discrete time Markov chain from the $M / M / 1$ queved ing process in the manner described in Exercise 8.20. The discrete time chain tracks the number of customers in the queue. It is useful to allow departure events to occur with rate $\lambda$ at the queue even when it is empty; this does not affect the queue behavior; but it gives transitions from state 0 to state 0 in the corresponding Markov chain.
(a) Describe the possible transitions of this discrete-time chain and give their probat bilities.
(b) Show that the stationary distribution of this chain when $\lambda<\mu$ is the same as for the $M / M / 1$ process.
(c) Show that, in the case $\lambda=\mu$, there is no valid stationary distribution for the Markov chain.

Robin Corrigan
Robin Corrigan
Numerade Educator
04:04

Problem 23

In a tandem queue, customers arrive to an $M / M / 1$ queue according to a Poisson process of rate $\lambda$ with service times independent and exponentially distributed with parameter $\mu_{1}$. After completing service at this first queue, the customers proceed immediately to a second queue, also being served by a single server, where service times are independent and exponentially distributed with parameter $\mu_{2}$. Find the stationary distribution of this system. (Hint: Try to generalize the form of the stationary distribution for a single queue.)

James Kiss
James Kiss
Numerade Educator
02:37

Problem 24

Write a program to simulate the model of balls and bins with feedback.
(a) Start your simulation with 51 balls in bin 1 and 49 balls in bin 2 , using $p=2 .$ Run your program 100 times, having it stop each time one bin has $60 \%$ of the balls. On average, how many balls are in the bins when the program stops? How often does bin 1 have the majority?
(b) Perform the same experiment as in part (a) but start with 52 balls in bin 1 and 48 balls in bin 2 . How much does this change your answers?
(c) Perform the same experiment as in part (a) but start with 102 balls in bin 1 and 98 balls in bin 2 . How much does this change your answers?
(d) Perform the same experiment as in part (a), but now use $p=1.5$. How much does this change your answers?

Nick Johnson
Nick Johnson
Numerade Educator
01:54

Problem 25

We consider here one approach for studying a FIFO queue with a constant service time of duration 1 and Poisson arrivals with parameter $\lambda<1 .$ We replace the constant service time by $k$ exponentially distributed service stages, each of mean duration $1 / k$. A customer must pass through all $k$ stages before leaving the queue, and once one customer begins going through the $k$ stages, no other customer can receive service until that customer finishes.
(a) Derive Chernoff bounds for the probability that the total time taken in $k$ exponentially distributed stages, each of mean $1 / k$, deviates significantly from $1 .$
(b) Derive a set of equations that define the stationary distribution for this situation. (Hint: Try letting $\pi_{j}$ be the limiting probability of having $j$ stages of service left to be served the queue. Each waiting customer requires $k$ stages; the one being: served requires between 1 and $k$ stages.) You should not try to solve these equations to give a closed form for $\pi_{j}$.
(c) Use these equations to numerically determine the average number of customers in the queue in equilibrium, say for $\lambda=0.8$ and for $k=10,20,30,40$, and 50 Discuss whether your results seem to be converging as $k$ increases, and compare the expected number of customers to an $M / M / 1$ queue with arrival rate $\lambda<1$ and expected service time $\mu=1$.

Gaurav Kalra
Gaurav Kalra
Numerade Educator
03:05

Problem 26

Write a simulation for a bank of $n M / M / 1$ FIFO queues, each will Poisson arrivals of rate $\lambda<1$ per second and each with service times exponentially distributed with mean 1 second. Your simulation should run for $t$ seconds and return the average amount of time spent in the system per customer who completed service. You should present results for your simulations for $n=100$ and for $t=10,000$ seconds with $\lambda=0.5,0.8,0.9$, and $0.99 .$

A natural way to write the simulation that we now describe is to keep a priority queue of events. Such a queue stores the times of all pending events, such as the next time a customer will arrive or the next time a customer will finish service at a queiêe: A priority queue can answer queries of the form, "What is the next event?" Priority queues are often implemented as heaps, for example.

When a customer bound for queue $k$ arrives, the arrival time for the next customet to queue $k$ must then be calculated and entered in the priority queue. If queue $k$ is empty the time that the arriving customer will complete service should be put in the priorify queue. If queue $k$ is not empty, the customer is put at the tail of the queue. If a queue is not empty after completing service for a customer, then the time that the next customer (at the head of the queue) will complete service should be calculated and put in the priority queue. You will have to track each customer's arrival time and completion time.

You may find ways to simplify this general scheme. For example, instead of con sidering a separate arrival process for each queue, you can combine them into a single arrival process based on what we know from Section 8.4.2. Explain whatever simplit fications you use.
You may wish to use Exercise $8.9$ to help construct exponentially distributed random: variables for your simulation.

Modify your simulation so that, instead of service times being exponentially dis tributed with mean 1 second, they are always exactly 1 second. Again present results: for your simulation for $n=100$ and for $t=10,000$ seconds with $\lambda=0.5,0.8,0.9$, and $0.99$. Do customers complete more quickly with exponentially distributed service times or constant service times?

Sheryl Ezze
Sheryl Ezze
Numerade Educator