Scholarship Ranking With Unequal Subject Maximums
A school awards 40 scholarships to Grade 11 students. It processes the marks of 620 students. Each student has marks for six subjects, each marked out of 100, except Additional Mathematics, which is marked out of 200. The current program computes a total by adding the raw marks, sorts the students in descending order of total, and awards the first 40. An absent subject is stored as 0. Students with equal totals are ordered by their row number in the original spreadsheet, so the student entered earlier wins. The principal notices that a student with 150 in Additional Mathematics but 30 in English received an award, while a student with 60 in every subject did not. Parents complain that the cutoff changed after the spreadsheet was re-sorted. The school wants a defensible and repeatable rule for next year, and it must still use the existing marks.
1. Identify the flaws in the current ranking algorithm. Explain how each flaw affects the award list, using the examples given.
Read the worked answer
- Different maximum marks: adding raw marks gives Additional Mathematics twice the weight of every other subject. A mark of 150/200 counts as 150, while 75/100 in another subject counts as 75. The student with 150 in Additional Mathematics and 30 in English can total 380 (with four marks of 50), while a consistent student with 60 in every subject totals 360. Raw ranking puts the first student ahead; percentage ranking gives 50.8% against 60%.
- Absent recorded as zero: a zero from absence is treated as a genuine score. This can be defensible only if the rule says so; otherwise it punishes illness and may reward a student who skips a hard subject.
- Input-order tie-break: using the row number means the award list changes when the spreadsheet is re-sorted. The sort is not stable with respect to a defined key, so the 40th place is arbitrary.
- No cutoff tie rule: equal totals at 40th place are split by row order, not by a published rule.
- Hidden eligibility: the program does not check required passes, so a student may be awarded a scholarship without meeting English or Mathematics requirements.
2. Design a repeatable ranking rule. Specify how to handle the different maximum marks, absent subjects, and ties at the 40th place.
Read the worked answer
Define the rule before running it and make every step deterministic.
- Convert each mark to a percentage of that subject's maximum:
mark / max * 100. For equal weighting, average the six percentages. If the school wants core subjects to count more, publish fixed weights that sum to 100. - Handle absence explicitly. One defensible policy is: absent = 0 for ranking, but a student absent from a required subject is not eligible. Another is to rank only on subjects taken and require a minimum number of subjects. Either way, record the policy and apply it to everyone.
- Add eligibility checks before ranking: pass in English and Mathematics, and at least five subjects taken.
- Sort by the computed score descending, then by a published tie-breaker: core-subject average, then English, then a witnessed random draw. Never use the spreadsheet row number.
- At the 40th place, either award all students with the same score if the budget allows, or apply the tie-breakers. Record the decisions.
- Use exact fractions or a fixed number of decimal places for the score, and round only for display, so equal marks compare equal.
3. List test cases, including edge cases that would expose the old bugs.
Read the worked answer
Test with small hand-checked cases and with the reported examples.
- Same totals entered in different row orders must produce the same award list.
- Re-sorting the source spreadsheet must not change the list.
- 150/200 in Additional Mathematics, 30 in English and 50 in four subjects versus 60 in all six: under equal percentage weighting the second student must rank higher.
- A student absent in one subject versus a student with a genuine zero: the eligibility rule must be applied consistently.
- Tie at 40th place: all tied students or the published tie-breaker must decide, not row order.
- Boundary cases: exactly 40 awards, 41st place one mark below, all zero marks, missing mark, duplicate student ID, and a mark above the subject maximum.
- Volume case: 620 students and 150 new intake; the report should run once, produce the same result on repeat, and finish in acceptable time. Expected result: a published rule, a deterministic list, and an audit trail showing each score and tie decision.