Jupyter notebook Project 2 Report.ipynb
Project 2: Cyclic Difference Sets
Introduction
The goal of this project is to explore cyclic difference sets using modular arithmetic. For an integer , a cyclic difference set modulo is a subset of the set of integers modulo such that the differences between every element of the cyclic difference set generates every element of the integers modulo the same number of times. Specifically, this project explores numerically a method of generating cyclic difference sets by using the squares of integer sets. Various conjectures are made and proven with respect to this method.
Theory
Modulo
We define two numbers and to be congruent modulo as (mod ). Consequentially, is divisible by . For a positive integer , we define as the set of integers modulo . contains all nonnegative proper remainders upon division by . In other words, . It is important to note that is closed under addition and multiplication, meaning that any arithmetic operations on the elements of result in an integer in the set .
Example: = 7
We demonstrate some calculations modulo here in order to set the stage for more complicated calculations in later sections.
For , . Since remainder , (mod ). (mod ).
Inverses
Although we state that is closed under addition and multiplication, we have not shown until this section specifically how is closed under subtraction. The additive inverse of an integer in , denoted by , is the integer such that . For example, for , the additive inverse of is since (mod ). Below we will raise some conjectures and provide reasoning for their proofs.
Conjecture 1: If is in and , then (mod) .
Since , . Thus, it is true that (mod) .
Conjecture 2: If is even and , then is its additive inverse modulo .
When is even, the number of elements in is odd, so when , x is its additive inverse modulo .
Conjecture 3: The maximum number of distinct nonzero squares modulo when is odd is . The maximum number of distinct nonzero squares modulo when is even is .
Conjecture 3 follows from Conjectures 1 and 2. There are distinct nonzero elements in . When the elements of are squared, it is true from Conjecture 1 that the squares of integers in and their additive inverses are equal. This repitition of squares results in distinct squares.
Squares¶
To create our cyclic set, we need to approach this in steps. Our first step is to create, as this section implies, a set of squares. Given a modulus , our set will consist the square of every element modulo between 1 and . We can calculate this by hand rather quickly when dealing with a small modulus like , but when dealing with numbers like , we need a program. We will show as an example in our program.
This program creates an array and stores the square of each natural number as an element, labeled with that natural number's index.
Let's look at this set of squares. , , , , , and . We have 3 distinct answers: 1, 2, and 4. Similarly, if we run this program with these select modulo, we get the following results:
Modulo | 7 | 11 | 15 | 19 | 23 | 27 |
---|---|---|---|---|---|---|
Occurrence of all squares (k) | 3 | 5 | 7 | 9 | 11 | 13 |
From here, we start to note a definite pattern summed up in this formula: For our distinct number of elements k in our cyclic set D, . However, just like m, k must also be a natural number, as we cannot have a decimal answer for an exact number of elements. Let's factor the formula.
By definition of odd terms, m is an odd number. Therefore, m must be odd in context of this problem.
Now we'll prove something interesting. Let's assume, for some integer , that our modular . If we know that m is odd, then therefore a must also be odd. But we also know that for this case, . This is distinctly different that what we stated just above. We will explore this further in our proof section.
Differences
Now let us get into the meat of a cyclic difference set: the differences. From here, let us clarify the conditions that makes our differences cyclic. Firstly, if we have a set of modulo m, then the differences of the distinct nonzero squares must include every natural number from 1 to m - 1. Otherwise, our set is not cyclic. Secondly, these differences must appear the exact same number of times. We will call this number of occurences lamda. Similarly to differences, calculating this by hand is not difficult, but simply tedious. We will instead look at code highlighting this. We will once again use m = 7.
Recall from Squares that we have 3 distinct squares: 1, 2, and 4. In modulo 7, they form every difference between 1 and (7 - 1). But also, for our lambda (), we have a value of 1 for every distinct difference. We have the same value of for every equation. Thus, when m = 7, we have a cyclic differences set. Let's look at a table of more modulos that work.
Modulo (m) | 7 | 11 | 19 | 23 | 31 |
---|---|---|---|---|---|
Occurrence of all distinct differences () | 1 | 2 | 4 | 5 | 7 |
From here, we start to notice a distinct pattern. . This formula works for all legitimate value of m. We will prove this formula in a later section, as well as what defines a legitimate value of m. Before that, let's factor into the equation.
.
As we can see her, our formula for in terms of k matches our formula for k in terms of m. This entails that we can rewrite our equation as such:
.
Our number of distinct squares k is therefore also absolutely an odd number when our modular m is an odd number.
Proof
Formula for
To find a formula for in terms of , we first found different values that produce cyclic difference sets and checked what the value for each one was. Through this method, we conjure that for all that produce a cyclic difference set. In order to prove our conjecture, we have to logically explain it. is defined as the number of elements in . Since only contains nonzero elements, the total possible elements in is . However, the squares of additive inverses are congruent modulo and does not contain any repeats of its elements. So, by Conjecture 3 in Inverses, the number of elements in when is a cyclic difference set is . Thus, .
Formula for
To find a formula for in terms of , we used the same method we did for . Through this method, we conjecture that for all that produce a cyclic difference set. We will prove this conjecture by logically explaining it. is defined as the number of pairs of elements of giving each nonzero difference modulo . We know that there are elements in by the definition of , we use these elements to set up a chart. The top and leftmost lines are the elements of in the same order. The rest of the chart is the differences of every element of found by taking the top number and subtracting the leftmost number, modulo . If the difference is a negative number, then it is replaced with its additive inverse modulo . These differences should represent all of the nonzero elements of an equal number of times. For example, we will do the chart for .
-\+ | 1 | 2 | 4 |
---|---|---|---|
1 | 0 | 1 | 3 |
2 | 6 | 0 | 2 |
4 | 4 | 5 | 0 |
We will use the chart to prove our conjecture that . There are differences in the chart, but we only want the nonzero elements. The zeros will only appear on the diagonal from top-left to bottom-right, which includes zeros, so we're only looking at differences. This gives us the amount of nonzero differences in the chart, but we want the number of times each one shows up. Since there are nonzero elements of , we now have . Since we want in terms of , we will substitute . The new equation is . Thus, .
Conclusion
Finding a General Form for
We're trying to prove the claim that if is a cyclic difference set, then has a particular form. We will start by letting be a cyclic difference set. Since is a cyclic difference set, we know and . If we solve both of these equations for , we have and . To find just one equation for , we will sum both equations. This leads us to , which can be simplified to . Therefore, if is a cyclic difference set, then .