Skip to content
Start free

Recompute a claim two procedures agree on

Rerun an AI's $90 for yoga in March, find two different calculations that both give 90, and compute the number the question asked for.

2 parts · 6 and 2 min

Free course. Your Maestro, an AI, .

The gym manager asked an AI: "How much paid yoga revenue did we take in March?" The AI answered $90, with no code attached. When an assistant hands you a bare number, a good first step is to recompute the figure yourself on the underlying table.

Here is the bookings table the AI read, where each row records one class booking:

booking_idclass_namemonthstatusfee
B01Yoga2026-02paid25
B02Yoga2026-03paid20
B03Yoga2026-03refunded25
B04Spin2026-03paid15
B05Yoga2026-03paid25
B06Yoga2026-03paid20
B07Spin2026-02paid15

The manager's question sets three requirements: the class is Yoga, the booking status is paid, and the month is March (2026-03). A refunded booking like B03 ($25) represents money returned to the member, so the gym did not keep that fee as revenue. Booking B01 ($25) is paid yoga, but it took place in February (2026-02).

Read the filter and the sum

In , you can test each requirement step by step:

  1. Filter to one class: yoga = bookings[bookings["class_name"] == "Yoga"] checks where the class column equals "Yoga" and saves those five rows (B01, B02, B03, B05, and B06) in yoga, leaving out the two Spin rows.
  2. Filter and sum a column: yoga[yoga["month"] == "2026-03"]["fee"].sum() takes yoga, keeps the four rows from March (B02, B03, B05, and B06), selects the "fee" column, and adds those numbers with .sum() to get 20 + 25 + 25 + 20 = 90.
  3. Combine two conditions: wrap each condition in parentheses and join them with &, as in table[(table["a"] == 1) & (table["b"] == 2)]. If combining two conditions with & feels unfamiliar, ask your Maestro to walk through how the parentheses work.

Try it

Run the code below: Calculation 1 already prints 90 by summing March yoga bookings of any status. Add a second calculation that sums paid yoga across all months, then a third calculation for paid yoga in March only. If your code hits an error or prints an unexpected number, share your lines with your Maestro.

Your turn

Run the code. Add a calculation for paid yoga across all months, then one for paid yoga in March only. You're done when you have two different calculations that print 90 and one that answers the question.

A good place to stop. Up next: Why matching 90 does not identify the AI's procedure · 2 min

Why matching 90 does not identify the AI's procedure

When all three lines run, the first two print 90 and the third prints 65 (from B02 at $20, B05 at $25, and B06 at $20).

If you had stopped as soon as Calculation 1 printed 90, you might have felt confident that you knew what the AI did: it summed March yoga without filtering out the $25 refund in B03. A colleague who tried Calculation 2 first and also got 90 would have been just as sure that the AI summed paid yoga without filtering out February's $25 booking in B01. Because B01 and B03 both have a fee of 25, leaving out the status filter and leaving out the month filter produce the same total.

Getting 90 on your own rerun only shows compatibility: at least one calculation on the table yields 90. The number alone cannot tell you which calculation the AI ran. To know what the AI computed, ask for the code that produced its answer; to answer the manager's question, write the calculation that enforces all three conditions and report $65.

Check yourself: An AI reports $90 for March paid yoga revenue without showing its code. You run a test on the table that also prints 90. What does that match prove?