Skip to main content
Logo image

PreTeXt Sample Book: Abstract Algebra (SAMPLE ONLY)

Exercises 2.7 Sage Exercises

View Source for exercises
<exercises xml:id="cyclic-sage-exercises" xml:base="sage/cyclic-sage-exercises.xml">
  <title>Sage Exercises</title>
  <introduction>
    <p>
      This group of exercises is about the group of units mod <m>n</m>,
      <m>U(n)</m>, which is sometimes cyclic, sometimes not.
      There are some commands in Sage that will answer some of these questions very quickly,
      but instead of using those now,
      just use the basic techniques described.
      The idea here is to just work with elements,
      and lists of elements, to discern the subgroup structure of these groups.
    </p>
  </introduction>
  <exercise number="1">
    <statement>
      <p>
        Execute the statement <c>R = Integers(40)</c> to create the set <c>[0,1,2,...,39]</c> This is a group under addition mod <m>40</m>,
        which we will ignore.
        Instead we are interested in the subset of elements which have an inverse under
        <em>multiplication</em> mod <m>40</m>.
        Determine how big this subgroup is by executing the command <c>R.unit_group_order()</c>,
        and then obtain a list of these elements with <c>R.list_of_elements_of_multiplicative_group()</c>.
      </p>
    </statement>
  </exercise>
  <exercise number="2">
    <statement>
      <p>
        You can create elements of this group by coercing regular integers into <c>U</c>,
        such as with the statement <c>a = U(7)</c>. (Don't confuse this with our mathematical notation <m>U(40)</m>.) This will tell Sage that you want to view <m>7</m> as an element of <m>U</m>,
        subject to the corresponding operations.
        Determine the elements of the cyclic subgroup of <m>U</m> generated by <m>7</m> with a list comprehension as follows:
      </p>
<sage type="display">
<input>
R = Integers(40)
a = R(7)
[a^i for i in srange(16)]
</input>
</sage>
      <p>
        What is the order of <m>7</m> in <m>U(40)</m>?
      </p>
    </statement>
  </exercise>
  <exercise number="3">
    <statement>
      <p>
        The group <m>U(49)</m> is cyclic.
        Using only the Sage commands described previously,
        use Sage to find a generator for this group.
        Now using <em>only</em> theorems about the structure of cyclic groups,
        describe each of the subgroups of <m>U(49)</m> by specifying its order and by giving an explicit generator.
        Do not repeat any of the subgroups <mdash /> in other words,
        present each subgroup <em>exactly</em> once.
        You can use Sage to check your work on the subgroups,
        but your answer about the subgroups should rely only on theorems and be a nicely written paragraph with a table, etc.
      </p>
    </statement>
  </exercise>
  <exercise number="4">
    <statement>
      <p>
        The group <m>U(35)</m> is not cyclic.
        Again, using only the Sage commands described previously,
        use computations to provide irrefutable evidence of this.
        How many of the <m>16</m> different subgroups of <m>U(35)</m> can you list?
      </p>
    </statement>
  </exercise>
  <exercise number="5">
    <statement>
      <p>
        Again, using only the Sage commands described previously,
        explore the structure of <m>U(n)</m> for various values of <m>n</m> and see if you can formulate an interesting conjecture about some basic property of this group.
        (Yes, this is a <em>very</em> open-ended question,
        but this is ultimately the real power of exploring mathematics with Sage.)
      </p>
    </statement>
  </exercise>
</exercises>
This group of exercises is about the group of units mod \(n\text{,}\) \(U(n)\text{,}\) which is sometimes cyclic, sometimes not. There are some commands in Sage that will answer some of these questions very quickly, but instead of using those now, just use the basic techniques described. The idea here is to just work with elements, and lists of elements, to discern the subgroup structure of these groups.

1.

View Source for exercise
<exercise number="1">
  <statement>
    <p>
      Execute the statement <c>R = Integers(40)</c> to create the set <c>[0,1,2,...,39]</c> This is a group under addition mod <m>40</m>,
      which we will ignore.
      Instead we are interested in the subset of elements which have an inverse under
      <em>multiplication</em> mod <m>40</m>.
      Determine how big this subgroup is by executing the command <c>R.unit_group_order()</c>,
      and then obtain a list of these elements with <c>R.list_of_elements_of_multiplicative_group()</c>.
    </p>
  </statement>
</exercise>
Execute the statement R = Integers(40) to create the set [0,1,2,...,39] This is a group under addition mod \(40\text{,}\) which we will ignore. Instead we are interested in the subset of elements which have an inverse under multiplication mod \(40\text{.}\) Determine how big this subgroup is by executing the command R.unit_group_order(), and then obtain a list of these elements with R.list_of_elements_of_multiplicative_group().

2.

View Source for exercise
<exercise number="2">
    <statement>
      <p>
        You can create elements of this group by coercing regular integers into <c>U</c>,
        such as with the statement <c>a = U(7)</c>. (Don't confuse this with our mathematical notation <m>U(40)</m>.) This will tell Sage that you want to view <m>7</m> as an element of <m>U</m>,
        subject to the corresponding operations.
        Determine the elements of the cyclic subgroup of <m>U</m> generated by <m>7</m> with a list comprehension as follows:
      </p>
<sage type="display">
<input>
R = Integers(40)
a = R(7)
[a^i for i in srange(16)]
</input>
</sage>
      <p>
        What is the order of <m>7</m> in <m>U(40)</m>?
      </p>
    </statement>
  </exercise>
You can create elements of this group by coercing regular integers into U, such as with the statement a = U(7). (Don’t confuse this with our mathematical notation \(U(40)\text{.}\)) This will tell Sage that you want to view \(7\) as an element of \(U\text{,}\) subject to the corresponding operations. Determine the elements of the cyclic subgroup of \(U\) generated by \(7\) with a list comprehension as follows:
What is the order of \(7\) in \(U(40)\text{?}\)

3.

View Source for exercise
<exercise number="3">
  <statement>
    <p>
      The group <m>U(49)</m> is cyclic.
      Using only the Sage commands described previously,
      use Sage to find a generator for this group.
      Now using <em>only</em> theorems about the structure of cyclic groups,
      describe each of the subgroups of <m>U(49)</m> by specifying its order and by giving an explicit generator.
      Do not repeat any of the subgroups <mdash /> in other words,
      present each subgroup <em>exactly</em> once.
      You can use Sage to check your work on the subgroups,
      but your answer about the subgroups should rely only on theorems and be a nicely written paragraph with a table, etc.
    </p>
  </statement>
</exercise>
The group \(U(49)\) is cyclic. Using only the Sage commands described previously, use Sage to find a generator for this group. Now using only theorems about the structure of cyclic groups, describe each of the subgroups of \(U(49)\) by specifying its order and by giving an explicit generator. Do not repeat any of the subgroups — in other words, present each subgroup exactly once. You can use Sage to check your work on the subgroups, but your answer about the subgroups should rely only on theorems and be a nicely written paragraph with a table, etc.

4.

View Source for exercise
<exercise number="4">
  <statement>
    <p>
      The group <m>U(35)</m> is not cyclic.
      Again, using only the Sage commands described previously,
      use computations to provide irrefutable evidence of this.
      How many of the <m>16</m> different subgroups of <m>U(35)</m> can you list?
    </p>
  </statement>
</exercise>
The group \(U(35)\) is not cyclic. Again, using only the Sage commands described previously, use computations to provide irrefutable evidence of this. How many of the \(16\) different subgroups of \(U(35)\) can you list?

5.

View Source for exercise
<exercise number="5">
  <statement>
    <p>
      Again, using only the Sage commands described previously,
      explore the structure of <m>U(n)</m> for various values of <m>n</m> and see if you can formulate an interesting conjecture about some basic property of this group.
      (Yes, this is a <em>very</em> open-ended question,
      but this is ultimately the real power of exploring mathematics with Sage.)
    </p>
  </statement>
</exercise>
Again, using only the Sage commands described previously, explore the structure of \(U(n)\) for various values of \(n\) and see if you can formulate an interesting conjecture about some basic property of this group. (Yes, this is a very open-ended question, but this is ultimately the real power of exploring mathematics with Sage.)