MATHEMATICS

Tampilkan postingan dengan label Combinatorics. Tampilkan semua postingan
Tampilkan postingan dengan label Combinatorics. Tampilkan semua postingan

Sabtu, 10 Maret 2012

Exxercise in counting

Given 5 children and 8 adults, how many ways can they be seated so that there are no two children sitting next to each other. ( From math.stackexchange )

I haven't opened the question yet. I got alerted by this question that my discrete mathematics skills are getting -sloppy-! It happened to me before. There was a time when I thought that I had forgotten all of my linear algebra skills. I can assure you that going through all that material again feels overwhelming. Counting is an essential skill I am going through it again. The theory won't be the problem. I know the formulas, it's the skill in which theorems to apply to a certain to problem, or how to model a counting problem. Boxes or balls? Repetition, yes or no? Distinct or similar objects? Should I use the addition or product rule?

As elementary number theory, enumerative combinatorics ( = counting ) is part of the Olympiad curriculum, so there are TONS of practice questions 'out-there' (*).


(*) Anywhere from Amazon to IRC #bookz channels to the shadow-Internet. What suits you (r budget ) best. As long as you are learning.

Selasa, 19 April 2011

Magic squares of type n-by-n

I wrote a small program that can generate a magic square for any size of a matrix. The idea is that this program can support me in my quest to generate some particular normal magic squares. The ideas I got thus far were too computationally intensive though. It remains an interesting enough playground for me, a challenging enough problem that I might solve one day. - I have read that you need some sort of portfolio of problems on which you can work alternately depending on how you feel, think, etc. on a given moment.

$$
\left(
\begin{array}{ccc}
9 & 6 & 3 \\
0 & 6 & 12 \\
9 & 6 & 3
\end{array}
\right)
$$
$$
\left(
\begin{array}{cccc}
9 & 6 & -1 & -4 \\
5 & -6 & 3 & 8 \\
-8 & 7 & 6 & 5 \\
4 & 3 & 2 & 1
\end{array}
\right)
$$
$$
\left(
\begin{array}{ccccc}
40 & 30 & -46 & 8 & -2 \\
40 & -43 & 30 & -11 & 14 \\
-52 & 26 & 24 & 22 & 10 \\
-8 & 9 & 16 & 7 & 6 \\
10 & 8 & 6 & 4 & 2
\end{array}
\right)
$$
$$
\left(
\begin{array}{cccccc}
165 & 118 & -86 & -79 & -59 & -38 \\
84 & -187 & 48 & 46 & 8 & 22 \\
-113 & 42 & 20 & 19 & 36 & 17 \\
-78 & 32 & 15 & 14 & 26 & 12 \\
-43 & 11 & 20 & 18 & 8 & 7 \\
6 & 5 & 4 & 3 & 2 & 1
\end{array}
\right)
$$
$$
\left(
\begin{array}{ccccccc}
344 & 272 & -144 & -180 & -124 & -66 & -46 \\
228 & -391 & 70 & 68 & 66 & -17 & 32 \\
-202 & 62 & 30 & 58 & 28 & 54 & 26 \\
-194 & 50 & 48 & 46 & 44 & 42 & 20 \\
-94 & 38 & 18 & 34 & 16 & 30 & 14 \\
-40 & 13 & 24 & 22 & 20 & 9 & 8 \\
14 & 12 & 10 & 8 & 6 & 4 & 2
\end{array}
\right)
$$
$$
\left(
\begin{array}{cccccccc}
795 & 644 & -283 & -272 & -261 & -250 & -213 & -124 \\
493 & -890 & 96 & 94 & 92 & 90 & 17 & 44 \\
-406 & 86 & 42 & 82 & 80 & 39 & 76 & 37 \\
-329 & 72 & 70 & 34 & 33 & 64 & 62 & 30 \\
-252 & 58 & 56 & 27 & 26 & 50 & 48 & 23 \\
-175 & 44 & 21 & 40 & 38 & 18 & 34 & 16 \\
-98 & 15 & 28 & 26 & 24 & 22 & 10 & 9 \\
8 & 7 & 6 & 5 & 4 & 3 & 2 & 1
\end{array}
\right)
$$

Magic squares of type 5-by-5

Still in 're-discovery mode' generating magic squares has become trivial, although the computational resources increase fast depending on the size of the square.
$$\left(
\begin{array}{ccccc}
14 & 32 & 6 & 8 & 22 \\
14 & 7 & 30 & 17 & 14 \\
0 & 26 & 24 & 22 & 10 \\
44 & 9 & 16 & 7 & 6 \\
10 & 8 & 6 & 28 & 30
\end{array}
\right)$$
$$\left(
\begin{array}{ccccc}
4 & 22 & 6 & 28 & 42 \\
4 & 37 & 30 & 17 & 14 \\
20 & 26 & 24 & 22 & 10 \\
64 & 9 & 16 & 7 & 6 \\
10 & 8 & 26 & 28 & 30
\end{array}
\right)$$
$$\left(
\begin{array}{ccccc}
4 & 6 & 22 & 26 & 64 \\
6 & 55 & 30 & 17 & 14 \\
16 & 34 & 24 & 42 & 6 \\
86 & 7 & 16 & 7 & 6 \\
10 & 20 & 30 & 30 & 32
\end{array}
\right)$$

About definitions.

Magic square
A magic square is a square matrix with elements in $\mathbf{Z}$ such that the totals of rows, columns and both diagonals are equal.
Normal magic square
A normal magic square is a magic square with elements $1,2, \cdots, n^2$ where $n$ is the size of the matrix.
Latin square
A latin square is a $n$ by $n$ square matrix containing $n$ times the first $n$ elements of the alphabet such that each row and each column contains each letter only once. (i.e. Cayley Table)

Further developments

Clearly, normal magic squares are the most desirable objects in the realm of matrices. I am making detailed notes about this work in the ( still? ) unpublished personal mathematics wiki I am setting up.

Jumat, 08 April 2011

Ramanujan's magic square formula - Revisited

Ramanujan's genius (r) was discovered by Hardy (l)
At a very young age Ramanujan designed the following formula for a 3 by 3 magic square:

C+Q | A+P | B+R
A+R | B+Q | C+P
B+P | C+R | A+Q

where A,B,C are integers in arithmetic progression and so are P,Q,R.


Rewriting Ramanujan's scheme somewhat to
2Q+R | 2P+2R | P+Q
2P | P+Q+R | 2Q+2R
P+Q+2R | 2Q | 2P+R

where P,Q,R are in the Rationals, it is clear that every (P,Q,R) yields a magic square with constant number 3 (P + Q + R).

I conjecture that for any 3 by 3 magic square a triple (P,Q,R) can be found in the Rationals such that they fit the above scheme. Finding a proof for this is one of my 'problems'. Naturally, I would be very interested in any counter-example.

Decomposition of the magic square on Drurer's Melancholia

Durer's Melancholia

Durer's Melancholia is world famous for its magic square on the top right wall.

16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1

It is a real magic square because it contains the integers 1,2, ..., 16 on 4x4 places. The constant of this magic square is 34. I have been thinking if there are any 'beautiful' ways in decomposing it into two or more (magical) squares. Best I have come up sofar are two squares with constant number 17.

1 3 1 12
3 10 0 4
9 1 6 1
4 3 10 0

15 0 1 1
2 0 11 4
0 5 1 11
0 12 4 1

Add them and the result is Drurer's magic square.

Kamis, 31 Maret 2011

Generating 4 x 4 magic squares ( 2 ) - ( MathCad = MathCrap )

To be precise, my squares would have been magic if I would have only used the numbers 1 to 16 once each. Like in this famous magic square found in 'Melancholia' by Albrecht Dürer.
16 -  3 -  2 - 13
5 - 10 - 11 - 8
9 - 6 - 7 - 12
4 - 15 - 14 - 1

I am trying to find the parameters required by my method to generate this one. As a test.

I am not sure if this is just procrastination or that this qualifies as 'real mathematics'. I suppose it depends on the result and how I document it. Positive side-effects are that I am now much more interested in M373 and that I am still getting better in Mathematica. - Mathematica can be used as a super calculator of course, but I am beginning to use it as a tool to actually do some 'thinking-work' for me.

Am I still studying for B31? Of course!

Well, M373 entered -Yellow Alert- phase. A plus of M373 is that the topics are really, really interesting. But, I don't like MathCad. It is such a honky tonky load of crap, unbelievable. And then we get the 2001 version! I use the latest version, of course, crapwise certainly an improvement over 2001. - The Open University obviously wasn't by their right mind when they chose PTC ( the manufacturers of MathCad ). Perhaps they had no choice because PTC is the only supplier of mathematics software based on British soil. And Maple ( which seems to be almost as good as Mathematica ) courses are being dropped. Students do have limits as to what they will accept though.

Just about to ship a M381 TMA.

Rabu, 30 Maret 2011

Generating 4 x 4 magic squares

Inspired by Ramanujan, I am playing, experimenting, with 4 x 4 magic squares. I have ( independently ) found a way to generate them, infinite many of them if necessary. What's interesting about it is that theoretically the method should work for n x n magic squares.

15 0 9 8
5 5 4 18
5 13 10 4
7 14 9 2

15 10 10 7
6 13 5 18
4 13 11 14
17 6 16 3

16 106 160 79
156 85 6 114
1 88 182 90
188 82 13 78

Two follow-up projects come to mind. 1) A reading experiment. Since I discovered part about mathematics independently ( thanks to Ramanujan's 3 x 3 formula, of course ) reading about this topic in the literature should be quite different compared to reading about a subject you know nothing about, i.e. when the reading-protocol is 'discovery'. Anyway, that is the experiment. 2) A writing experiment. I'll try to write down the method I use with as much rigor as I possibly can. Will I be able to produce something readable? - Unfortunately I have more urgent tasks to handle.