Question:

The computer centre (CC) in an institute manages the central server for which researchers queue to run their computer programs. CC processes programs only one at a time. Four computer programs are available at 10:00 am on a given day. The time required to run each program on the central server and their respective promised time of completion (i.e., due date) on that same day are given in the table.

Program1234
Processing time (in minutes)604090100
Promised time (i.e., due date)12 noon11:30 am1:00 pm1:30 pm

If the CC follows shortest processing time (SPT) rule to sequence the computer programs, then number of tardy jobs is ______.

Note: Ignore program change-over times.

Show Hint

Arrange the programs in increasing order of processing time, compute each program's completion time by adding processing times cumulatively from 10:00 am, and compare each with its due date.
Updated On: Aug 3, 2026
Show Solution
collegedunia
Verified By Collegedunia

Correct Answer: 2

Solution and Explanation

Step 1: Understanding the Concept:
This is a single-machine job sequencing problem.
We must sequence the four programs using the Shortest Processing Time (SPT) rule and then check how many finish after their promised due date.

Step 2: Key Formula or Approach:
Under SPT, jobs are ordered from smallest to largest processing time.
It is easier to work in minutes elapsed since 10:00 am rather than switching between clock times at every step, so convert every due date into "minutes after 10:00 am" first.
A job is tardy if its cumulative completion time (in minutes) exceeds its due time (in minutes).

Step 3: Detailed Explanation:
Processing times: Program 1 = 60, Program 2 = 40, Program 3 = 90, Program 4 = 100 minutes.
SPT order: Program 2, Program 1, Program 3, Program 4.
Convert due dates to minutes after 10:00 am: Program 2 due 11:30 am = 90 min, Program 1 due 12:00 noon = 120 min, Program 3 due 1:00 pm = 180 min, Program 4 due 1:30 pm = 210 min.
Now accumulate processing times in SPT order:
Program 2: completion = 40 min (limit 90 min), on time.
Program 1: completion = 40 + 60 = 100 min (limit 120 min), on time.
Program 3: completion = 100 + 90 = 190 min (limit 180 min), tardy by 10 min.
Program 4: completion = 190 + 100 = 290 min (limit 210 min), tardy by 80 min.

Final Answer:
Programs 3 and 4 finish after their due times, so exactly 2 jobs are tardy.
\[ \boxed{\text{Number of tardy jobs} = 2} \]
Was this answer helpful?
0
0

Top GATE PI Questions

View More Questions