---
title: "Association rules, support, confidence"
subject: "Data Mining"
chapter: 4
key: "semester_7/data_mining:association-rule-support-confidence"
source: https://www.bctengineer.com/q/semester_7/data_mining/association-rule-support-confidence
site: BCT Engineering
---

# Association rules, support, confidence

Data Mining · Chapter 4: Association Analysis

- Asked in: year not given
- Video: [Market Basket Analysis [Association Analysis]](https://www.youtube.com/watch?v=icGS26TS1fE) — numiqo
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/data_mining/association-rule-support-confidence
- Whole chapter: https://www.bctengineer.com/md/semester_7/data_mining/chapter-4

## Question

Explain Association rule mining with example. Define Support, frequent item set and confidence with example.

## Short answer

Association rule mining finds rules X→Y in transactions. Support = P(X∪Y) = fraction of transactions containing both. Confidence = P(Y|X) = support(X∪Y)/support(X). Frequent itemset has support ≥ min_sup. Example: 5 transactions, {bread}→{milk} has support 3/5=60%, confidence 3/4=75%.

## Answer

**Association rule mining** finds frequent patterns, associations and correlations among items in transaction databases. An association rule has the form X → Y, where X and Y are disjoint itemsets, and it means "transactions that contain X tend to contain Y".

*Example*: market-basket analysis finds {bread, butter} → {milk}.

#### Definitions
Consider these 5 transactions: T1 {bread, milk}; T2 {bread, butter, milk}; T3 {bread, butter}; T4 {milk, butter}; T5 {bread, butter, milk}.

- **Itemset**: a set of items; a k-itemset has k items. 
- **Support count** σ(X): number of transactions containing X. σ({bread, milk}) = 3.
- **Support** of a rule X → Y: s = σ(X ∪ Y)/N, the fraction of transactions containing both X and Y. It shows how often the rule applies.
- **Confidence** of X → Y: c = σ(X ∪ Y)/σ(X), how often Y appears in transactions containing X. It shows reliability.
- **Frequent itemset**: an itemset whose support is at least the user-given minimum support (min_sup).
- **Strong rule**: a rule satisfying both min_sup and min_conf.

#### Numerical illustration
For {bread} → {milk}: σ(bread, milk) = 3, σ(bread) = 4, N = 5.
- Support = 3/5 = 60%
- Confidence = 3/4 = 75%

If min_sup = 40% and min_conf = 70%, then the rule is strong.

#### Mining steps
1. Find all frequent itemsets (Apriori, FP-growth).
2. Generate strong rules from each frequent itemset: for each non-empty proper subset X of itemset L, output X → (L − X) if σ(L)/σ(X) ≥ min_conf.

Rules can also be checked using **lift** = confidence/support(Y), to remove misleading rules.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How is the support of rule X -> Y defined?
   A. sigma(X union Y) / N, the fraction of transactions containing both X and Y
   B. sigma(X union Y) / sigma(X)
   C. sigma(Y) / N
   D. sigma(X) / sigma(Y)
   Answer: A. Support measures how often the whole rule applies in the data. (Key point: Support of rule)

2. What does confidence of X -> Y measure?
   A. How often X and Y appear in the whole database
   B. How often Y appears in transactions that contain X
   C. How often X appears in transactions containing Y
   D. Whether X and Y are independent
   Answer: B. Confidence = sigma(X union Y)/sigma(X), a measure of reliability. (Key point: Confidence)

3. For bread -> milk with sigma(bread, milk) = 3, sigma(bread) = 4, N = 5, what are support and confidence?
   A. Support 75%, confidence 60%
   B. Support 60%, confidence 60%
   C. Support 60%, confidence 75%
   D. Support 80%, confidence 75%
   Answer: C. Support = 3/5 = 60% and confidence = 3/4 = 75%. (Key point: Numerical check)

4. What is a strong rule?
   A. A rule with confidence 100%
   B. A rule with lift greater than 1
   C. A rule with support above 50%
   D. A rule satisfying both min_sup and min_conf
   Answer: D. Strong rules meet both user-defined thresholds. (Key point: Strong rule)

## Related in Data Mining

- [Apriori on HotDogs data with rules](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aapriori-hotdogs-rules) — Data Mining, chapter 4
- [Apriori on 8 transactions, 25% support](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aapriori-b65-transactions) — Data Mining, chapter 4
- [Association mining on varied data types](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aassoc-categorical-sequential-stream) — Data Mining, chapter 4
- [Apriori on t1-t5 with rules](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aapriori-t1-t5-rules) — Data Mining, chapter 4
- [Association analysis and Apriori pruning](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aassociation-apriori-pruning) — Data Mining, chapter 4, asked 2×
- [Ten golden rules for KDD environment](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Akdd-ten-golden-rules) — Data Mining, chapter 1

## Related in other subjects

- [Rules of inference: Sunday test in MFC](https://www.bctengineer.com/question.md?key=semester_4%2Fdiscrete_structure%3Arules-inference-sunday-test) — Discrete Structure, chapter 1
