A random number generator generates integers in the range 1...n, where n is a parameter passed into the generator. The output from the generator is repeatedly passed back in as the input. If the initial input parameter is one googol (10100), find, to the nearest integer, the expected value of the number of iterations by which the generator first outputs the number 1. That is, what is the expected value of x, after running the following pseudo-code?

n = 10100

x = 0

do while (n > 1)

n = random(n) // Generates random integer in the range 1...n

## Question

## BMAD

## Link to comment

## Share on other sites

## 9 answers to this question

## Recommended Posts

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.