Harshit K.
asked 12/10/22MCQ of computer science
Ramesh is taking a tough examination. The question paper consists of N objective problems and each problem has 4 options A,B,C, and D, out of which, exactly one option is correct. Since Ramesh did not study for the exam, he does not know the answer to any of the problems. Ramesh was looking nearby for help when his friend somehow communicated the following information: Exactly Na problems have option A as the answer. Exactly Nb problems have option B as the answer. Exactly Nc problems have option C as the answer. Exactly Nd problems have option D as the answer. Note that: Na+Nb+Nc+Nd=N Each problem is worth exactly 1 mark and there is no negative marking.
Even though Babbu knows the number of correct options of each type, he does not know the correct answer to any problem. Based on the given information, if he select the option with maximum frequency, Ramesh can score maximum. E.g. if there are 10 questions and Na = 6, Nb = 3, Nc = 1, Nd = 0 then Ramesh will mark option A for all questions. This way he can score 6 marks.
The above strategy belongs to
A) Dynamic Programming
B) Greedy algorithms
C) Divide and conquer
D) Backtracking Brute Force
1 Expert Answer
Hello, Harshit!
The answer would then be B) Greedy Algorithms. This is because greedy algorithms, like Ramesh in the exam, choose the most optimal option and run with it. The other options take a more sophisticated approach by breaking it into subproblems or, in Backtracking/Brute Force's case, exploring every possible option, both of which are not Ramesh's strategy.
For further explanation:
Dynamic Programming would require defining states and solving overlapping subproblems.
Divide and Conquer would involve splitting the question set into smaller independent parts.
Backtracking / Brute Force would require exploring multiple or all possible answer assignments.
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
James D.
Each "test question" can be thought of as its own subproblem with most likely answer a (6/10), and even when the algorithm reaches question 7 and has already answered 6 questions with letter a the algo will still mark question 7 with letter a, demonstrating a greedy algorithm.12/21/22