Neural Sync Active
Computational Thinking · Week 1 — Variables & representation
Registry Synced
Computational Thinking · Week 1 — Variables & representation
1209 words
6 min read
2026-08-16
Reading compass
Now · Week map
Week 1 — variables & representation
Quiz 2 scope: Weeks 1–8 per IITM May 2026 foundation courses. Source baseline: IITM BS admissions important-dates calendar · May 2026 cycle. Times on assessments are operational conventions — verify hall ticket.
Week map
Problem → variables → datatype → flowchart boxes → trace state
Classify → Represent → Execute → Trap-check
- Recognize: Ask: What does a diamond represent in a flowchart?
- Procedure: Follow arrows from Start. At diamond, one branch taken. Update variables in rectangles before next decision.
- Variations / traps: Watch for: Skipping decision branch label (Y/N).
Formula chain (compressed)
state variables → datatype → assignment updates → flowchart ↔ trace.
- State —
named variables hold values— trace step by step - Assignment —
x ← expression— RHS evaluated first - Iterator —
loop counter / index— repeated steps - Datatype —
int, float, str, bool— legal operations - Flowchart —
boxes + arrows— algorithm before code
Open interactive formula desk · Week 1 tab.
Deep study
Computational Thinking · Week 1 — Variables and state
CT week 1 builds representations: naming quantities, picking datatypes, and tracing state through flowcharts or pseudocode.
Week map
Problem → variables as named state → datatypes → iterators → flowchart symbols → state snapshots → input/output boxes.
Representation notation
- Variable → name bound to a value that may change →
count,total,name. - State → all current variable values at one instant → snapshot table one row per step.
- Iterator → variable stepping through a sequence or count →
ifrom 0 to n-1. - Datatype → kind of value → determines legal operations → number vs string vs list.
Flowchart symbols
| Shape | Role | Example action |
|---|---|---|
| Oval | start / end | Start, Stop |
| Rectangle | process | total ← total + price |
| Diamond | decision | score ≥ 50? |
| Parallelogram | input / output | Read age, Print sum |
Arrow direction defines order. At a diamond, follow one branch label (Y/N or T/F).
Choosing a representation
Ask three questions:
- Single vs collection? One score → number; list of scores → list.
- Fraction allowed? Integer count vs float average.
- Text vs number? ID as string even if digits; phone codes not for arithmetic.
Mini-example: Track 5 quiz scores → list
scores length 5, not five unrelated names unless table fixed.State snapshot tracing
Problem: start
x=3, y=1. Process: y ← x + y, then x ← y - 2.| step | x | y |
|---|---|---|
| init | 3 | 1 |
| after 1st | 3 | 4 |
| after 2nd | 2 | 4 |
Read as: assignment uses current values when evaluating right-hand side.
Pattern families
Easy — Read flowchart step
- Follow arrows; update rectangles; branch at diamond once.
- Identify start/end and missing arrow bugs in diagrams.
- Match parallelogram to Read/Print in trace.
Medium — Choose datatype and names
- From word problem, list variables and types.
- Distinguish index (position) vs value at index.
- Flowchart with two variables swapping — track both columns.
Hard — Full state table
- Multi-step with decision: duplicate row only along taken branch.
- Iterator introduced mid-flow: when does
iincrement? - Detect unreachable rectangle (no arrow in).
Worked mini-examples
Example 1 — Simple trace.
Start
a=10, b=2. a ← a - b → a=8. b ← a + b → b=10.Example 2 — Decision.
n=7. Diamond: n > 5? Yes → msg ← "big". Else branch skipped. msg is "big".Example 3 — Iterator intro.
i=0, sum=0. Loop body: sum ← sum + i, i ← i + 1, repeat while i < 4.| i | sum after step |
|---|---|
| 0 | 0 |
| 1 | 0 |
| 2 | 1 |
| 3 | 3 |
| 4 | 6 |
Loop stops when
i becomes 4.Example 4 — Wrong type choice.
Storing
price = "12.50" then total = price + 5 concatenates strings in Python-like semantics — representation error if numeric total intended.Traps
- Skipping decision branch label — both paths mentally.
- Same name for two concepts (
totalfor both count and sum). - Using value before rectangle that assigns it.
- Iterator confused with stored data value (
ivsitem[i]). - Flowchart arrow bypassing update rectangle.
Diagnostic (try yourself)
-
Start
p=5,q=3. Executep ← p + qthenq ← p - q. What are finalpandq? -
A flowchart diamond asks
x < 0. Ifx = 0, which branch (Y/N) is taken for “less than zero”? -
You need to store a student’s 8 weekly quiz percentages. One variable or a collection? Which datatype class?
-
Trace
c=1,d=4, thenc ← d,d ← c. What arecandd? (Watch order.) -
In a state table, why duplicate rows only on the taken branch after a decision?
ChatGPT prep archive
Archived import for extra depth — complements the notes above, not official IITM material.
Core concepts
- Variable names a value that can change; iterator often counts or walks a collection.
- Datatypes: number, string, boolean, list—operations depend on type.
- Flowchart: start/end ovals, process boxes, decision diamonds, arrows show order.
- State snapshot: all variable values at one step.
Notation & vocabulary
| Flowchart | Meaning |
|---|---|
| Rectangle | process / assign |
| Diamond | decision |
| Parallelogram | input/output |
Pattern families
Easy — Read flowchart step
Follow arrows from Start. At diamond, one branch taken. Update variables in rectangles before next decision.
Medium — Choose representation
Pick variable names for quantities in word problem. Decide int vs float vs list based on whether fractional, textual, or collective data.
Hard — State table trace
Columns for each variable; rows for each step. Decision rows branch—duplicate state only along taken path.
Drill these on the pattern atlas — filter to week 1.
Traps
- Skipping decision branch label (Y/N).
- Same variable name for different concepts.
- Flowchart arrow bypassing a required update.
- Confusing iterator index with value stored.
Retrieval prompts
- What does a diamond represent in a flowchart?
- What is a state snapshot?
- When represent data as list vs single variable?
Practice loop
- Read Deep study (if present) or core concepts once.
- Recite the formula chain without looking.
- Open one easy pattern on the interactive atlas for week 1.
- Attempt without solutions; mark studied after an honest try.
- Say one trap aloud before closing the tab.