0% found this document useful (0 votes)
5 views

Assignment 0

The document outlines an assignment focused on the design and analysis of parallel algorithms, with a due date of January 25th, 2025. It includes various mathematical problems such as proving bounds, solving recurrence equations, and analyzing algorithms like merge sort. Additionally, it presents a scenario involving a game with graduate students that requires a collaborative strategy to ensure all participants are accounted for, along with a request for a code snippet to demonstrate the solution.

Uploaded by

tamer.elsaadany
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Assignment 0

The document outlines an assignment focused on the design and analysis of parallel algorithms, with a due date of January 25th, 2025. It includes various mathematical problems such as proving bounds, solving recurrence equations, and analyzing algorithms like merge sort. Additionally, it presents a scenario involving a game with graduate students that requires a collaborative strategy to ensure all participants are accounted for, along with a request for a code snippet to demonstrate the solution.

Uploaded by

tamer.elsaadany
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment # 0

The Design and Analysis of Parallel Algorithms


Math Back Ground
Due: Jan 25th , 2025
Upper and Lowr bounds

1. Prove that (1+n) 2 = O( n2 )


2. Prove that 3 n2 - 18 n + 9 = O( n2 )
3. Prove that log n = O( n2 )
4. Prove that n2 - 3 n + 18 = Ω(n )

5. true or false. In each case give a reason for your answer.


a. (n+1)3 = Ө(n3) --- b. 10n = Ω (5n) ---- c. n! = Ө ( (2n)! ) --- d. nlog n = O(2n)
6. Solve the following recurrence equation
T(n) = 10 T(n-1) - 21 T(n-2) subject to T(0 )= 1 and T(1) = 2.

7. Illustrate the operation of merge sort on the following array :


A= { 13 , 1 , 2 , 81 , 5 , 13 , 10, 6}. (step by step)
8. If n is not a prime number (2n -1) is also a prime.
𝟕 𝟐
9. We can fill 𝟖 of the tank A with 𝟑 of the water of the tank B. If tank A is empty, what is the fraction
of the tank B is needed to fill completely the tank A?
10. Two processors P1 and P2 can separately finish a specific task in 12 and 18 seconds, respectively.
If both processors start working together, but after 4 seconds, processor P1 stopped working. How
long will it take in seconds to complete the specified task. (Assume 0 time to switch from one
processor to another).
Recurrence

11. Find the maximum number of regions in which a plane can be divided by 100 straight lines.
Drive a recurrence relation to solve this problem.

12. Write a C/C++/Python recursive-code to find the resistance between A and B. Consider an
infinite network consisting of resistors (r =1 Ω) as shown in Fig. Find the resultant resistance
between points A and B.
Solve for the following cases: -
A. The required accuracy of your answer <= 0.001
B. The required accuracy of your answer <= 0.00001
C. What is the complexity of your code?
(this problem can be solved mathematically in a constant time)

Prof. Ossama Ismail


Assignment # 0
The Design and Analysis of Parallel Algorithms
Math Back Ground
Due: Jan 25th , 2025

Parallel Thinking

In the CC 721 course, a group of twelve graduate students is participating in a teacher-organized


game. In this game, any student is selected randomly and brought into a room equipped with
TWO two-state switches, initially set to the off position. The students have the freedom to
manipulate any switch as they enter the room. The process continues randomly until one student
becomes certain that every participant has entered the room at least once. At this juncture, the
confident student can confirm that all of them have been selected, resulting in all students
receiving an A+ otherwise they will get an F in this course. Since there is no communication
allowed among the students once the game begins, they must collaboratively devise a plan or
algorithm in advance to effectively use the switch and ensure that, at some point, one of them is
confident that all have entered the room.
What strategy should they employ ? Assuming the students utilize the most efficient strategy
possible, how many times, at a minimum, will students enter the room ?
Create a code snippet that replicates your approach to solving this problem!

Prof. Ossama Ismail

You might also like