DATETHU AUG 13
LESSON1–3 PM
LAB3–4 PM

CODING LESSON 1

AI, coding, and judgment.

Learn what our tools do, why coding is still useful, and how to ask a coding agent for help while keeping the important decisions with the student.

OPEN INSTALLATION LAB →OPEN LAB HANDOUT ↗OPEN SLIDE PDF ↗

WHERE WE BEGIN

We have different starting points.

Some students are writing code for the first time. Others already use R for research. Many have used a chat tool. A coding agent that works inside a project will be new for most of the room. We will use one common project, and each student can take steps that fit their current experience.

01Careful beginner

I need one step before we automate five.

02Curious explorer

The agent made a plot. I want to know what it did.

03Augmented builder

I can read the code. Let the agent do the repetitive part.

04Code-first skeptic

I trust my script. Show me why the agent helps.

05Calendar visitor

I am here. Curiosity may arrive after the coffee.

These descriptions show approximate starting points. Your position can change from one task to another. The lesson gives the room a common language for asking what the tool should do and what the student needs to understand.

THE QUESTION FOR TODAY

What should we delegate, to which system, and with what evidence?

This question replaces a tour of AI brands. We choose the task before the tool, scale autonomy to the consequences of error, and decide what proof will be required before execution begins.

FROM THE PIN FACTORY TO THE CODING AGENT

Adam Smith used the pin factory to show how specialization can raise productivity. AI creates a related coordination problem inside analytical work: a person frames the question, an agent proposes or executes steps, software records the result, and a person verifies and interprets the evidence. The benefit comes from both specialization and a clear handoff. Hayek adds that relevant knowledge is dispersed; Garicano shows how organizations route common and exceptional problems to people with different knowledge. Applied to Math Camp, the agent can handle bounded production, while the student supplies context, recognizes exceptions, and judges the evidence. Source: Adam Smith, The Wealth of Nations, Book I, Chapter I → Source: F. A. Hayek, “The Use of Knowledge in Society” → Source: Luis Garicano, “Hierarchies and the Organization of Knowledge in Production” →

COUNT THE FULL COST OF DELEGATION

Net value of delegation = time saved + quality gain − specification cost − verification cost − expected error cost.
A faster agent does not automatically create a faster workflow. Compare time saved and quality gained with the time required to specify the task, verify the answer, and repair plausible errors. If a WDI calculation saves twenty minutes but definitions, revisions, years, and arithmetic require thirty minutes of review, delegation has not reduced total analytical work. This extends Coase’s transaction-cost insight: compare complete ways of organizing work, not one isolated production step. Source: R. H. Coase, “The Nature of the Firm” (1937) →

A USEFUL TOOL MUST HELP THE RESPONSIBLE PERSON

Linus Torvalds’s intervention in a 2026 Linux code-review discussion moves us past a simple argument about whether AI is useful. His operational test is whether the tool helps maintainers instead of merely creating more work for them. In policy analysis, ask the same questions: Does the agent reduce total work or transfer it to a reviewer? Does it surface errors while they can still be corrected? Can the accountable analyst inspect, accept, or reject the result? Source: Linus Torvalds, “Re: Linking Patchwork with Sashiko?” (2026) →

Welcome + destination

Meet the instructor, recognize the room's different starting points, and name what everyone should be able to do by the end.

Is coding still worth learning?

Separate syntax recall from reading, testing, changing, and explaining consequential instructions.

Divide the analytical work

Use the pin factory to ask who frames, executes, records, verifies, and interprets.

Map the system

Distinguish models, chat, agents, harnesses, R, RStudio, Quarto, and Codex; then choose the tool after the task.

Break

Step away from the screen and return at minute 60.

Protect understanding

Examine the new bottleneck, cognitive debt, and the learner as a second product of the work.

Match autonomy to risk

Use verifiability and potential harm to decide what may be delegated and what must remain a human decision.

Build a live policy briefing

Specify goal, context, permission, and proof; then ask Codex to retrieve current official WDI data and prepare a time-pressured meeting brief while we inspect the work live.

Handoff to Lab 1

Open the project, locate the readiness command, and begin the installation clinic at minute 120.

IS CODING STILL WORTH LEARNING?

Yes. Coding now includes reading proposals, making precise changes, rerunning work, testing results, and preserving the reasoning. Prompting expands what we can attempt. Coding makes consequential instructions inspectable and repeatable.

MODEL, HARNESS, TOOL, HUMAN

Each part of the system has a specific job.

Layer Job Decision left to the student
LLM Generates language, code, or a tool request from context. Whether the policy question matters.
Chat interface Exchanges messages with a model. Whether a response is grounded.
Coding agent Reads, edits, runs, observes, and continues in a loop. Whether its output should be trusted.
Harness Assembles context, exposes tools, enforces permissions, and returns results. Whether the available check tests the right claim.
R Executes specified statistical and data operations. Whether the chosen operation represents the intended concept.
RStudio Keeps scripts, console, objects, files, and plots visible. Whether the code is substantively correct.
Quarto Combines prose, code, figures, and output in a reproducible document. Whether the narrative follows from the evidence.

Workshop analogy. The model is a language engine. The harness is the workshop around it: workbench, toolbox, clipboard, locked cabinets, and measuring instruments. The coding agent is the engine operating inside that workshop. The student remains the investigator who writes the work order, grants access, watches the work, and decides what to keep.

MODELGenerates.

Text, code, or a tool request.

HARNESSConnects.

Context, tools, permissions, and feedback.

AGENTActs.

Reads, proposes, runs, and observes.

INVESTIGATORJudges.

Frames the question and defines proof.

THREE DIFFERENT EMPIRICAL QUESTIONS

Capability asks whether a system can complete a task under specified conditions. Adoption asks whether people actually integrate it into a workflow. Impact asks whether its use changes productivity, quality, learning, or decisions. A benchmark can establish capability under benchmark conditions; it cannot, by itself, establish adoption or impact.

THE NEW BOTTLENECK

When generation becomes cheap, understanding becomes scarce.

Geoffrey Litt distinguishes two forms of understanding. We need to understand enough to verify: Does the code run, match the request, and pass the relevant checks? We also need to understand enough to participate: Why was this approach chosen, what assumptions does it contain, and what question should come next?

Herbert Simon framed the same bottleneck as an allocation problem: information abundance consumes attention. When an agent can produce many plausible analyses cheaply, the scarce resource becomes the analyst’s capacity to select, verify, explain, and integrate them. Source: Herbert Simon, “Designing Organizations for an Information-Rich World” (1971) →

Cognitive debt grows when an investigation changes faster than the people responsible for it can absorb. The code may run while nobody can explain why a filter exists, what a variable means, or how to change the analysis safely. In policy work, this debt weakens the analyst’s capacity to judge whom the result represents and what decision it can inform.

BEFOREPredict and set criteria.

State what should happen and what evidence would count.

DURINGCompare and test.

Inspect the diff, run a small example, and ask why.

AFTERReconstruct and teach back.

Explain the purpose, assumption, expected effect, and one check.

IF UNCLEARReduce the problem.

Ask for a toy example or a quiz before accepting the change.

THE STUDENT STANDARD

Before keeping substantial agent-written code, state its purpose, identify its input and output, name one assumption, predict one consequence of changing it, and run one check that could expose a mistake.

TODAY’S ARTIFACT AND TOMORROW’S CAPABILITY

Today: qt = q(ht, at). Tomorrow: ht+1 = ht + practice + AI scaffolding − displaced practice.
AI assistance can improve today’s script, table, or explanation. Its effect on tomorrow’s capability depends on whether it adds scaffolding and deliberate practice or displaces the practice that maintained the skill. A productive classroom workflow therefore evaluates two outcomes: the artifact students produce now and the work they will be able to understand, modify, and defend later.

TACIT KNOWLEDGE AND PATTERN TRANSFER

Michael Polanyi argued that expert knowledge includes patterns, exceptions, and judgment that cannot always be reduced to a complete explicit rule. Workplace evidence from Brynjolfsson, Li, and Raymond found that AI assistance increased customer- support productivity by 14 percent on average and by 34 percent among novice and lower-skilled workers. One interpretation is that AI helped distribute patterns previously concentrated among experienced workers. The educational question remains whether students also learn when those patterns do not apply. Source: Michael Polanyi, The Tacit Dimension Source: Brynjolfsson, Li, and Raymond, “Generative AI at Work” →

This emphasis on observable action and correction also has a longer history. Norbert Wiener’s account of cybernetics centers communication and feedback: a system can correct only what it can observe. Our classroom protocol turns that systems insight into a practical habit—watch the trace, compare the result with a prediction, and use the discrepancy to revise the next action. Source: Norbert Wiener, Cybernetics (1948) →

SOURCES Adapted and paraphrased from Geoffrey Litt, “Understanding is the New Bottleneck” (2026), and Margaret-Anne Storey, “How Generative and Agentic AI Shift Concern from Technical Debt to Cognitive Debt” (2026).

AN OLDER QUESTION ABOUT NEW COGNITIVE TOOLS

In Plato’s Phaedrus, writing can preserve words while giving a learner only the appearance of wisdom. Aristotle’s Nicomachean Ethics distinguishes technical making from practical wisdom: deliberating well about situations that could be otherwise. The Math Camp translation is concrete. An agent may extend memory and technique, but students still need to question and reconstruct what it produced and decide what should be done, for whom, and under which uncertainty. Source: Plato, Phaedrus 274c–275b → Source: Aristotle, Nicomachean Ethics, Book VI →

BEFORE EXECUTION

Write four things down.

  • 01Goal. What concrete outcome do I want?
  • 02Context. Which files, evidence, definitions, and constraints matter?
  • 03Permission. What may the agent read, change, run, or access?
  • 04Proof. What visible evidence will show completion?
  • Hard to verify
    LOWER HARMExplore, then review.

    Use the output to generate questions and verify them before drawing conclusions.

    HIGHER HARMHuman decides.

    Keep consequential judgment outside the agent.

    Easy to verify
    LOWER HARMDelegate and test.

    Automate with a visible check.

    HIGHER HARMAgent plus gates.

    Require review, assertions, and permission boundaries.

    BOUNDED POLICY-ANALYSIS WORK ORDER
    Goal: Prepare an evidence inventory for this question: How is GDP per capita associated with under-five mortality across countries in 2022?
    Context: Use the shared frozen WDI data and indicator dictionary. Focus on country, year, gdp_per_capita_ppp, and under5_mortality.
    Permission: Read and summarize only. Do not edit or update the data, retrieve new data, or fit a model.
    Constraints: Use association language, flag missing values, and do not invent definitions.
    Proof: Report the unit, variable definitions, 2022 coverage, and three checks the class should complete before analysis.

    This work order asks for an evidence inventory, not a conclusion. A good work order exposes failure, supports supervision, and gives the class a concrete result to verify before fitting a model or making a claim.

    THE FIRST LAB

    Analysis begins after every machine passes the readiness gate.

    Lab 1 is an installation clinic. Every student must open the complete course project, start R, load the required packages, find Quarto, open the frozen data, and confirm that Codex can read the project.

    TERMINALREADINESS GATE
    Rscript code/check_setup.R --codex-confirmed

    Green means ready. Yellow means the automatic checks pass and Codex confirmation remains. Red means repair before analysis. Every unresolved failure leaves with a named next step and a person responsible for follow-up.

    Open the complete installation clinic →

    Students who reach green while repairs continue complete an optional 8–10 minute read-only proof: ask Codex to locate the start instructions, frozen WDI data, and indicator dictionary; verify every reported path manually; and distinguish file evidence from the agent’s inference. This is the first supervised agent exercise, not a submission.

    Open or print the one-page Lab 1 handout →

    SLIDES

    Lesson deck.

    The slide deck is a 16:9 LaTeX Beamer PDF. It follows the same lesson and ends with the installation clinic.

    The first teaching block contains three checkpoints and the second contains two. Every checkpoint reserves two minutes for discussion with nearby classmates and two minutes for whole-room sharing. Block 2 then ends with a live online policy-briefing demonstration. These are opportunities to test an idea and hear another interpretation; there is no submission or grade.

    Your browser cannot display the PDF here. Open the Lesson 1 PDF.

    LESSON 1 / LATEX BEAMER PDFOPEN PDF ↗