SECTION 27 / 31

Turn “usually buys there” into a precise check

1 min read
Ahmed’s Food bills 18,20,29 are from SV Stores. Bill25 is non-food, so exclude it from the Food-bill check.
Ahmed’s Food bills 18,20,29 are from SV Stores. Bill25 is non-food, so exclude it from the Food-bill check.
REAL COURSE DATA · KEYS, COUNTS AND CONNECTIONS

Check food bills against the top food shop

Follow the dictionary as its keys and values change. Predict each lookup or update before revealing the next step.

Ready

CURRENT RECORD / VALUE

Ready to begin

No records have been processed. Start with Next step.

What we remember

Processed
0

Predict the next key, whether it already exists, and the value that will be stored.

A vague statement such as “top food buyers shop at the top food shop” needs a rule. We test one explicit all-bills version: for the selected customer, EVERY observed bill containing at least one Food row must be from a shop tied for highest total Food rows. First compute top shops from the full dataset. Then inspect the selected customer’s saved bill IDs.

Ahmed’s Food bills 18,20,29 all come from SV Stores, so his three eligible bills support that rule. Bill 25 is from Sun General but contains no Food rows, so it is excluded. Akshaya has Food bills 3,5,21: Bill 5 comes from Big Bazaar, so the ALL-bills rule fails for her. Abhinav has one eligible Food bill, Bill 11 at SV Stores.

“Usually” could instead mean a majority of Food bills, a majority of Food rows, or a majority of Food spending. Those are different denominators and different hypotheses. Choose before checking. For a selected customer with no eligible Food bill, report “no eligible evidence”; do not call it observed support just because there is no counterexample.

Try it yourself

Why is Ahmed’s Bill25 excluded?

Show explained answer

It contains no Food rows, so it is irrelevant to this explicitly food-bill-based rule.

Try it yourself

Does one counterexample reject an every-eligible-bill rule?

Show explained answer

Yes. Akshaya’s Food-containing Big Bazaar bill is a counterexample.

Try it yourself

Does Ahmed’s result prove future shopping behavior?

Show explained answer

No. It describes the supplied observed bills under the chosen rule.

YOUR STUDY PROGRESS

Finished this section? Save your progress.

Back to top ↑