1 00:00:01,680 --> 00:00:04,990 Here is an example of a problem related to the Bernoulli 2 00:00:04,990 --> 00:00:08,590 process, which can be tricky, but is actually 3 00:00:08,590 --> 00:00:11,010 easy to answer if one makes good use 4 00:00:11,010 --> 00:00:13,270 of the fresh-start property. 5 00:00:13,270 --> 00:00:14,910 Here is the setting. 6 00:00:14,910 --> 00:00:17,700 Time is discrete, divided into slots. 7 00:00:17,700 --> 00:00:22,010 We have a server that receives tasks to process. 8 00:00:22,010 --> 00:00:26,070 Tasks received gets processed in the same time slot. 9 00:00:26,070 --> 00:00:29,640 So slots are divided into busy ones-- 10 00:00:29,640 --> 00:00:33,290 those are the slots during which a task gets processed. 11 00:00:33,290 --> 00:00:36,080 And idle slots-- these are the slots 12 00:00:36,080 --> 00:00:39,080 during which there is no task to be processed. 13 00:00:39,080 --> 00:00:41,230 We assume that the process of job arrivals 14 00:00:41,230 --> 00:00:43,260 is described by a Bernoulli process 15 00:00:43,260 --> 00:00:46,070 with some known parameter p. 16 00:00:46,070 --> 00:00:49,820 So, during each slot there is probability, p, 17 00:00:49,820 --> 00:00:52,750 that a job is present, and different slots 18 00:00:52,750 --> 00:00:55,010 are independent of each other. 19 00:00:55,010 --> 00:00:59,270 We're interested in the first busy period of the server. 20 00:00:59,270 --> 00:01:04,319 The first busy period starts at the first slot 21 00:01:04,319 --> 00:01:08,070 during which there is a job present. 22 00:01:08,070 --> 00:01:11,990 And the busy period extends until just 23 00:01:11,990 --> 00:01:17,050 before the next idle slot. 24 00:01:17,050 --> 00:01:20,250 For an example, it could be the case 25 00:01:20,250 --> 00:01:23,750 that the first slot is busy, in which case 26 00:01:23,750 --> 00:01:26,110 the busy period starts right here. 27 00:01:26,110 --> 00:01:28,340 And the busy periods, in this example, 28 00:01:28,340 --> 00:01:31,360 extends for three time units. 29 00:01:31,360 --> 00:01:35,509 It ends just before the next idle slot. 30 00:01:35,509 --> 00:01:38,910 It could also be the case that the first slot is idle. 31 00:01:38,910 --> 00:01:41,240 In that case, the busy period starts 32 00:01:41,240 --> 00:01:44,940 with the first busy slot that shows up. 33 00:01:44,940 --> 00:01:47,180 It's this slot in this example. 34 00:01:47,180 --> 00:01:51,229 And extends until just before the first idle slot 35 00:01:51,229 --> 00:01:52,550 that we observe. 36 00:01:52,550 --> 00:01:54,509 So in this example, the busy period 37 00:01:54,509 --> 00:01:57,539 extends for four time steps. 38 00:01:57,539 --> 00:02:00,860 What is the length of the first busy period? 39 00:02:00,860 --> 00:02:03,200 Well, the length of the first busy period 40 00:02:03,200 --> 00:02:04,320 is a random variable. 41 00:02:04,320 --> 00:02:06,680 So what we mean by this question is, 42 00:02:06,680 --> 00:02:10,820 what is the distribution of this random variable? 43 00:02:10,820 --> 00:02:13,210 Here's how we go about it. 44 00:02:13,210 --> 00:02:17,950 The process starts, we wait until a first busy slot 45 00:02:17,950 --> 00:02:19,390 appears. 46 00:02:19,390 --> 00:02:23,630 This is a random time, which is actually the first arrival 47 00:02:23,630 --> 00:02:24,880 time. 48 00:02:24,880 --> 00:02:29,710 And at that time, by our earlier discussion, 49 00:02:29,710 --> 00:02:32,590 the process will start fresh. 50 00:02:32,590 --> 00:02:37,690 Starting from this next the slot here and going on forward, 51 00:02:37,690 --> 00:02:40,320 what we have is a Bernoulli process. 52 00:02:40,320 --> 00:02:43,810 And at each slot, there's probability p that it is busy, 53 00:02:43,810 --> 00:02:47,610 and probability 1 minus p that it is idle. 54 00:02:47,610 --> 00:02:50,570 Now, what is this slot here? 55 00:02:50,570 --> 00:02:55,360 This is the first idle slot in this Bernoulli process 56 00:02:55,360 --> 00:02:57,990 that starts fresh at this particular time. 57 00:03:00,530 --> 00:03:04,790 At each time step there is probability 1 minus p 58 00:03:04,790 --> 00:03:07,120 that the slot is idle. 59 00:03:07,120 --> 00:03:10,440 Think now of idle slots as successes. 60 00:03:10,440 --> 00:03:13,860 How long does it take until the first success? 61 00:03:13,860 --> 00:03:20,690 We know that this is a geometric random variable with parameter 62 00:03:20,690 --> 00:03:23,170 equal to the probability of success. 63 00:03:23,170 --> 00:03:27,079 Since we're thinking of the idle slot as being a success, 64 00:03:27,079 --> 00:03:31,160 the parameter, in this case, is going to be 1 minus p. 65 00:03:31,160 --> 00:03:35,370 So, the length of this blue interval 66 00:03:35,370 --> 00:03:38,790 that starts at this slot and extends 67 00:03:38,790 --> 00:03:43,790 until the first idle slot has a geometric distribution 68 00:03:43,790 --> 00:03:47,130 with parameter 1 minus p. 69 00:03:47,130 --> 00:03:50,900 But now notice that the length of this blue interval 70 00:03:50,900 --> 00:03:55,680 is exactly the same as the length of this red interval. 71 00:03:55,680 --> 00:03:58,460 The red interval is just the same as the blue interval, 72 00:03:58,460 --> 00:04:02,410 but shifted by 1, but their lengths are the same. 73 00:04:02,410 --> 00:04:04,460 And the length of the red interval 74 00:04:04,460 --> 00:04:07,030 is the length of the first busy period. 75 00:04:07,030 --> 00:04:11,040 So we conclude that the first busy period is also 76 00:04:11,040 --> 00:04:16,100 a geometric random variable with parameter 1 minus p.