Binary Relations

Back

Loading concept...

Binary Relations: The Secret Language of Connections

The Story of Matchmaking

Imagine you’re at a big party where everyone wears a name tag. Now, some people know each other, and some don’t. A binary relation is like having a magical notebook that writes down every time two people are connected somehow.

Think of it like this: You have two groups of kids. Group A has kids named Alice, Bob, and Charlie. Group B has toys: Ball, Doll, and Car. When a kid picks a favorite toy, we draw an arrow from the kid to the toy. That collection of arrows? That’s a binary relation!


What is a Binary Relation?

A binary relation connects elements from one set to elements of another set (or the same set).

Simple Example:

  • Set A = {1, 2, 3} (kids’ ages)
  • Set B = {Red, Blue, Green} (favorite colors)

If age 1 likes Red, age 2 likes Blue, and age 3 likes Red too, our relation R is:

R = {(1, Red), (2, Blue), (3, Red)}

Each pair (a, b) means: “a is related to b”

Real Life Examples:

  • “is parent of” connects parents to children
  • “is taller than” connects people by height
  • “likes” connects you to your favorite foods
graph TD A["1"] -->|likes| B["Red"] C["2"] -->|likes| D["Blue"] E["3"] -->|likes| B

Domain of a Relation

The domain is like asking: “Who sent a message?”

It’s the set of all first elements in our pairs.

Example:

If R = {(1, Red), (2, Blue), (3, Red)}

Domain = {1, 2, 3}

These are all the elements that start a connection.

Think of it this way:

  • You’re throwing paper airplanes
  • The domain is all the kids who threw airplanes
  • It doesn’t matter where they landed
  • Just who threw them!

Range of a Relation

The range is like asking: “Who received a message?”

It’s the set of all second elements that actually got picked.

Example:

If R = {(1, Red), (2, Blue), (3, Red)}

Range = {Red, Blue}

Notice: Green is NOT in the range because nobody picked it!

Think of it this way:

  • Paper airplanes landing
  • Range = only the spots where airplanes actually landed
  • Not every possible spot, just the ones hit!
graph TD subgraph Domain A["1"] B["2"] C["3"] end subgraph Range D["Red"] E["Blue"] end A --> D B --> E C --> D

Codomain

The codomain is the entire “landing zone” — all possible destinations, whether airplanes land there or not.

Example:

  • Set A = {1, 2, 3}
  • Set B = {Red, Blue, Green} ← This is the CODOMAIN
  • R = {(1, Red), (2, Blue), (3, Red)}

Codomain = {Red, Blue, Green}

Range = {Red, Blue} (only what was actually used)

The Big Difference:

Term What it means
Codomain All possible destinations
Range Only destinations actually reached

Real Life:

  • Menu at restaurant = Codomain (all possible dishes)
  • What you actually ordered = Range

Inverse Relation

The inverse relation is like pressing “reverse” on everything!

If R goes from A to B, then R⁻¹ goes from B to A.

Example:

If R = {(1, Red), (2, Blue), (3, Red)}

Then R⁻¹ = {(Red, 1), (Blue, 2), (Red, 3)}

We just flip every pair!

Think of it this way:

  • Normal: “Kids who like colors”
  • Inverse: “Colors liked by which kids”
graph TD subgraph Original R A1["1"] --> B1["Red"] end subgraph Inverse R⁻¹ B2["Red"] --> A2["1"] end

Real Life:

  • “is parent of” → inverse is “is child of”
  • “sent message to” → inverse is “received message from”

Composition of Relations

Composition is like a chain reaction or relay race!

If R goes from A to B, and S goes from B to C, then S ∘ R (read “S composed with R”) goes directly from A to C.

Example:

  • R = {(1, a), (2, b)} — from numbers to letters
  • S = {(a, X), (b, Y)} — from letters to symbols

S ∘ R = {(1, X), (2, Y)}

How? Follow the chain:

  • 1 → a → X (so 1 connects to X)
  • 2 → b → Y (so 2 connects to Y)

Think of it like:

  • You tell a secret to Friend A
  • Friend A tells it to Friend B
  • The composition is: You → Friend B (skipping the middle!)
graph TD A["1"] -->|R| B["a"] B -->|S| C["X"] D["2"] -->|R| E["b"] E -->|S| F["Y"]

Step by Step:

  1. Start with an element from the first set
  2. Follow R to get to the middle set
  3. Then follow S to get to the final set
  4. Write down (start, finish)

Summary: All Concepts Together

Let’s use one complete example:

Set A = {Tom, Jerry} Set B = {Pizza, Burger, Salad} Set C = {Yummy, Okay, Gross}

Relation R (who eats what) = {(Tom, Pizza), (Tom, Burger), (Jerry, Salad)}

Relation S (food ratings) = {(Pizza, Yummy), (Burger, Okay), (Salad, Gross)}

Concept Answer
Binary Relation R {(Tom, Pizza), (Tom, Burger), (Jerry, Salad)}
Domain of R {Tom, Jerry}
Range of R {Pizza, Burger, Salad}
Codomain of R {Pizza, Burger, Salad}
Inverse R⁻¹ {(Pizza, Tom), (Burger, Tom), (Salad, Jerry)}
Composition S ∘ R {(Tom, Yummy), (Tom, Okay), (Jerry, Gross)}

Quick Memory Tricks

  • Domain = Departure point (where arrows start)
  • Range = Received (where arrows actually land)
  • Codomain = Complete possibilities (all landing spots)
  • Inverse = Invert the arrows (flip the pairs)
  • Composition = Chain together (follow the path)

You Did It!

Now you understand binary relations like a pro! Remember:

  1. A binary relation is just pairs showing connections
  2. Domain = all the starting points
  3. Range = all the actual endpoints
  4. Codomain = all possible endpoints
  5. Inverse = flip every connection
  6. Composition = chain two relations together

You’re now ready to see these connections everywhere — from friend networks to family trees to your favorite foods!

Loading story...

Story - Premium Content

Please sign in to view this story and start learning.

Upgrade to Premium to unlock full access to all stories.

Stay Tuned!

Story is coming soon.

Story Preview

Story - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.