Introduction To Algorithms, Third Edition (international Edition)
Introduction To Algorithms, Third Edition (international Edition)
3rd Edition
ISBN: 9780262533058
Author: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein
Publisher: TRILITERAL
Question
Book Icon
Chapter 5, Problem 1P

(a)

Program Plan Intro

To show that the expected value represented by the counter after n INCREMENT operations that have been performed is exactly n.

(a)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The INCREMENT operation works on a counter containing the value i in a probabilistic manner. If i=2b1 then it shows an overflow error. Otherwise, it increases the counter by 1 with probability 1/(ni+1ni) and leaves the counter with probability 11/(ni+1ni) .

Explanation:

The counter after n INCREMENT operations is performed exactly n times for the expected value.

Consider that the initial value of the counter is i and increasing the number representation from ni to ni+1 with a probability of 1ni+1ni and leaving the value unchanged.

The expected increase is calculated as,

  ni+1nini+1ni=1

Hence, the expected increment represented by the counter is 1.

(b)

Program Plan Intro

To calculate the variance in the value represented by the register after n INCREMENT operations have been performed.

(b)

Expert Solution
Check Mark

Explanation of Solution

Given Information: Consider a simple case: ni=100i for all i0 and variance of the counter depends on the ni .

Explanation:

Consider that Vn and Xj are the variant and pairwise independent events. The variance Vn is calculated as,

  Var[Vn]=Var[X1]+Var[X2]+Var[Xn]

Since ni=100i and ni+1ni=100(i+1)100i=100 . Therefore, the value represented by the counter with probability 99/100 due to the jth INCREMENT is 0 and with the probability of 1/100 .

The value represented increases by 100. Therefore, by the equation (C.27)

  Var[Xj]=E[Xj2]E2[Xj]=(( 0 2 99 100 )+( 100 2 1 100 ))12=1001=99

Now, adding the variances of the Xj gives Var[Vn]=99n .

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
I need help creating the network diagram and then revising it for the modified activity times.
Activity No. Activity Time (weeks) Immediate Predecessors 1 Requirements collection 3 2 Requirements structuring 4 1 3 Process analysis 3 2 4 Data analysis 3 2 5 Logical design 50 3,4 6 Physical design 5 5 7 Implementation 6 6 c. Using the information from part b, prepare a network diagram. Identify the critical path.
Given the following Extended-BNF grammar of the basic mathematical expressions:  Show the derivation steps for the expression: ( 2 + 3 ) * 6 – 20 / ( 3 + 1 ) Draw the parsing tree of this expression. SEE IMAGE
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning