Designing a Diet Quality Index Scoring Algorithm
Intermediate
75 min
0 views
0 solutions
Overview
A public health researcher needs to design a Diet Quality Index (DQI) that converts a 24-hour dietary recall into a single 0–100 score. She has draft scoring rules from the literature. She must trace the algorithm manually through 3 sample diets to catch scoring inconsistencies before writing any code.
Case Details
# Aplly.xyz Case Study Submission
## Title
Designing a Diet Quality Index Scoring Algorithm
## Type
Data Analytics
## Difficulty
Intermediate
## Estimated Time
75 minutes
## Overview
A public health researcher needs to design a Diet Quality Index (DQI) that converts a 24-hour dietary recall into a single 0–100 score. She has draft scoring rules from the literature. She must trace the algorithm manually through 3 sample diets to catch scoring inconsistencies before writing any code.
## Case Details
Function Focus: Manual algorithm trace, rule-based scoring system design, boundary-case detection
Scenario:
Dr. Mehta at the National Institute of Nutrition has drafted a 4-component Diet Quality Index for a community nutrition survey pilot. Before she scripts it in Python, she needs to run a manual trace on 3 real 24-hour recall logs to verify that the scoring rules produce sensible rankings and that no boundary case (zero consumption, maximum consumption) causes a division-by-zero or cap overflow. She has the draft algorithm specification and 3 respondent recalls. She must trace each respondent through the algorithm step by step — on paper.
Draft DQI Algorithm:
Total Score = Diversity + Sufficiency + Moderation + Regularity (max 100)
1. Dietary Diversity (0–30 pts): Count distinct food groups consumed out of 10. Score = count × 3. If count = 0, score = 0.
2. Fruit & Vegetable Sufficiency (0–25 pts): Sum of fruit servings + vegetable servings (max 5 servings combined). Score = min(sum × 5, 25). If sum = 0, score = 0.
3. Moderation — Limited Discretionary Foods (0–25 pts): Start at 25. Deduct 5 points per serving of fried food, sugary drink, or packaged snack (max deduction 25). If total discretionary servings > 5, score = 0. Minimum score 0.
4. Meal Regularity (0–20 pts): 3 main meals (breakfast, lunch, dinner) expected. +7 pts per meal eaten, +0 per meal skipped. If all 3 skipped, score = 0.
Tasks:
1. Read the DQI algorithm specification above and note any ambiguous rule or missing boundary case before you begin scoring
2. Trace Respondent A (Ramesh) through each of the 4 components manually — write out the intermediate values (e.g., "count = 6 groups → 6 × 3 = 18 pts") before computing the total
3. Trace Respondent B (Lakshmi) and Respondent C (Priya) similarly, but time-box yourself to 15 minutes per respondent
4. Rank the 3 respondents by total DQI score and state whether the ranking matches your intuitive expectation based on the raw recalls (if not, identify which component caused the mismatch)
5. Only after completing all manual traces, implement the algorithm in a spreadsheet or programming language and check whether your manual scores match the computed output — itemize any discrepancies
Expected Output:
A trace sheet containing: per-respondent component scores with intermediate arithmetic, total score, final ranking, a note on any ambiguous rule or boundary case discovered during tracing, and a post-hoc discrepancy log between manual and computed results.
Evaluation Criteria:
Correct and complete step-by-step trace (not just final scores), correct handling of boundary cases (zero consumption, max caps), identification of any ambiguous or circular rules in the draft algorithm, and honest discrepancy reporting.
## Data Sources
DQI Scoring Rules Reference:
| Component | Max Pts | Rule |
|---|---|---|
| Dietary Diversity | 30 | Count distinct food groups (of 10) × 3 |
| Fruit & Veg Sufficiency | 25 | min((fruit_servings + veg_servings) × 5, 25) |
| Moderation | 25 | Start 25, −5 per discretionary serving, floor 0. If >5 discretionary servings → 0 |
| Meal Regularity | 20 | 3 meals → +7 each skipped meal → +0. Sum, floor 0. |
10 Food Groups for Diversity Count: (1) Cereals, (2) Pulses/Legumes, (3) Dark Leafy Vegetables, (4) Other Vegetables, (5) Fruits, (6) Milk/Dairy, (7) Eggs, (8) Meat/Fish/Poultry, (9) Nuts/Seeds, (10) Oils/Fats
Respondent A — Ramesh (35, Male, Urban):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Rice, dal, 1 egg | 2 idli, 1 bowl dal, 1 egg |
| Lunch | Rice, chicken curry, leafy veg | 1 plate rice, 1 bowl chicken, ½ bowl greens |
| Snack | Samosa (fried), sugary tea | 2 samosas, 1 tea with 2 tsp sugar |
| Dinner | Roti, dal, curd | 3 roti, 1 bowl dal, 1 cup curd |
Estimated counts: Groups: cereals, pulses, leafy veg, other veg (no fruits listed), dairy, eggs, meat, oils/fats (for samosa frying) = 8 groups. Fruits: 0. Combined F&V: leafy veg (½) = 0.5 servings. Discretionary: 2 samosas (fried) + sugary tea = ~3 discretionary servings. Meals: 3 eaten.
Respondent B — Lakshmi (28, Female, Rural):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Leftover rice, pickle | 1 plate rice |
| Lunch | Rice, dal, one vegetable | 1 plate rice, 1 bowl dal, ½ bowl bhindi |
| Snack | None | — |
| Dinner | Roti, dal | 2 roti, ½ bowl dal |
Estimated counts: Groups: cereals, pulses, other veg = 3 groups. Fruits: 0. F&V: only bhindi (½ serving veg, 0 fruit) = 0.5 servings. Discretionary: 0. Meals: 2 (no snack, dinner is a meal).
Respondent C — Priya (30, Female, Urban):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Vegetable poha, banana | 1 bowl poha, 1 banana |
| Lunch | Rice, fish curry, leafy veg salad | 1 plate rice, 1 bowl fish, 1 bowl salad |
| Snack | Apple, handful of almonds | 1 apple, 15g almonds |
| Dinner | Roti, paneer, green peas sabzi, curd | 2 roti, 1 bowl paneer, ½ bowl peas, ½ cup curd |
Estimated counts: Groups: cereals, other veg (poha veg + peas), fruits (banana + apple), dairy (curd + paneer), meat/fish, nuts/seeds, leafy veg, oils/fats = 8 groups. Fruits: banana + apple = 2 servings. Combined F&V: leafy salad (1) + peas (½) + fruits (2) = 3.5. Discretionary: 0 (paneer not discretionary). Meals: 3.
## Solution Frameworks
Algorithm trace, rule-based scoring system, boundary-case analysis, round-trip verification (manual → code)
## Solver Guidance & Tutorials
Link to: "Manual Algorithm Tracing for Scoring Systems" tutorial
## What You'll Learn
- Executing a multi-rule algorithm manually before coding it
- Detecting ambiguous rules and boundary cases during a trace
- Building confidence that a scoring system produces sensible rankings
- The value of manual verification before automation
## Tags
diet quality index, algorithm tracing, nutrition scoring, public health, manual verification
## Registration Links
- Register as Solver
- Register as Evaluator
## Title
Designing a Diet Quality Index Scoring Algorithm
## Type
Data Analytics
## Difficulty
Intermediate
## Estimated Time
75 minutes
## Overview
A public health researcher needs to design a Diet Quality Index (DQI) that converts a 24-hour dietary recall into a single 0–100 score. She has draft scoring rules from the literature. She must trace the algorithm manually through 3 sample diets to catch scoring inconsistencies before writing any code.
## Case Details
Function Focus: Manual algorithm trace, rule-based scoring system design, boundary-case detection
Scenario:
Dr. Mehta at the National Institute of Nutrition has drafted a 4-component Diet Quality Index for a community nutrition survey pilot. Before she scripts it in Python, she needs to run a manual trace on 3 real 24-hour recall logs to verify that the scoring rules produce sensible rankings and that no boundary case (zero consumption, maximum consumption) causes a division-by-zero or cap overflow. She has the draft algorithm specification and 3 respondent recalls. She must trace each respondent through the algorithm step by step — on paper.
Draft DQI Algorithm:
Total Score = Diversity + Sufficiency + Moderation + Regularity (max 100)
1. Dietary Diversity (0–30 pts): Count distinct food groups consumed out of 10. Score = count × 3. If count = 0, score = 0.
2. Fruit & Vegetable Sufficiency (0–25 pts): Sum of fruit servings + vegetable servings (max 5 servings combined). Score = min(sum × 5, 25). If sum = 0, score = 0.
3. Moderation — Limited Discretionary Foods (0–25 pts): Start at 25. Deduct 5 points per serving of fried food, sugary drink, or packaged snack (max deduction 25). If total discretionary servings > 5, score = 0. Minimum score 0.
4. Meal Regularity (0–20 pts): 3 main meals (breakfast, lunch, dinner) expected. +7 pts per meal eaten, +0 per meal skipped. If all 3 skipped, score = 0.
Tasks:
1. Read the DQI algorithm specification above and note any ambiguous rule or missing boundary case before you begin scoring
2. Trace Respondent A (Ramesh) through each of the 4 components manually — write out the intermediate values (e.g., "count = 6 groups → 6 × 3 = 18 pts") before computing the total
3. Trace Respondent B (Lakshmi) and Respondent C (Priya) similarly, but time-box yourself to 15 minutes per respondent
4. Rank the 3 respondents by total DQI score and state whether the ranking matches your intuitive expectation based on the raw recalls (if not, identify which component caused the mismatch)
5. Only after completing all manual traces, implement the algorithm in a spreadsheet or programming language and check whether your manual scores match the computed output — itemize any discrepancies
Expected Output:
A trace sheet containing: per-respondent component scores with intermediate arithmetic, total score, final ranking, a note on any ambiguous rule or boundary case discovered during tracing, and a post-hoc discrepancy log between manual and computed results.
Evaluation Criteria:
Correct and complete step-by-step trace (not just final scores), correct handling of boundary cases (zero consumption, max caps), identification of any ambiguous or circular rules in the draft algorithm, and honest discrepancy reporting.
## Data Sources
DQI Scoring Rules Reference:
| Component | Max Pts | Rule |
|---|---|---|
| Dietary Diversity | 30 | Count distinct food groups (of 10) × 3 |
| Fruit & Veg Sufficiency | 25 | min((fruit_servings + veg_servings) × 5, 25) |
| Moderation | 25 | Start 25, −5 per discretionary serving, floor 0. If >5 discretionary servings → 0 |
| Meal Regularity | 20 | 3 meals → +7 each skipped meal → +0. Sum, floor 0. |
10 Food Groups for Diversity Count: (1) Cereals, (2) Pulses/Legumes, (3) Dark Leafy Vegetables, (4) Other Vegetables, (5) Fruits, (6) Milk/Dairy, (7) Eggs, (8) Meat/Fish/Poultry, (9) Nuts/Seeds, (10) Oils/Fats
Respondent A — Ramesh (35, Male, Urban):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Rice, dal, 1 egg | 2 idli, 1 bowl dal, 1 egg |
| Lunch | Rice, chicken curry, leafy veg | 1 plate rice, 1 bowl chicken, ½ bowl greens |
| Snack | Samosa (fried), sugary tea | 2 samosas, 1 tea with 2 tsp sugar |
| Dinner | Roti, dal, curd | 3 roti, 1 bowl dal, 1 cup curd |
Estimated counts: Groups: cereals, pulses, leafy veg, other veg (no fruits listed), dairy, eggs, meat, oils/fats (for samosa frying) = 8 groups. Fruits: 0. Combined F&V: leafy veg (½) = 0.5 servings. Discretionary: 2 samosas (fried) + sugary tea = ~3 discretionary servings. Meals: 3 eaten.
Respondent B — Lakshmi (28, Female, Rural):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Leftover rice, pickle | 1 plate rice |
| Lunch | Rice, dal, one vegetable | 1 plate rice, 1 bowl dal, ½ bowl bhindi |
| Snack | None | — |
| Dinner | Roti, dal | 2 roti, ½ bowl dal |
Estimated counts: Groups: cereals, pulses, other veg = 3 groups. Fruits: 0. F&V: only bhindi (½ serving veg, 0 fruit) = 0.5 servings. Discretionary: 0. Meals: 2 (no snack, dinner is a meal).
Respondent C — Priya (30, Female, Urban):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Vegetable poha, banana | 1 bowl poha, 1 banana |
| Lunch | Rice, fish curry, leafy veg salad | 1 plate rice, 1 bowl fish, 1 bowl salad |
| Snack | Apple, handful of almonds | 1 apple, 15g almonds |
| Dinner | Roti, paneer, green peas sabzi, curd | 2 roti, 1 bowl paneer, ½ bowl peas, ½ cup curd |
Estimated counts: Groups: cereals, other veg (poha veg + peas), fruits (banana + apple), dairy (curd + paneer), meat/fish, nuts/seeds, leafy veg, oils/fats = 8 groups. Fruits: banana + apple = 2 servings. Combined F&V: leafy salad (1) + peas (½) + fruits (2) = 3.5. Discretionary: 0 (paneer not discretionary). Meals: 3.
## Solution Frameworks
Algorithm trace, rule-based scoring system, boundary-case analysis, round-trip verification (manual → code)
## Solver Guidance & Tutorials
Link to: "Manual Algorithm Tracing for Scoring Systems" tutorial
## What You'll Learn
- Executing a multi-rule algorithm manually before coding it
- Detecting ambiguous rules and boundary cases during a trace
- Building confidence that a scoring system produces sensible rankings
- The value of manual verification before automation
## Tags
diet quality index, algorithm tracing, nutrition scoring, public health, manual verification
## Registration Links
- Register as Solver
- Register as Evaluator
Data Sources
DQI Scoring Rules Reference:
| Component | Max Pts | Rule |
|---|---|---|
| Dietary Diversity | 30 | Count distinct food groups (of 10) × 3 |
| Fruit & Veg Sufficiency | 25 | min((fruit_servings + veg_servings) × 5, 25) |
| Moderation | 25 | Start 25, −5 per discretionary serving, floor 0. If >5 discretionary servings → 0 |
| Meal Regularity | 20 | 3 meals → +7 each skipped meal → +0. Sum, floor 0. |
10 Food Groups for Diversity Count: (1) Cereals, (2) Pulses/Legumes, (3) Dark Leafy Vegetables, (4) Other Vegetables, (5) Fruits, (6) Milk/Dairy, (7) Eggs, (8) Meat/Fish/Poultry, (9) Nuts/Seeds, (10) Oils/Fats
Respondent A — Ramesh (35, Male, Urban):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Rice, dal, 1 egg | 2 idli, 1 bowl dal, 1 egg |
| Lunch | Rice, chicken curry, leafy veg | 1 plate rice, 1 bowl chicken, ½ bowl greens |
| Snack | Samosa (fried), sugary tea | 2 samosas, 1 tea with 2 tsp sugar |
| Dinner | Roti, dal, curd | 3 roti, 1 bowl dal, 1 cup curd |
Estimated counts: Groups: cereals, pulses, leafy veg, other veg (no fruits listed), dairy, eggs, meat, oils/fats (for samosa frying) = 8 groups. Fruits: 0. Combined F&V: leafy veg (½) = 0.5 servings. Discretionary: 2 samosas (fried) + sugary tea = ~3 discretionary servings. Meals: 3 eaten.
Respondent B — Lakshmi (28, Female, Rural):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Leftover rice, pickle | 1 plate rice |
| Lunch | Rice, dal, one vegetable | 1 plate rice, 1 bowl dal, ½ bowl bhindi |
| Snack | None | — |
| Dinner | Roti, dal | 2 roti, ½ bowl dal |
Estimated counts: Groups: cereals, pulses, other veg = 3 groups. Fruits: 0. F&V: only bhindi (½ serving veg, 0 fruit) = 0.5 servings. Discretionary: 0. Meals: 2 (no snack, dinner is a meal).
Respondent C — Priya (30, Female, Urban):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Vegetable poha, banana | 1 bowl poha, 1 banana |
| Lunch | Rice, fish curry, leafy veg salad | 1 plate rice, 1 bowl fish, 1 bowl salad |
| Snack | Apple, handful of almonds | 1 apple, 15g almonds |
| Dinner | Roti, paneer, green peas sabzi, curd | 2 roti, 1 bowl paneer, ½ bowl peas, ½ cup curd |
Estimated counts: Groups: cereals, other veg (poha veg + peas), fruits (banana + apple), dairy (curd + paneer), meat/fish, nuts/seeds, leafy veg, oils/fats = 8 groups. Fruits: banana + apple = 2 servings. Combined F&V: leafy salad (1) + peas (½) + fruits (2) = 3.5. Discretionary: 0 (paneer not discretionary). Meals: 3.
| Component | Max Pts | Rule |
|---|---|---|
| Dietary Diversity | 30 | Count distinct food groups (of 10) × 3 |
| Fruit & Veg Sufficiency | 25 | min((fruit_servings + veg_servings) × 5, 25) |
| Moderation | 25 | Start 25, −5 per discretionary serving, floor 0. If >5 discretionary servings → 0 |
| Meal Regularity | 20 | 3 meals → +7 each skipped meal → +0. Sum, floor 0. |
10 Food Groups for Diversity Count: (1) Cereals, (2) Pulses/Legumes, (3) Dark Leafy Vegetables, (4) Other Vegetables, (5) Fruits, (6) Milk/Dairy, (7) Eggs, (8) Meat/Fish/Poultry, (9) Nuts/Seeds, (10) Oils/Fats
Respondent A — Ramesh (35, Male, Urban):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Rice, dal, 1 egg | 2 idli, 1 bowl dal, 1 egg |
| Lunch | Rice, chicken curry, leafy veg | 1 plate rice, 1 bowl chicken, ½ bowl greens |
| Snack | Samosa (fried), sugary tea | 2 samosas, 1 tea with 2 tsp sugar |
| Dinner | Roti, dal, curd | 3 roti, 1 bowl dal, 1 cup curd |
Estimated counts: Groups: cereals, pulses, leafy veg, other veg (no fruits listed), dairy, eggs, meat, oils/fats (for samosa frying) = 8 groups. Fruits: 0. Combined F&V: leafy veg (½) = 0.5 servings. Discretionary: 2 samosas (fried) + sugary tea = ~3 discretionary servings. Meals: 3 eaten.
Respondent B — Lakshmi (28, Female, Rural):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Leftover rice, pickle | 1 plate rice |
| Lunch | Rice, dal, one vegetable | 1 plate rice, 1 bowl dal, ½ bowl bhindi |
| Snack | None | — |
| Dinner | Roti, dal | 2 roti, ½ bowl dal |
Estimated counts: Groups: cereals, pulses, other veg = 3 groups. Fruits: 0. F&V: only bhindi (½ serving veg, 0 fruit) = 0.5 servings. Discretionary: 0. Meals: 2 (no snack, dinner is a meal).
Respondent C — Priya (30, Female, Urban):
| Meal | Foods Consumed | Servings |
|---|---|---|
| Breakfast | Vegetable poha, banana | 1 bowl poha, 1 banana |
| Lunch | Rice, fish curry, leafy veg salad | 1 plate rice, 1 bowl fish, 1 bowl salad |
| Snack | Apple, handful of almonds | 1 apple, 15g almonds |
| Dinner | Roti, paneer, green peas sabzi, curd | 2 roti, 1 bowl paneer, ½ bowl peas, ½ cup curd |
Estimated counts: Groups: cereals, other veg (poha veg + peas), fruits (banana + apple), dairy (curd + paneer), meat/fish, nuts/seeds, leafy veg, oils/fats = 8 groups. Fruits: banana + apple = 2 servings. Combined F&V: leafy salad (1) + peas (½) + fruits (2) = 3.5. Discretionary: 0 (paneer not discretionary). Meals: 3.
Solution Frameworks
Algorithm trace, rule-based scoring system, boundary-case analysis, round-trip verification (manual → code)
Solver Guidance & Tutorials
Link to: "Manual Algorithm Tracing for Scoring Systems" tutorial
What You'll Learn
- Problem-solving and analytical thinking
- Data-driven decision making
- Business strategy development
- Professional report writing
0
Solutions Submitted
Difficulty
Intermediate
Estimated Time
75 minutes
Relevance
Fresh
Source
case-studies-in