Featured Postings

In Memoriam 2015

January 1: Donna Douglas: Played daughter Elly May Clampett in The Beverly Hillbillies. (Age 82). 1: Mario Cuomo: Governor of New York (1983 to 1994) (Age 82). 2: James Cecil Dickens: Known as Little Jimmy Dickens, best known for his song May the Bird of Paradise Fly Up ...

Read More

The disappearance of misc.activism.progressive and the emergence of Thought Crime Radio

Almost four years ago, the articles in the USENET newsgroup misc.activism.progressive ground to a halt, and moderator Rich Winkel has all but disappeared from the USENET, whom I learn resided in Harrisburg (up until 2010, at least), a half hour or so drive from his ...

Read More

Sounding off on the end of CanCon and the CRTC

I guess with the recent decision to axe all cancon requirements for daytime programming in Canada, the CRTC is crawling toward its own irrelevance. Let's not be naive, Canadian culture is that much more weakened without the protection it partially enjoyed from American influence. With ...

Read More

Eldred, Saskatchewan on the map … barely

Eldred, Saskatchewan on the map ... barely

I've written about obscure Saskatchewan communities before. Here is another community far to the north of Unity. My ancestors from France settled here. Many of my ancestors were pioneers that broke new farming ground nearest to a community called Eldred, Saskatchewan. Eldred was about 10 km ...

Read More

Zero

Once upon a time, around the year 525 during the reign of Pope John I, a monk named Dionysius invented the idea of Anno Domini by producing a calendar which marked the time since the birth of Christ. The numbering of the years was adopted ...

Read More

Fortune Cookies for Human Rights

Fortune Cookies for Human Rights

You know, I was minding my own business in this classy Chinese restaurant, engorging myself on their copious buffet, had my fill, and was handed the bill with an accompanying fortune cookie. This fortune cookie (the one to the left) really existed, and I never saw ...

Read More

Getting f(x) notation to work in Maple

Getting f(x) notation to work in Maple

Maple is a robust math environment which can graph, solve equations, and solve for the unknown with the aid of its computer algebra solver (CAS), which is capable of computing exact roots of cubic functions, for example. I wanted to demonstrate for myself that Maple could ...

Read More

Kudos to the 1050 CHUM Memorial Blog

Kudos to the 1050 CHUM Memorial Blog

Recently, I've been hit (my website that is) by someone possibly checking his plethora of links from his/her website, and when I back-traced it, I find this cool blog which acts as a convincing historical shrine to the late great 1050 CHUM Radio in Toronto. ...

Read More

The Obfuscation of Electronics: The Behringer Xenyx 502

The Obfuscation of Electronics: The Behringer Xenyx 502

This is more like a meta-review. I have gone to Canada Computes where nearly the entire Behringer line is sold, and was impressed by the specs. But does it do what I want, the way I want it? I face a number of obstacles, being a ...

Read More

Twitter

  • Follow strider_sj on TwitterNew posts and updates will be announced on my twitter account.Follow strider_sj on Twitter
  • Follow me on Twitter

The SJ Wayback Machine

Lava Lamp Clock

Blogs in Canada

See blogs and businesses for Canada

Recreational Math I: 4×4 squares: Some sequences work better than others

I was experimenting with Danny Dawson’s 4×4 magic square script, and began to consider writing my own script. But I just thought I would do a few runs for my own research. I wanted to thank Mr. Dawson for his fine work which I am obviously gaining knowledge from, but his comments page thought I was a spam bot, and rejected my comments. Oh well ….

The central topic of discussion here centers on building an algorithm for a computer program that can search for and find all or most squares, centering on initial construction. But the discussion on pairings work for magic squares generally.

Some number pairings work better on the 4×4 square than others. What I mean by number pairings are two sequential numbers being placed next to each other along a column or row of the magic square. Dawson’s script allows me to place any numbers on the magic square, and it would output all of the magic squares that fit the arrangement of numbers I suggested by filling in the rest. I only worked with two numbers, and it would suggest to me complete squares which work with that placement of a pair of numbers. Some number pairs resulted in more than one magic square, while other pairs gave no squares.

It would tell me that in a computer algorithm for such squares, if an “unsuccessful” pair of numbers show up next to each other in a magic square made by a brute force algorithm such as Dawson’s, the smart thing to do is to detect this situation and abandon the square’s construction, thus saving computer procesing time, an amount of time Dawson attested to as being potentially long, on the order of hours at best, to decades at worst.

My research was far from thorough, but I think I took into account most situations where the pairings would show up, barring left-right reflections, rotations, or up-down reflections of the same square.  It is possible I may have missed some, due to clues that seemed to be left behind by some of the successful combinations. And I only considered pairings of sequential numbers, not just any pairings of numbers, of which there are (16 × 15)/2 = 120 combinations.

First, the combinations of sequential numbers that were NOT successful: “3  4”, “7  8”, “9  10”, “11  12” and “13  14”. Finding these pairs next to each other resulted in nothing output in all of the ways they might show up that I’ve tried. This is likely not the true situation, since when I tried “5  6”, only one unique square was found (and no others); while an attempt to try the famous Durer pun “1514” on two adjacent squares resulted in nothing until I moved the “15  14” to the centre columns of the top row. No other unique solutions were found for the Durer pun. None at all.

If a programmer were serious to find such “rare” solutions, then he or she would not consider ignoring these sequential pairs. On the other hand, if missing a half dozen or so squares is not important, then one is wise to look for these sequences in a row or column and abandon all such squares to save time, rather than making a square that is destined to fail.

In fact, it would be worth considering to check for these pairings before checking for “magic”, although both the pairings and magic can be done on-the-fly, during construction as a way of bailing out early and moving on.

All other successful pairings:

  • 1 2, and 2 3 both gave generous numbers of squares
  • 4 5: gave patterns reminiscent of the Durer square
  • 5 6: only 1 square was found in my trials
  • 6 7, 8 9, 10 11, 12 13: all gave generous numbers of squares
  • 14 15: only worked if these numbers appeared in the middle columns of the top row (means that the bottom row and both left and right sides should work also; in addition, the “15 14” combination should work in the same way) (11 solutions)
  • 15 16: Gave a few solutions, but only in the first and second cells of the first row, as far as I can tell.

Obviously, the five “failed” pairings given above are not the whole picture. Of the 120 possible pairs of numbers between 1 and 16 that can exist, there are obviously more pairs that would result in no square being formed, thus saving more time.

Share

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>