6. New Experiments: Sum of Squares and Plotting I

6.1. Last Thoughts on the Conductor

Wait, I thought we were done with this after today’s homework? But…

Question (almost) none of you thought of: Is there such a thing as a conductor for a set of three integers? That is, is there a conductor for numbers of the form n=5x+8y+7z, for the set \{5,8,7\}?

  • Well, what about for \{3,4,7\}?

  • Okay, what about \{3,4,6\}?

  • Ah, but what about \{3,4,5\}?

With this last example, we see that the conductor can (sometimes) be strictly less than the conductor for any group of two of them.

Do you think there a formula?  What about for bigger sets?

  • For sets of two, it turns out there is a complete answer which you have been busy discovering.

  • For sets of three numbers, like n=5\,x+8\,y+7\,z, there is an efficient algorithm, but no exact formula.

Notice the connection between theory and practice!  Solving this problem could easily solve a “real-life” business problem, so a good algorithm would be very important.  But finding such an algorithm requires exploration and experimentation like we have been doing.

Click here if you want to go back to the table of content of this notebook. Otherwise, continue to the next Section.

6.2. New Experiment — Sum of Squares

With that in mind, let’s begin our next exploration. Hopefully you have had some fun experimenting with the condunctor problem. Today we will introduce a new problem to keep up the fun spirit of experimental mathematics. Namely, what numbers can be written in the form n=a^2+b^2?

Here are a cases that do and do not work.

  • 2 = 1^2+1^2 works;

  • 3 does not work, since we only allow integers.  1+1 is too small, 1^2+2^2=5 is too big;

  • 4 actually does work, because we allow 4 = 0^2+2^2. (That’s just one of our rules; you could play a different game if you wanted.);

  • That means 1=1^2+0^2 works.

  • 5 works.

And so forth. Can you think of questions that you can explore experimentally? I can think of two questions:

  • Which positive integers can be written as a sum of two squares?

  • Which ones cannot?

  • More questions? [comment]: <> (* Are there any special types of numbers that can be written? ) [comment]: <> (* Are there any special types of numbers that cannot be written? ) [comment]: <> (* Can we get a formula for which numbers can be written? ) [comment]: <> (* What if we restrict a and b to be positive integers? ) [comment]: <> (* How many ways can you write n as a sum of two squares? ) [comment]: <> (* Which numbers can be written as a sum of one square, and separately as a sum of two squares? )

You can start by hand, but I encourage you to use SageMath to explore this soon too.  And when you do, try to be more sophisticated than those this

1^2+1^2
1^2+2^2
1^2+3^2

After a while, we will come back and I will ask you about possible ways to rethink the problem on the sum of squares.

Can you think of a way to solve this problem? Hint: What do you know about equations of this form :math:`n = a^{2} + b ^{2}`?

This brings up the question of how to do such plotting in the first place? We will look at this in more detail in the next Section.

6.3. More Plotting and Graphics in Two Dimensions

There is absolutely no way we could cover all the graphics in SageMath (or the program that does it for SageMath, matplotlib) in one day, or even a week. We will look at a bunch of different resources you have access to, and see lots of different plot types. As we go through these resources, think of how they will be of in solving our new experiment or where you could have used them some time back in your academic career. I definitely do not know everything about the plotting command. Nevertheless, you may interrupt me with your question so that we can explore the solution together.

Remember, you should feel free to stop listening for a while if you can want to try something out!
Once we’ve seen enough examples, please either start using SageMath to explore the sums of squares, or try to recreate your favorite graphic using SageMath!

< 3. Starting To Program|Table of contents >