:tocdepth: 2
.. _sum_of_squares:
More on Pieces of Numbers
============================================================================
.. contents:: :local:
.. highlight:: python
In `yesterday’s lecture
But the class Partitions with an integer as its argument instantiates a domain containing all the partitions of :math:`n`. For example we can create a domain for all the partitions of an integer say, :math:`8`. .. raw:: html
.. code:: ipython2 all_partitions_of_eight = Partitions(8); all_partitions_of_eight .. parsed-literal:: Partitions of the integer 8 .. raw:: htmlDo you remember what all_partitions_of_eight is? Let us remind ourselves if we have forgotten. .. raw:: html
.. code:: ipython2 all_partitions_of_eight .. raw:: htmlCan you create all partitions of 5? .. raw:: html
.. raw:: htmlWith the list method, I can list all the partitions of :math:`8` by doing the following .. raw:: html
.. code:: ipython2 all_partitions_of_eight.list() .. parsed-literal:: [[8], [7, 1], [6, 2], [6, 1, 1], [5, 3], [5, 2, 1], [5, 1, 1, 1], [4, 4], [4, 3, 1], [4, 2, 2], [4, 2, 1, 1], [4, 1, 1, 1, 1], [3, 3, 2], [3, 3, 1, 1], [3, 2, 2, 1], [3, 2, 1, 1, 1], [3, 1, 1, 1, 1, 1], [2, 2, 2, 2], [2, 2, 2, 1, 1], [2, 2, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]] .. raw:: htmlList all partitions of :math:`5`. .. raw:: html
Spend some time reading the *SageMath* documention on **Partitions**. Get familiar with the syntax and read the remaining part of the notebook. .. code:: ipython2 Partitions? .. raw:: htmlUsing max_slope=-1 I can produce all partitions of an :math:`n` into distinct parts; that is, each part differs from the next by at least 1. Use a different max_slope to get parts that differ by, say, 2. I want to know all the partitions of :math:`8` with distinct parts. .. raw:: html
.. code:: ipython2 list(Partitions(8, max_slope = -1)) .. raw:: htmlDo same for partitions of :math:`5`. .. raw:: html
.. raw:: htmlHow about if I want to list all partitions of :math:`n` with either odd or even parts? I can do that with the parts_in option. .. raw:: html
.. code:: ipython2 list(Partitions(8, parts_in = [2,4..8])) # all partitions of eight with even parts .. raw:: htmlList all the partitions of :math:`5` with odd parts. .. raw:: html
.. raw:: htmlWith the cardinality method I can compute the number of such partitions. .. raw:: html
.. code:: ipython2 Partitions(8, parts_in = [2,4..8]).cardinality() .. raw:: htmlHow many partitions of :math:`5` with old parts are there? .. raw:: html
.. raw:: htmlWith min_length=k, I can get those partitions that have at least :math:`k` parts. Let’s list all partitions of :math:`8` with at least :math:`4` parts and compute its cardinality. .. raw:: html
.. code:: ipython2 Partitions(8, min_length=4).list() .. code:: ipython2 len(Partitions(8, min_length=4).list()) .. raw:: htmlList all the partitions of :math:`5` with at least :math:`2` parts and compute its cardinality. .. raw:: html
.. raw:: htmlWe can also list all the partitions of :math:`n` with parts that are at least :math:`k` with min_part=k. Let’s list all the partitions of :math:`8` with parts that are at least :math:`3` and find its cardinality. .. raw:: html
.. code:: ipython2 Partitions(8, min_part=3).list() .. code:: ipython2 Partitions(8, min_part=3).cardinality() .. raw:: htmlList all the partitions of :math:`5` with parts that are at least :math:`2` and find its cardinality. .. raw:: html
.. raw:: htmlWhat if I want the number of partitions of :math:`n` with exactly :math:`k` parts? We can do this with the length option. For example, let us find the number of partitions of :math:`8` with exactly :math:`3` parts and list them. .. raw:: html
.. code:: ipython2 Partitions(8, length=3).cardinality() .. code:: ipython2 Partitions(8, length=3).list() .. raw:: htmlNow find the number of partitions of :math:`5` with exactly :math:`3` parts and list them. .. raw:: html
.. raw:: htmlWe can even combine all these options. Say for example we want to list all the partitions of :math:`10` with exactly :math:`3` parts such that these parts are at least :math:`2`. .. raw:: html
.. code:: ipython2 Partitions(10, min_part=2, length=3).list() .. raw:: htmlList all the partitions of :math:`15` with exactly :math:`4` parts such that these parts are at least :math:`5`. .. raw:: html
.. raw:: htmlNow let us use these tools to explore if we can find some relation between the some of the statements we made and if possible make some conjectures and try to prove them. In your explorations try to use all the tools in programming you have been equipped with. Some more questions we could ask are: .. raw:: html
.. raw:: html.. raw:: html
.. raw:: htmlThe number of partitions of :math:`n` with prime parts. This is notated :math:`p(n\,|\,\text{prime parts})`. .. raw:: html
.. raw:: htmlThe number of partitions of :math:`n` with parts whose product is equal to :math:`n`. This is notated :math:`p(n\,|\,\text{product of parts is } n)`. .. raw:: html
.. raw:: htmlThe number of partitions of :math:`n` with at least :math:`1` odd part. This is notated :math:`p(n\,|\,\text{at least one odd part})`. .. raw:: html
.. raw:: htmlThe number of partitions of :math:`n` with at least :math:`1` even part. This is notated :math:`p(n\,|\,\text{at least one even part})`. .. raw:: html
.. raw:: htmlThe number of partitions of :math:`n` given that :math:`n` is an Armstrong number. (See for the definition of an Armstrong number). .. raw:: html
.. raw:: htmlIs there a distribution for the number of partitions of :math:`n`? If so find such a distribution. .. raw:: html
.. raw:: htmlIs there a formula for computing the number of partitions of :math:`n`? If so find it. .. raw:: html
.. raw:: htmlGiven that :math:`p` is a perfect square, say :math:`p=n^{2}` for some integer :math:`n`. Is there a relation between the number of partitions of :math:`p` and the number of partitions of :math:`n`? .. raw:: html
.. raw:: htmlThe number of 1’s in each a partition of :math:`n`. .. raw:: html
.. raw:: htmlOur goal today is to explore some of them and see if there is an relation between them or some underlying hidden structure that can be observed and studied. .. raw:: html
.. raw:: htmlFor each of the question above, is there a geometric interpretation? .. raw:: html
.. raw:: htmlCan you think of any more question one ould ask? Kindly list three of them and expplore. See if you can derive a conjecture and prove it. You do not have to come up with a complete proof of your conjecture, but we are interestedin the way way you came about it and how you intend to prove it. .. raw:: html