The following algorithm will generate a random permutation of the elements 1,2, ..., n. It is somewhat faster than the one presented in Example 1a, but is such that no position is fixed until the algorithm ends. In this algorithm,
Step 1. Set
Step 2. Set
Step 3. If
Step 4. Generate a random number U and let
Go to step 3.
a. Explain in words what the algorithm is doing.
b. Show that at iteration k—that is. when the value of P(k) Is initially set—
P(1), P(2), ..., P(k) is a random permutation of 1, 2, ..., k.
Hint: Use induction and argue that
(a)
To find: the explanation that the algorithm is doing.
Explanation of Solution
Given:
Some steps of algorithm are given.
The algorithm starts by initially putting k=1 thus it sets
Then, until
This algorithm start by putting
Therefore, therequired explanation is shown above.
(b)
To prove:that the set
Explanation of Solution
Given:
It is given that
As it is given that the condition
It is known that;
Then, the given condition becomes;
Similarly,
This proves that at iteration k can be defined as
Therefore, the required identity has been proved.
Want to see more full solutions like this?
Chapter 10 Solutions
FIRST COURSE IN PROBABILITY (LOOSELEAF)
Additional Math Textbook Solutions
Elementary Statistics: Picturing the World (7th Edition)
Pathways To Math Literacy (looseleaf)
A Problem Solving Approach To Mathematics For Elementary School Teachers (13th Edition)
Thinking Mathematically (6th Edition)
Elementary and Intermediate Algebra: Concepts and Applications (7th Edition)
Elementary & Intermediate Algebra
- Linear Algebra: A Modern IntroductionAlgebraISBN:9781285463247Author:David PoolePublisher:Cengage LearningElements Of Modern AlgebraAlgebraISBN:9781285463230Author:Gilbert, Linda, JimmiePublisher:Cengage Learning,Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:Cengage