Skip to content

Latest commit

 

History

History
684 lines (541 loc) · 16.8 KB

File metadata and controls

684 lines (541 loc) · 16.8 KB

Binary Math Education System - Example Scenarios

Purpose: Real-world usage examples and expected outputs Version: 1.0 Date: 2025-10-15


Scenario 1: Beginner Student - First Session

Context

  • Student: Alice (ID: alice_001)
  • Experience: Complete beginner
  • Session: First time using the system

Session Flow

# Initialize system
system = BinaryEducationSystem()
session = system.start_practice_session("alice_001")

# System generates first problem (beginner level)
problem = system.get_next_problem("alice_001", session.session_id)

Problem Generated:

Type: DECIMAL_TO_BINARY
Difficulty: BEGINNER
Question: "Convert 5 to binary"
Solution: "101"

Student's First Attempt:

# Alice doesn't know how to start
hint1 = system.get_hint(problem.id, 1)
print(hint1)
# Output: "Convert by repeatedly dividing by 2 and tracking remainders"

# Still confused, requests second hint
hint2 = system.get_hint(problem.id, 2)
print(hint2)
# Output: "Start: 5 ÷ 2 = 2 remainder 1"

# Now understands, works it out
# 5 ÷ 2 = 2 remainder 1
# 2 ÷ 2 = 1 remainder 0
# 1 ÷ 2 = 0 remainder 1
# Reading bottom to top: 101

result = system.submit_answer(
    student_id="alice_001",
    problem_id=problem.id,
    answer="101",
    hints_used=2
)

Feedback:

Correct: True
Score: 100% (with 2 hints used)
Feedback: "Great work! You correctly converted 5 to binary (101).
          Try the next one with fewer hints!"

Progress After First Problem

progress = system.get_student_progress("alice_001")
print(progress)

Output:

Student Progress Report
========================
Student ID: alice_001
Total Problems Attempted: 1
Total Correct: 1
Success Rate: 100.0%
Hints Used: 2
Efficiency Score: 33.3

Mastery Levels:
  DECIMAL_TO_BINARY: 20.0 (needs more practice)

Recommendations:
  - Continue with DECIMAL_TO_BINARY problems at BEGINNER level
  - Try to use fewer hints on the next problem

Scenario 2: Intermediate Student - Mixed Practice

Context

  • Student: Bob (ID: bob_042)
  • Experience: Completed 50 problems, 75% success rate
  • Strong in: Binary conversion
  • Weak in: Truth tables

Session Flow

# Bob starts a new session
session = system.start_practice_session("bob_042")

# System analyzes Bob's history and identifies weak area
problem = system.get_next_problem("bob_042", session.session_id)

Problem Generated:

Type: TRUTH_TABLE_FROM_EXPRESSION
Difficulty: BEGINNER (lowered due to weak area)
Question: "Create a truth table for: A AND B"

Bob's Attempt:

# Bob creates the truth table
student_table = [
    TruthTableRow({"A": False, "B": False}, False),
    TruthTableRow({"A": False, "B": True}, False),
    TruthTableRow({"A": True, "B": False}, False),
    TruthTableRow({"A": True, "B": True}, True),
]

result = system.validate_truth_table("A AND B", student_table)
print(result.get_detailed_feedback())

Output:

Score: 100.0% (4/4 correct)

Great job! Your truth table is completely correct.
AND requires both inputs to be 1 for the output to be 1.

Next: Try a slightly more complex expression.

Next Problem (Difficulty Increased):

Type: TRUTH_TABLE_FROM_EXPRESSION
Difficulty: BEGINNER
Question: "Create a truth table for: A OR B"

Bob's Second Attempt:

student_table = [
    TruthTableRow({"A": False, "B": False}, False),
    TruthTableRow({"A": False, "B": True}, True),
    TruthTableRow({"A": True, "B": False}, True),
    TruthTableRow({"A": True, "B": True}, True),
]

result = system.validate_truth_table("A OR B", student_table)

Output:

Score: 100.0% (4/4 correct)

Excellent! You're showing mastery of basic logic gates.
Ready to move to more complex expressions with 3 variables?

Scenario 3: Advanced Student - Challenge Mode

Context

  • Student: Carol (ID: carol_999)
  • Experience: Completed 200 problems, 90% success rate
  • Mastery: All basic topics mastered
  • Current Level: Advanced

Session Flow

session = system.start_practice_session("carol_999")
problem = system.get_next_problem("carol_999", session.session_id)

Problem Generated:

Type: EXPRESSION_SIMPLIFICATION
Difficulty: ADVANCED
Question: "Simplify: (A AND B) OR (NOT A AND B)"
Solution: "B"

Carol's Approach (No Hints):

# Carol analyzes the expression:
# (A AND B) OR (NOT A AND B)
# Factor out B: B AND (A OR NOT A)
# Since (A OR NOT A) is always True: B AND True = B

result = system.submit_answer(
    student_id="carol_999",
    problem_id=problem.id,
    answer="B",
    hints_used=0
)

Output:

Correct: True
Score: 100% (no hints used - perfect!)
Feedback: "Excellent simplification! You correctly identified that
          (A OR NOT A) is always true, reducing the expression to B.
          This shows strong understanding of boolean algebra."

Time taken: 45 seconds
Efficiency: 100%

Next Problem (Even Harder):

Type: TRUTH_TABLE_FROM_EXPRESSION
Difficulty: ADVANCED
Question: "Create a truth table for: NOT((A AND B) OR (C XOR D))"
Variables: 4 (A, B, C, D)
Rows: 16

Scenario 4: Struggling Student - Intervention Needed

Context

  • Student: Dave (ID: dave_111)
  • Experience: 30 problems attempted, 45% success rate
  • Issue: Consistently confuses AND with OR
  • Hints Used: Average 2.8 per problem

Session Flow

session = system.start_practice_session("dave_111")
problem = system.get_next_problem("dave_111", session.session_id)

System Analysis:

Warning: Student dave_111 showing persistent difficulties
Success rate: 45% (below 70% threshold)
Common error: AND/OR confusion detected in 8 of last 10 problems
Recommendation: Provide focused remedial practice

Problem Generated:

Type: SIMPLE_GATE
Difficulty: BEGINNER (reduced from intermediate)
Question: "Evaluate: A AND B when A=1, B=0"
Special: Pre-hint enabled

Pre-emptive Guidance:

Before you answer, remember:
  AND means BOTH inputs must be 1 for the output to be 1
  If even one input is 0, the output is 0

Now evaluate: A=1, B=0
What is A AND B?

Dave's Answer:

result = system.submit_answer(
    student_id="dave_111",
    problem_id=problem.id,
    answer=0,  # Correct!
    hints_used=0
)

Output:

Correct: True
Score: 100%
Feedback: "Great! You correctly identified that A AND B = 0 when B=0.
          Remember: AND requires BOTH to be 1.
          Let's try a few more AND problems to reinforce this."

Next 3 Problems (Focused Practice):

1. "Evaluate: A AND B when A=1, B=1"  (Expected: 1)
2. "Evaluate: A AND B when A=0, B=0"  (Expected: 0)
3. "Evaluate: A AND B when A=0, B=1"  (Expected: 0)

After Focused Practice:

Success rate on AND problems: 100% (4/4)
Recommendation: Now introduce OR to contrast with AND

Scenario 5: Truth Table Validation with Errors

Context

  • Student creates truth table with mistakes
  • System provides detailed feedback

Student's Submission

Expression: A AND B OR C Student's Table:

A | B | C | Result
--|---|---|-------
0 | 0 | 0 |   0    ✓
0 | 0 | 1 |   1    ✓
0 | 1 | 0 |   1    ✗ (should be 0)
0 | 1 | 1 |   1    ✓
1 | 0 | 0 |   0    ✓
1 | 0 | 1 |   1    ✓
1 | 1 | 0 |   1    ✓
1 | 1 | 1 |   1    ✓

System Validation

result = validator.validate("A AND B OR C", student_table)
print(result.get_detailed_feedback())

Output:

Score: 87.5% (7/8 correct)

Errors:
  - Row 2: Expected output 0, got 1
    When A=0, B=1, C=0:
    A AND B = 0 AND 1 = 0
    0 OR C = 0 OR 0 = 0

Suggestions:
  - Remember order of operations: AND before OR
  - The expression is evaluated as: (A AND B) OR C
  - When A=0, the AND will always produce 0, regardless of B

Try again with this in mind!

Scenario 6: Complete Session Summary

Context

  • Student completes a full practice session
  • System generates comprehensive summary

Session Details

session = PracticeSession(
    session_id="session_20251015_001",
    student_id="alice_001",
    start_time=datetime(2025, 10, 15, 14, 0, 0),
    end_time=datetime(2025, 10, 15, 14, 45, 0),
    problems_attempted=["prob_001", "prob_002", "prob_003", "prob_004", "prob_005"],
    problems_correct=4
)

Summary Output

================================================================================
                         PRACTICE SESSION SUMMARY
================================================================================

Student: alice_001
Date: 2025-10-15
Duration: 45 minutes

PERFORMANCE
-----------
Problems Attempted: 5
Problems Correct: 4
Success Rate: 80.0%
Average Time per Problem: 9 minutes

PROBLEMS BREAKDOWN
------------------
1. Convert 5 to binary                          ✓ (2 hints, 12 min)
2. Convert 13 to binary                         ✓ (1 hint, 8 min)
3. Convert 1010 to decimal                      ✓ (0 hints, 6 min)
4. Truth table for: A AND B                     ✓ (0 hints, 10 min)
5. Truth table for: A OR B OR C                 ✗ (3 hints, 9 min)

MASTERY PROGRESS
----------------
Decimal to Binary:     ████████░░  80% (Intermediate)
Binary to Decimal:     ██████████ 100% (Mastered!)
Truth Tables:          ████░░░░░░  40% (Needs Practice)

RECOMMENDATIONS
---------------
✓ Great improvement on binary conversions!
✓ You've mastered binary to decimal - excellent work!
⚠ Truth tables need more practice, especially with 3+ variables
→ Next session: Focus on truth table fundamentals

NEXT STEPS
----------
1. Review truth table structure (variables, rows, outputs)
2. Practice with simple 2-variable expressions
3. Gradually increase to 3 variables
4. Try to use fewer hints by working problems on paper first

ACHIEVEMENT UNLOCKED
--------------------
🏆 "Binary Basics" - Correctly converted 3 binary numbers in a row!

Keep up the great work!
================================================================================

Scenario 7: Problem Type Distribution

Context

  • System ensures variety in problem types
  • Tracks distribution over multiple sessions

Distribution Example

Student: eve_555 Last 20 Problems:

Problem Type Distribution
=========================

Decimal to Binary:     ████░░ (6) - 30%
Binary to Decimal:     ███░░░ (5) - 25%
Binary Addition:       ███░░░ (4) - 20%
Simple Logic Gate:     ██░░░░ (3) - 15%
Truth Tables:          ██░░░░ (2) - 10%

Difficulty Distribution
=======================

Beginner:       ████░░ (8) - 40%
Intermediate:   ██████ (9) - 45%
Advanced:       ███░░░ (3) - 15%

Hint Usage Trend
================

Last 5 problems:  2.4 avg hints/problem ↓ (improving!)
Last 10 problems: 2.7 avg hints/problem
Last 20 problems: 3.1 avg hints/problem

Success Rate Trend
==================

Last 5 problems:  80% ↑
Last 10 problems: 75%
Last 20 problems: 70%

Trend: IMPROVING - Keep it up!

Scenario 8: Instructor Analytics Dashboard

Context

  • Instructor views class-wide analytics
  • Identifies students who need help

Analytics Output

================================================================================
                      CLASS ANALYTICS DASHBOARD
================================================================================

Course: CS 101 - Introduction to Computing
Period: October 1-15, 2025
Total Students: 25

CLASS PERFORMANCE
-----------------
Total Problems Generated: 847
Total Problems Attempted: 823
Overall Success Rate: 73.4%
Average Hints per Problem: 1.8

TOP PERFORMERS
--------------
1. carol_999    95% success rate  (210 problems)
2. bob_042      88% success rate  (156 problems)
3. alice_001    82% success rate  (89 problems)

STUDENTS NEEDING ATTENTION
---------------------------
⚠ dave_111      45% success rate  (Intervention triggered)
⚠ frank_222     52% success rate  (Below threshold)
⚠ grace_333     58% success rate  (Inconsistent performance)

PROBLEM TYPE PERFORMANCE
------------------------
Binary Conversion:        82% avg success  ████████░░
Truth Tables:             65% avg success  ██████░░░░
Logic Expressions:        71% avg success  ███████░░░
Binary Arithmetic:        78% avg success  ████████░░

MOST CHALLENGING PROBLEMS
--------------------------
1. "Simplify: (A AND B) OR (NOT A AND B)"     32% success
2. "Truth table for: NOT(A XOR B) AND C"      41% success
3. "Convert 247 to binary"                     47% success

COMMON ERROR PATTERNS
---------------------
1. AND/OR confusion                (23% of errors)
2. Order of operations mistakes    (18% of errors)
3. NOT operator misapplication     (15% of errors)
4. Binary carry errors             (12% of errors)

ENGAGEMENT METRICS
------------------
Average Session Duration: 38 minutes
Average Problems per Session: 6.2
Students Active Today: 18 (72%)
Students with 100% attendance: 12 (48%)

RECOMMENDATIONS FOR INSTRUCTORS
-------------------------------
1. Schedule review session on AND vs OR operations
2. Provide additional resources on order of operations
3. Meet with 3 students flagged for intervention
4. Consider peer tutoring program (pair top performers with struggling students)

================================================================================

Scenario 9: Adaptive Difficulty Example

Context

  • System adjusts difficulty based on performance
  • Real-time adaptation demonstration

Session Progression

Problem 1 (Beginner):
  Question: Convert 7 to binary
  Result: Correct ✓ (no hints)
  Time: 30 seconds
  → System: "Great start! Increasing difficulty slightly..."

Problem 2 (Beginner):
  Question: Convert 15 to binary
  Result: Correct ✓ (no hints)
  Time: 45 seconds
  → System: "Excellent! You're ready for intermediate problems."

Problem 3 (Intermediate):
  Question: Convert 67 to binary
  Result: Correct ✓ (1 hint)
  Time: 90 seconds
  → System: "Good work! Maintaining intermediate level."

Problem 4 (Intermediate):
  Question: What is 1011 + 0110 in binary?
  Result: Incorrect ✗ (2 hints)
  Time: 120 seconds
  → System: "Let's review addition. Staying at intermediate."

Problem 5 (Intermediate):
  Question: What is 0101 + 0011 in binary?
  Result: Correct ✓ (1 hint)
  Time: 75 seconds
  → System: "Better! Let's try one more intermediate problem."

Problem 6 (Intermediate):
  Question: What is 1100 + 0101 in binary?
  Result: Correct ✓ (no hints)
  Time: 60 seconds
  → System: "Perfect! Ready to advance to advanced level."

Problem 7 (Advanced):
  Question: What is 11010110 + 01011101 in binary?
  Result: Correct ✓ (1 hint)
  Time: 180 seconds
  → System: "Excellent work on this advanced problem!"

Difficulty Progression Graph:
Beginner     Intermediate                    Advanced
[2] ───────→ [4] ───────────────────────────→ [1]
    ↑increase    ↑maintain (with 1 decrease)     ↑advance

Scenario 10: Hint Progression Example

Context

  • Student uses all three levels of hints
  • Shows progressive disclosure in action

Problem

Convert 29 to binary

Interaction Flow

Student: "I don't know how to start."
[Requests Hint 1]

HINT 1 (Concept Nudge):
─────────────────────
"Convert by repeatedly dividing by 2 and tracking remainders.
Keep dividing until you reach 0, then read the remainders from bottom to top."

Student: "I still don't understand the process."
[Requests Hint 2]

HINT 2 (Methodological Guide):
───────────────────────────────
"Let's start together:
Step 1: 29 ÷ 2 = 14 remainder 1
Now you continue: divide 14 by 2, then keep going..."

Student: "I got 14 ÷ 2 = 7 remainder 0, but I'm not sure what's next."
[Requests Hint 3]

HINT 3 (Near-Complete Solution):
─────────────────────────────────
"Here's most of the work:
29 ÷ 2 = 14 remainder 1
14 ÷ 2 = 7  remainder 0
7  ÷ 2 = 3  remainder 1
3  ÷ 2 = 1  remainder 1

Now complete the last step: 1 ÷ 2 = ?
Then read all remainders from bottom to top."

Student: "Oh! 1 ÷ 2 = 0 remainder 1
Reading bottom to top: 11101"
[Submits: "11101"]

RESULT:
───────
✓ Correct!
Score: 100% (with 3 hints used - penalty: -30%)
Final Score: 70%

Feedback: "You got the correct answer! The binary representation of 29 is 11101.
Try to work through more problems to build confidence. With practice,
you'll need fewer hints!"

These scenarios demonstrate:

  • Complete student journeys from beginner to advanced
  • System adaptation and personalization
  • Error detection and feedback
  • Progress tracking and analytics
  • Real-world usage patterns
  • Instructor insights

Use these examples as reference for expected system behavior and user experience design.