Home / Expert Answers / Statistics and Probability / subject-modelling-random-process-a-computer-programmer-writes-the-following-pseudo-code-wit-pa909

(Solved): Subject - Modelling (Random Process) A computer programmer writes the following (pseudo) code (wit ...



A computer programmer writes the following (pseudo) code (with line numbers)
01) \( \mathrm{R}=\operatorname{rand}() \)
02) i

Subject - Modelling (Random Process)

A computer programmer writes the following (pseudo) code (with line numbers) 01) \( \mathrm{R}=\operatorname{rand}() \) 02) if \( \mathrm{R}>0.7 \) 03) print('RED') 04) else 05) if \( R>0.2 \) 06) \( \quad \mathrm{S}=\operatorname{rand}() \) 07) if \( S>0.5 \) 08) print('RED') 09) else 10) print('BLUE') 11) else Assume that each call to the rand () subroutine returns an independent real number uniformly sampled from within the interval \( [0,1] \) (a) What is the probability that the string 'BLUE' is printed upon execution? (b) Given that the program prints 'BLUE' upon execution, what is the probability that it is printed by the instruction on line \( 12 ? \)


We have an Answer from Expert

View Expert Answer

Expert Answer


solution. Answer a.) if R lies in (0.7,1) then then it will perform the first if condition (line 2) i.e it will print RED. if R li
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe