# கணச் செயல்பாட்டுக் கணிப்பான்

> Union, intersection, differences and symmetric difference of two sets of numbers or words, with the Jaccard index and a Venn diagram.

ஊடாடும் பதிப்பு: https://www.calcopenly.com/ta/math/set-operations-calculator
பாடப்பிரிவு: கணிதக் கணிப்பான்கள்

The calculator treats each list as a set, dropping repeats, and compares the two. The union A ∪ B holds everything in either set, the intersection A ∩ B what is in both, the differences A − B and B − A what is in one but not the other, and the symmetric difference A △ B what is in exactly one. The Jaccard index |A ∩ B| ÷ |A ∪ B| scores the overlap from 0 for disjoint sets to 1 for identical ones.

Comparing customer or email lists, finding shared tags, checking what one version of a list adds or removes, and discrete-mathematics homework are typical uses. The default sets {1, 2, 3, 4, 5} and {4, 5, 6, 7} share 2 of their 7 distinct items, so the Jaccard index is 2/7 ≈ 0.2857.

Items can be numbers or words, separated by commas, semicolons, new lines or spaces. Numbers are compared by value, so 1 and 1.0 are one item; words must match exactly, including capital letters. Results list numbers in order, then words alphabetically.

## உள்ளீடுகள்

- **Set A**: Separate items with commas, semicolons or new lines (or spaces if you use none of those). Numbers like 1 and 1.0 count as the same item.
- **Set B**

## முடிவுகள்

- Union A ∪ B — முதன்மை முடிவு
- Intersection A ∩ B
- Difference A − B
- Difference B − A
- Symmetric difference A △ B
- |A|
- |B|
- |A ∪ B|
- |A ∩ B|
- Jaccard index |A ∩ B| / |A ∪ B|

## சூத்திரம்

$$
\begin{gathered} A \cup B = \{x : x \in A \lor x \in B\} \\[6pt] A \cap B = \{x : x \in A \land x \in B\} \\[6pt] A \mathbin{\triangle} B = (A \setminus B) \cup (B \setminus A) \end{gathered}
$$

## தீர்க்கப்பட்ட எடுத்துக்காட்டுகள்

### {1, 2, 3, 4, 5} and {4, 5, 6, 7}

- Set A: 1, 2, 3, 4, 5
- Set B: 4, 5, 6, 7
- **Union A ∪ B: {1, 2, 3, 4, 5, 6, 7}**
- **Intersection A ∩ B: {4, 5}**
- **Difference A − B: {1, 2, 3}**
- **Difference B − A: {6, 7}**
- **Symmetric difference A △ B: {1, 2, 3, 6, 7}**
- **|A ∪ B|: 7**
- **Jaccard index |A ∩ B| / |A ∪ B|: 0.285714**
- சரிபார்ப்பின் மூலம்: Python set operators |, &, -, ^ on {1,2,3,4,5} and {4,5,6,7}; 2/7 = 0.285714

### Words with one item in common

- Set A: apple, banana, cherry
- Set B: banana, date
- **Union A ∪ B: {apple, banana, cherry, date}**
- **Intersection A ∩ B: {banana}**
- **Symmetric difference A △ B: {apple, cherry, date}**
- **Jaccard index |A ∩ B| / |A ∪ B|: 0.25**
- சரிபார்ப்பின் மூலம்: Python set operators on string sets, sorted()

### Disjoint sets (edge case)

- Set A: 1, 3, 5
- Set B: 2, 4, 6
- **Intersection A ∩ B: ∅**
- **|A ∩ B|: 0**
- **Union A ∪ B: {1, 2, 3, 4, 5, 6}**
- **Jaccard index |A ∩ B| / |A ∪ B|: 0**
- சரிபார்ப்பின் மூலம்: Python: {1,3,5} & {2,4,6} == set()

### Equal numbers written differently

- Set A: 1, 1.0, 2
- Set B: 2.00, 3
- **|A|: 2**
- **Intersection A ∩ B: {2}**
- **Union A ∪ B: {1, 2, 3}**
- சரிபார்ப்பின் மூலம்: Python: {Decimal('1'), Decimal('1.0'), Decimal('2')} has 2 elements; Decimal('2.00') == Decimal('2')

### Empty set A (edge case)

- Set B: x, y
- **Union A ∪ B: {x, y}**
- **Intersection A ∩ B: ∅**
- **Difference A − B: ∅**
- **Difference B − A: {x, y}**
- **|A|: 0**
- **Jaccard index |A ∩ B| / |A ∪ B|: 0**
- சரிபார்ப்பின் மூலம்: Set identities: ∅ ∪ B = B, ∅ ∩ B = ∅, B − ∅ = B

### Space-separated, numbers sorted before words

- Set A: b 10 a 2
- Set B: 10 c
- **Union A ∪ B: {2, 10, a, b, c}**
- **Intersection A ∩ B: {10}**
- **Difference A − B: {2, a, b}**
- சரிபார்ப்பின் மூலம்: Python: sorted(numbers) + sorted(words) of the union {2, 10, 'a', 'b', 'c'}

## கேள்விகள்

### What is the difference between union and intersection?

The union A ∪ B contains every element in A, in B or in both; the intersection A ∩ B contains only the elements in both. For A = {1, 2, 3, 4, 5} and B = {4, 5, 6, 7}, the union is {1, 2, 3, 4, 5, 6, 7} and the intersection is {4, 5}. The union is never smaller than either set, and the intersection never larger.

### What is the symmetric difference of two sets?

The elements that are in exactly one of the two sets: A △ B = (A − B) ∪ (B − A), which is the union with the intersection removed. For {1, 2, 3, 4, 5} and {4, 5, 6, 7} it is {1, 2, 3, 6, 7}. It behaves like XOR in logic, and Python's ^ operator computes it for sets.

### How do you find the number of elements in a union?

Use the inclusion–exclusion principle: |A ∪ B| = |A| + |B| − |A ∩ B|, subtracting the intersection because its elements were counted twice. With |A| = 5, |B| = 4 and |A ∩ B| = 2, the union has 5 + 4 − 2 = 7 elements. For three sets it extends to |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|.

### What is the Jaccard index?

A similarity score for two sets: the size of their intersection divided by the size of their union, from 0 for disjoint sets to 1 for identical ones. {1, 2, 3, 4, 5} and {4, 5, 6, 7} share 2 of 7 distinct items, a Jaccard index of 2/7 ≈ 0.2857. It is used to compare documents, tag sets and search results, and 1 minus the index is the Jaccard distance.

### Is A − B the same as B − A?

No. A − B, also written A \ B, keeps the elements of A that are not in B, while B − A keeps the elements of B that are not in A. With A = {1, 2, 3, 4, 5} and B = {4, 5, 6, 7}, A − B = {1, 2, 3} but B − A = {6, 7}. The two differences never share an element, and together they form the symmetric difference.

### “கணச் செயல்பாட்டுக் கணிப்பான்” எவ்வளவு துல்லியமானது?

துல்லியம் உங்கள் உள்ளீடுகளையும் முறையின் அனுமானங்களையும் சார்ந்தது. தசமக் கணக்கீடு 50 முக்கிய இலக்கங்களைப் பயன்படுத்துகிறது. ஆனால் மதிப்பீடுகள், எண் முறைகள், மூலத் தரவுகள் குறைந்த துல்லியத்தைக் கொண்டிருக்கலாம்; காட்டப்படும் மதிப்பை வட்டமிடுவது இந்த வரம்புகளை நீக்காது. சுயாதீன மூலங்களின் தீர்வுகளுடன் சரிபார்க்கப்பட்ட எடுத்துக்காட்டுகள்: 6. எடுத்துக்காட்டாக, “{1, 2, 3, 4, 5} and {4, 5, 6, 7}” என்பது Python set operators |, &, -, ^ on {1,2,3,4,5} and {4,5,6,7}; 2/7 = 0.285714 உடன் சரிபார்க்கப்படுகிறது.

### இந்த முறையின் மூலம் என்ன?

Wolfram MathWorld — Union, Intersection, Set Difference, Symmetric Difference; Python documentation — set types and operations.

## ஆதாரங்கள்

- [Wolfram MathWorld — Union, Intersection, Set Difference, Symmetric Difference](https://mathworld.wolfram.com/SymmetricDifference.html)
- [Python documentation — set types and operations](https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset)
