Description
🧠 Computational Thinking Week 4 Graded Assignment
Versions: v1_t12022, v2_t12023, v3_t12024 —
All versions feature advanced problems focused on identifying when nested loops are necessary and debugging complex, multi-layered procedures.
This downloadable PDF bundle provides complete step-by-step solutions for Week 4 of “Computational Thinking for Data Science.” This module deepens algorithmic knowledge by exploring algorithmic complexity, nested iteration, and defining helper Procedures (functions) for specialized tasks.
Question Breakdown (10 Core Problem Parts):
- Q1: Necessity of Nested Loops (MSQ): Identify scenarios requiring nested iteration (
O(n²)), such as:- Finding the pair of students who share the same birthday.
- Finding the pair of students who scored the same marks in Physics.
- Finding words with at least two vowels (outer loop for words, inner loop for letters).
Contrasted with scenarios solvable in
O(n). - Q2 & Q6: Nested Loop/Procedure for Substring Count (MCQ): Analyze procedures using
O(n × m)logic:- Q2: Count words without any vowels (inner loop checks each letter).
- Q6: Use flag logic to count words with no consecutive vowels or consonants.
- Q3 & Q10: Paired Comparison Debugging (MSQ): Debug nested loop procedures comparing record pairs:
- Q3: Count player pairs with different medals in the same sport.
- Q10: Count book pairs with same genre/year but different languages. Debug flags
B, C, D.
- Q4: Conditional Counting within Iteration (MCQ): Use helper procedure to count max books per author. Variable
Ais re-initialized and compared againstN. - Q5: Author/Entity Counting (MCQ): Count distinct authors using a filtered pile (
Table 2) to skip duplicates. - Q7: Procedure and Flag Logic (MSQ): Debug procedure counting conjugate word pairs (same vowel/consonant count). Validate
vCount(X) = vCount(Y). - Q8: Procedural Goal (MCQ): Analyze
DoSomethingto compareC - D(Chemistry mark range) againstB. Output isTrueif range is less thanB. - Q9: Conditional Debugging with Range (MSQ): Count nouns with letter count in inclusive range (e.g.,
4to8). Debug return logic for non-noun cases. - Q11: Order Dependency & Tie-Breakers (MSQ): Analyze max-finding logic in Library dataset. Max value
Ais order-independent; labelNis order-sensitive due to tie-breakers.
File Format & Compatibility:
- File Type: PDF (Portable Document Format)
- v1_t12022 to v3_t12024: Each version is approx. 5 MB (18–20 pages)
- Solutions include detailed flowcharts, explanations of
O(n²)vs.O(n)complexity, and rigorous breakdowns of logic errors in flag initialization and updates. - Optimized for the IIT Madras BS Degree program (Foundation/Diploma Level)








Reviews
There are no reviews yet.