A teacher can tell seats equal students without counting either
Students file into a classroom and sit down. The teacher glances around: nobody is standing and no seat is empty. Without counting anything, she knows there are exactly as many students as seats. That quick check is a bijection, one of the most useful ideas in mathematics.
A bijection, or one-to-one correspondence, pairs up two collections so that every member of each is matched with exactly one member of the other. Four things must hold: everything on the left gets a partner, nothing on the left gets two, everything on the right gets a partner, and nothing on the right gets two. A baseball batting order works this way, matching nine players with nine slots. So does a group of 100 people and their fingerprints, provided no two people share a print.
Counting itself is a bijection. Saying one, two, three while pointing at objects pairs each with a number, and two finite groups are the same size exactly when such a pairing exists between them. That idea extends to infinite collections, where it gives strange results. Doubling every integer matches the integers perfectly with the even numbers, with halving as the way back, so in this precise sense there are as many even numbers as integers.
Getting the details right matters. The squaring function fails to be a bijection on all real numbers because 1 and minus 1 both land on 1, but restrict it to zero and the positive numbers and it becomes one, with the square root undoing it. The exponential function never produces a negative value, yet if you only aim it at the positive numbers it pairs up perfectly, and the natural logarithm reverses it. A line such as 2x plus 1 is always a bijection, since every output traces back to one input.
A useful shortcut is the Schroder-Bernstein theorem: if each of two sets can be squeezed into the other without doubling up, a perfect pairing between them exists. And a bijection from a set onto itself is simply a shuffle, known as a permutation.
Source: Bijection