Cosmic Connect

Visualizing Relations Between Sets

Set A
Set B

Core Concepts

Ordered Pairs

Fundamental building blocks of relations where the order of elements matters

Ordered Pair Definition

An ordered pair (a, b) is a pair of objects where the order matters. (a, b) ≠ (b, a) unless a = b.

(a, b) = (c, d) ⇔ a = c ∧ b = d

Cartesian Product

The set of all possible ordered pairs from two sets

Cartesian Product

For sets A and B, the Cartesian product A × B is the set of all ordered pairs (a, b) where a ∈ A and b ∈ B.

A × B = {(a, b) | a ∈ A, b ∈ B}

Relations

Connections between elements of sets

Relation Definition

A relation R from set A to set B is a subset of A × B. If (a, b) ∈ R, we say "a is related to b".

R ⊆ A × B

Cartesian Product Explained

The Cartesian product of two sets A and B, denoted by A × B, is the set of all possible ordered pairs where the first element is from A and the second element is from B.

If set A has n elements and set B has m elements, then A × B has n × m elements.

|A × B| = |A| × |B|

Example: For A = {1, 2} and B = {x, y, z}, the Cartesian product is:

A × B = {(1,x), (1,y), (1,z), (2,x), (2,y), (2,z)}

Example: Cartesian Product

Let's find the Cartesian product of two sets:

If A = {red, green} and B = {circle, square}, then:

A × B = {(red, circle), (red, square), (green, circle), (green, square)}

This represents all possible combinations of colors and shapes.

Relations in Depth

What is a Relation?

A relation from a set A to a set B is a subset of the Cartesian product A × B. It establishes connections between elements of A and elements of B.

R: A → B where R ⊆ A × B

Domain: The set of all first elements in the ordered pairs of R

Codomain: The set B (the second set in the relation)

Range: The set of all second elements that are actually related to elements in the domain

Example: Relation

Let A = {1, 2, 3} and B = {x, y, z}

Define a relation R = {(1,x), (2,y), (3,z)}

Here:

  • Domain of R = {1, 2, 3}
  • Codomain = B = {x, y, z}
  • Range of R = {x, y, z}

Functions as Special Relations

A function is a special type of relation where:

  1. Every element in the domain is related to exactly one element in the codomain
  2. No element in the domain is left without a relation
f: A → B is a function if ∀a ∈ A, ∃!b ∈ B such that (a, b) ∈ f

This means each input has exactly one output. The vertical line test can determine if a graph represents a function.

Types of Functions

Important Function Types

1. Identity Function

Maps each element to itself

f(x) = x

2. Constant Function

Outputs the same value for all inputs

f(x) = c (where c is constant)

3. Polynomial Function

Sum of terms with non-negative integer exponents

f(x) = aₙxⁿ + aₙ₋₁xⁿ⁻¹ + ... + a₁x + a₀

4. Rational Function

Ratio of two polynomial functions

f(x) = P(x)/Q(x) where Q(x) ≠ 0

5. Modulus Function

Gives the absolute value of a number

f(x) = |x| = { x if x ≥ 0; -x if x < 0 }

Interactive Function Grapher

Explore different function types by selecting them below: