Harshit K.

asked • 12/10/22

MCQ 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

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.
Report

12/21/22

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.