< Return to Video

Fermat's Little Theorem

  • 0:02 - 0:03
    Voiceover: Bob discovered
    something very interesting
  • 0:03 - 0:05
    while making multicolored earrings
  • 0:05 - 0:07
    out of beads for his store.
  • 0:07 - 0:09
    Now, his customers like variety,
  • 0:09 - 0:13
    so he decides to make every
    possible style for each size.
  • 0:13 - 0:16
    Starting with size three, he begins
  • 0:16 - 0:19
    by figuring out all possible styles.
  • 0:22 - 0:25
    Each earring begins as a string of beads,
  • 0:25 - 0:28
    and then the ends are
    attached to form a ring.
  • 0:29 - 0:33
    So first, how many
    possible strings are there?
  • 0:33 - 0:35
    With two colors and three beads,
  • 0:35 - 0:39
    there are three choices,
    each from two colors.
  • 0:39 - 0:43
    So two times two times two equals eight
  • 0:43 - 0:45
    possible unique strings.
  • 0:45 - 0:47
    And then he subtracts the strings
  • 0:47 - 0:50
    which have only one color,
    or monocolored strings,
  • 0:50 - 0:54
    since he's only building
    multicolored earrings.
  • 0:54 - 0:57
    Then he glues them all
    together to form rings.
  • 0:57 - 1:00
    He was assuming he would end
    up with six different earrings,
  • 1:00 - 1:02
    but something happened.
  • 1:02 - 1:05
    He could no longer tell the
    difference between most of them.
  • 1:05 - 1:08
    It turns out he only has two styles,
  • 1:08 - 1:11
    because each style is now part of a group
  • 1:11 - 1:14
    with two identical partners.
  • 1:15 - 1:20
    Notice you can always match
    them up based on rotations.
  • 1:20 - 1:22
    So the size of these groups must be based
  • 1:22 - 1:27
    on how many rotations it takes
    to return to the original.
  • 1:27 - 1:30
    Or how many rotations to complete a cycle.
  • 1:31 - 1:34
    So this means that the original set
  • 1:34 - 1:37
    of all multicolored strings divides evenly
  • 1:37 - 1:40
    into groups of size three.
  • 1:44 - 1:48
    Now, would this be true for other sizes?
  • 1:48 - 1:50
    That would be convenient,
    since he always wants
  • 1:50 - 1:52
    the same amount of each style.
  • 1:52 - 1:55
    So he tries this with four beads.
  • 1:55 - 1:58
    First he builds all possible strings.
  • 1:58 - 2:00
    With four beads he can
    choose from two colors
  • 2:00 - 2:02
    for each bead, so two times two
  • 2:02 - 2:06
    times two times two equals sixteen.
  • 2:06 - 2:10
    Then he removes the two
    monocolored necklaces
  • 2:10 - 2:15
    and attaches all of the
    others to form rings.
  • 2:15 - 2:18
    Now, will they form equal sized groups?
  • 2:19 - 2:20
    Apparently not.
  • 2:20 - 2:22
    What happened?
  • 2:22 - 2:27
    Notice how the initial set of
    strings divides into styles.
  • 2:27 - 2:29
    If strings are of the same style,
  • 2:29 - 2:31
    it means you can form one into the other
  • 2:31 - 2:33
    simply by grabbing beads from one end
  • 2:33 - 2:37
    and sticking them onto the other end.
  • 2:37 - 2:40
    And there is one style
    which only has two members,
  • 2:40 - 2:42
    and this is because it's built
  • 2:42 - 2:45
    out of a repeating unit of length two.
  • 2:45 - 2:50
    So only two rotations are
    required to complete a cycle.
  • 2:50 - 2:54
    Therefore this group only contains two.
  • 2:54 - 2:59
    He cannot split them into
    an equal number of styles.
  • 2:59 - 3:00
    What about size five?
  • 3:00 - 3:04
    Will they break into equal
    number of each style?
  • 3:07 - 3:10
    Wait, suddenly he realizes he doesn't even
  • 3:10 - 3:13
    need to build them in order to find out.
  • 3:13 - 3:16
    It must work, since five cannot be made up
  • 3:16 - 3:19
    of a repeating pattern, because five
  • 3:19 - 3:21
    cannot be broken up into equal parts.
  • 3:21 - 3:23
    It's a prime number.
  • 3:23 - 3:26
    So no matter what kind
    of multicolored string
  • 3:26 - 3:29
    you start with, it will
    always take five rotations,
  • 3:29 - 3:33
    or bead swaps, to return to itself.
  • 3:33 - 3:38
    The cycle length of every
    string must be five.
  • 3:38 - 3:39
    Well let's check.
  • 3:39 - 3:42
    First we'll build all possible strings
  • 3:43 - 3:46
    and remove the two monocolored strings.
  • 3:46 - 3:48
    Then we separate the strings into groups
  • 3:48 - 3:50
    which belong to the same style,
  • 3:50 - 3:53
    and build a single earring for each style.
  • 3:53 - 3:57
    Notice that each earring
    rotates exactly five times
  • 3:57 - 3:59
    to complete a cycle.
  • 3:59 - 4:02
    Therefore, if we glued all
    the strings into rings,
  • 4:02 - 4:06
    they must split into equal
    sized groups of five.
  • 4:06 - 4:09
    But then he goes one step further.
  • 4:09 - 4:13
    Currently he is only using
    two colors, but he realizes
  • 4:13 - 4:16
    this must hold with any number of colors.
  • 4:16 - 4:19
    Because any multicolored
    earring with a prime number
  • 4:19 - 4:24
    of beads, P, must have
    a cycle length of P,
  • 4:24 - 4:28
    since primes cannot be broken
    into equal sized units.
  • 4:31 - 4:33
    But if a composite
    number of beads are used,
  • 4:33 - 4:36
    such as six, we will
    always have certain strings
  • 4:36 - 4:39
    with shorter cycle lengths,
    since it's actually
  • 4:39 - 4:42
    built out of a repeating
    unit, and therefore
  • 4:42 - 4:45
    will form smaller groups.
  • 4:45 - 4:49
    And amazingly he just stumbled
    onto Fermat's Little Theorem.
  • 4:49 - 4:55
    Given A colors and strings
    of length P, which are prime,
  • 4:55 - 4:59
    the number of possible
    strings is A times A
  • 4:59 - 5:03
    times A, P times, or A to the power of P.
  • 5:03 - 5:06
    And when he removed the
    monocolored strings,
  • 5:06 - 5:09
    he subtracts exactly A strings,
  • 5:09 - 5:12
    since there are one for each color.
  • 5:12 - 5:17
    This leaves him with A to the
    power of P minus A strings.
  • 5:17 - 5:19
    And when he glues these strings together,
  • 5:19 - 5:22
    they will fall into groups of size P,
  • 5:22 - 5:26
    since each earring must
    have a cycle length of P.
  • 5:26 - 5:32
    Therefore, P divides A to
    the power of P minus A.
  • 5:32 - 5:34
    And that's it.
  • 5:34 - 5:38
    We can express this statement
    in modular arithmetic too.
  • 5:38 - 5:41
    Think of it, if you
    divide A to the power of P
  • 5:41 - 5:45
    by P, you will be left
    with a remainder of A.
  • 5:45 - 5:49
    So we can write this
    as A to the power of P
  • 5:49 - 5:53
    is congruent to A mod P.
  • 5:53 - 5:55
    And here we have stumbled onto one
  • 5:55 - 5:57
    of the fundamentals
    results in number theory
  • 5:57 - 6:00
    merely by playing with beads.
Title:
Fermat's Little Theorem
Video Language:
English
Duration:
06:06

English subtitles

Revisions