Bijection Relationship

A bijection is a one-to-one correspondence between the elements of two sets. It matches each element from one set to exactly one element in the other set.

For example, a bijection between integers and their string names:

Java example:

1
2
3
4
5
6
Map<Integer, String> numberNames = new HashMap<>();
numberNames.put(0, "zero"); 
numberNames.put(1, "one");
// ...

String name = numberNames.get(5); // "five"

C++ example:

1
2
3
4
5
6
7
map<int, string> numberNames{
  {0, "zero"},
  {1, "one"},
  // ...
};

string name = numberNames[5]; // "five"

Python example:

1
2
3
4
5
6
7
number_names = {
  0: "zero",
  1: "one",
  # ... 
}

name = number_names[5] # "five"

The key properties are:

  • Each element in set A maps to exactly one element in set B.
  • Each element in set B maps from exactly one element in set A.

Bijections allow uniquely mapping between two sets or encoding one in terms of the other.

Visualization

Here are some ways to visualize and represent a bijective relationship:

  • Mapping diagram: Draw two sets A and B and arrows representing the one-to-one correspondence between elements. For example:

{1, 2, 3} -> {one, two, three}

  • Paired elements: Explicitly show the paired elements as ordered tuples:

{(1, “one”), (2, “two”), (3, “three”)}

  • Two-column table: Create a table with columns for set A and set B with the corresponding elements in each row:

A | B

1 | one 2 | two 3 | three

  • Function plot: If the bijection is a mathematical function f: A -> B, you can plot the function showing the unique mapping.

  • Permutation: A bijection can be represented as a permutation reordering a set.

  • Indexing: Map elements of A to unique indices that correspond to positions in B.

The core idea is showing a one-to-one pairing between elements in two sets. Arrows, tuples, tables, plots, and indices emphasize the unique mapping defining a bijective relationship. Visualizing the bijection helps build intuition about this mapping.