Tutorial 4: 1 Instructions
Tutorial 4: 1 Instructions
PNC
September 7, 2017
1 Instructions
1. The tutorial will be discussed in the class next week. The exact date will be mailed to you.
2. In case of any doubt or clarification wrt any question, please open a thread on the google
group [email protected] and initiate a discussion.
2 Questions
1. Given a binary string of length n, what is the expected length of the longest streak of 0s that
one can see? (Rating ***)
2. If a and n are relatively prime, then prove that a, 2a, 3a.........(n−1)a, are all distinct. (Rating
***)
3. Assuming you have a function which gives you random numbers from 1 to n, devise an
efficient algorithm to permute an array containing k elements. (Rating **)
4. We discussed matrix multiplication verification in the class. In the discussed algorithm, we
picked 100 vectors uniformly at random from Zn2 where Z = {0, 1}. Discuss the same analysis
for the following cases:
7. If we pick five numbers uniformly at random from the set 1,2,3...100 without repetitions.
What is the probability that every number picked is strictly less than the previous number?
(Rating **)