Answer:
Number of packets ≈ 5339
Explanation:
let
X = no of packets that is not erased.
P ( each packet getting erased ) = 0.8
P ( each packet not getting erased ) = 0.2
P ( X ≥ 1000 ) = 0.99
E(x) = n * 0.2
var ( x ) = n * 0.2 * 0.8
∴ Z = X - ( n * 0.2 ) / ~ N ( 0.1 )
attached below is the remaining part of the solution
note : For the value of <em>n</em> take the positive number
Answer:
In C++:
int PrintInBinary(int num){
if (num == 0)
return 0;
else
return (num % 2 + 10 * PrintInBinary(num / 2));
}
Explanation:
This defines the PrintInBinary function
int PrintInBinary(int num){
This returns 0 is num is 0 or num has been reduced to 0
<em> if (num == 0) </em>
<em> return 0; </em>
If otherwise, see below for further explanation
<em> else
</em>
<em> return (num % 2 + 10 * PrintInBinary(num / 2));
</em>
}
----------------------------------------------------------------------------------------
num % 2 + 10 * PrintInBinary(num / 2)
The above can be split into:
num % 2 and + 10 * PrintInBinary(num / 2)
Assume num is 35.
num % 2 = 1
10 * PrintInBinary(num / 2) => 10 * PrintInBinary(17)
17 will be passed to the function (recursively).
This process will continue until num is 0
It's neat organized and ready to find when needed