Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
expand_more
expand_more
format_list_bulleted
Question
Chapter 35, Problem 5P
a.
Program Plan Intro
To show that optimal makespan is at least as large as the greatest processing time
b.
Program Plan Intro
To show that optimal makespan is at least as large as the average machine load i.e.
c.
Program Plan Intro
To write the pseudocode for the given greedy approach and provide its running time as well.
d.
Program Plan Intro
To show
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(i) Describe Banker’s algorithm for deadlock avoidance with supporting example
Consider a computer system with has four identical units of a resource R. There are three processes each with a maximum claim of two units of resource R. Processes can request these resources in anyway, that is, two in one shot or one by one. The system always satisfies a request a request for a resource if enough resources are available. If the process doesn’t request any other kind of resource, show that the system never deadlock
Give a solution for the following synchronization problem using semaphores
Producer- Consumer Problem
Readers- Writers Problem
List out the issues in preprocessor scheduling that causes performance degradation in multiprocessor systems
Implement this algorithm in C program . Show the gantt chart as output.
Round-robin (RR) is one of the algorithms employed by process and network schedulers in computing. As the term is generally used, time slices (also known as time quanta) are assigned to each process in equal portions and in circular order, handling all processes without priority (also known as cyclic executive).
Consider the following Job Scheduling problem. We have one machine and a setof n jobs {1, 2, . . . , n} to run on this machine, one at a time. Each job has a start time sifinish time fi and profit pi where 0 ≤ si < fi < ∞ and pi > 0. Two jobs i and j are compatible if the intervals [si, fi)and [sj , fj ) do not overlap. The goal is to find a set A of mutually compatible jobs with the maximumtotal profit, i.e.,P j∈A pj is maximized.Consider the following two greedy choices. For each one, determine whether it is a “safe” greedy choicefor this Job Scheduling problem. If your answer is yes, prove the “Greedy-choice property”. If your answeris no, please give a counterexample and show that the greedy choice will not lead to an optimal solution.
a.Greedy choice 1: Always select a job with the earliest finish time that is compatible with allpreviously selected activities.b.Greedy choice 2: Always select a job with the highest profit per time unit (i.e., pi/(fi − si))that is…
Chapter 35 Solutions
Introduction to Algorithms
Ch. 35.1 - Prob. 1ECh. 35.1 - Prob. 2ECh. 35.1 - Prob. 3ECh. 35.1 - Prob. 4ECh. 35.1 - Prob. 5ECh. 35.2 - Prob. 1ECh. 35.2 - Prob. 2ECh. 35.2 - Prob. 3ECh. 35.2 - Prob. 4ECh. 35.2 - Prob. 5E
Ch. 35.3 - Prob. 1ECh. 35.3 - Prob. 2ECh. 35.3 - Prob. 3ECh. 35.3 - Prob. 4ECh. 35.3 - Prob. 5ECh. 35.4 - Prob. 1ECh. 35.4 - Prob. 2ECh. 35.4 - Prob. 3ECh. 35.4 - Prob. 4ECh. 35.5 - Prob. 1ECh. 35.5 - Prob. 2ECh. 35.5 - Prob. 3ECh. 35.5 - Prob. 4ECh. 35.5 - Prob. 5ECh. 35 - Prob. 1PCh. 35 - Prob. 2PCh. 35 - Prob. 3PCh. 35 - Prob. 4PCh. 35 - Prob. 5PCh. 35 - Prob. 6PCh. 35 - Prob. 7P
Knowledge Booster
Similar questions
- Write A greedy algorithm for the event scheduling problem and explain italgorithm Scheduling(s1, f1, s2, f2, ... , sn, fn) pre-cond: The input consists of a set of events. post-cond: The output consists of a schedule that maximizes the number ofevents scheduledarrow_forwardSuppose you are given n tasks J = {j1, j2, · · · jn}.Each task ji has two parts - a preprocessing phase which takes pi units and a main phase whichtakes fi units of time. There are n machines that can execute the main phases of the jobs in parallel.However, the preprocessing phases need to be executed sequentially on a special machine. Thecompletion time of any schedule is the earliest time when all tasks have finished execution. Designa greedy algorithm which produces a schedule that minimizes the completion time. Here, youneed to give formal proof of correctness. Your proof should not exceed one side of an A4 sheet.Anything more than that will not be considered by the evaluator. Provide only pseudocode.arrow_forwardUsing a pseudo random number generation function (e.g., rand() in C or otherequivalent functions in other languages) that generates uniformly distributed randomnumbers, generate a workload for a system that is composed of 1000 processes. Youcan assume that processes arrive with an expected average arrival rate of 2 processesper second that follows a Poisson Distribution and the service time (i.e., requestedduration on the CPU) for each process follows an Exponential Distribution with anexpected average service time of 1 second. Your outcome would be printing out a listof tuples in the format of <process ID, arrival time, requested service time>.You can assume that process IDs are assigned incrementally when processes arriveand that they start at 1.Based on your actual experiment outcome, also answer the following question: whatare the actual average arrival rate and actual average service time that were generated?arrow_forward
- Consider a computer system to which two types ofcomputer jobs are submitted. The mean time to run eachtype of job is m1. The interarrival times for each type of jobare exponential, with an average of li type i jobs arrivingeach hour. Consider the following three situations. a Type 1 jobs have priority over type 2 jobs, and pre-emption is allowed. b Type 1 jobs have priority over type 2 jobs, and nopreemption is allowed.c All jobs are serviced on a FCFS basis.Under which system are type 1 jobs best off? Worst off?Answer the same questions for type 2 jobs.arrow_forwardGiven a jungle matrix NxM: jungle = [ [1, 0, 0, 0], [1, 1, 0, 1], [0, 1, 0, 0], [1, 1, 1, 1,] ] Where 0 means the block is dead end and 1 means the block can be used in the path from source to destination. Task: Starting at position (0, 0), the goal is to reach position (N-1, M-1). Your program needs to build and output the solution matrix – a 4x4 matrix with 1’s in positions used to get from the starting position (0,0) to the ending position (N-1,M-1) with the following constraints: You can only move one space at a time You can only in two directions: forward and down. You can only pass thru spaces on the jungle matrix mark ' 1 ' If you cannot reach the ending position - print a message that you're trapped in the jungle Algorithm: If destination is reached print the solution matrix Else Mark current cell in the solution matrix Move forward horizontally and recursively check if this leads to a solution If there is no solution, move down and recursively check if this leads to…arrow_forwardComputer's science Algorithms Explain the job sequencing with deadline algorithm and also find the solution for the instance n = 7 , (P 1, P2 ,....P7 )=(3, 5, 20, 18, 1, 6, 30) and (D₁, D₂, ..... D7) = (1, 3, 4, 3, 2, 1, 2).arrow_forward
- Determine whether there is a feasible schedule for the following NONPREEMPTABLE task sets. = p1 = 8 T1 (periodic): c1 = 2, d1 d2 = 6, p2 = 7 T2 (sporadic): c2 = 1, T3 (sporadic): c3 = 1, d3 =p3 = 10arrow_forwardConsider a set of n independent tasks. All tasks arrive at t = 0. Each task Ti is characterized by its computation time Ci and deadline Di. Prove that EDF is optimal for both preemptive AND non-preemptive cases. please type the answersarrow_forwardDraw the wait-for graph for the following resource allocation graph, and find is there a possibility of deadlock or not.arrow_forward
- The temporal complexities of algorithms A and B are given by the functions n2 and 2n, respectively. They are to be run on a machine M that takes 10-6 seconds to execute a command. For an input size of 50, how long does it take the algorithms to finish their execution on machine A? What is the biggest input amount that the two algorithms on machine N can handle if another machine N that is ten times faster than machine M is given for execution? What are your thoughts?arrow_forwardQUESTION TWO A. (i) Describe Banker’s algorithm for deadlock avoidance with supporting example (ii)Consider a computer system with has four identical units of a resource R. There are three processes each with a maximum claim of two units of resource R. Processes can request these resources in anyway, that is, two in one shot or one by one. The system always satisfies a request a request for a resource if enough resources are available. If the process doesn’t request any other kind of resource, show that the system never deadlock B. Give a solution for the following synchronization problem using semaphores (i)Producer- Consumer Problem (ii)Readers- Writers Problem C. List out the issues in preprocessor scheduling that causes performance degradation in multiprocessor systemsarrow_forward8. For selected non-schedulable set of tasks draw in one graph, processor demand function Cp(t) and the function f(t)=t of available processor time.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education