Archive for Mathematica

Le Monde puzzle [#887ter]

Posted in Books, Kids, Statistics, University life with tags , , , , on November 27, 2014 by xi'an

Here is a graph solution to the recent combinatorics Le Monde mathematical puzzle, proposed by John Shonder:

N is a golden number if the sequence {1,2,…,N} can be reordered so that the sum of any consecutive pair is a perfect square. What are the golden numbers between 1 and 25?

Consider an undirected graph GN with N vertices labelled 1 through N. Draw an edge between vertices i and j if and only if i + j is a perfect square. Then N is golden if GN contains a Hamiltonian path — that is, if there is a connected path that visits all of the vertices exactly once.g25I wrote a program (using Mathematica, though I’m sure there must be an R library with similar functionality) that builds up G sequentially and checks at each step whether the graph contains a Hamiltonian path. The program starts with G1 — a single vertex and no edges. Then it adds vertex 2. G2 has no edges, so 2 isn’t golden.

Adding vertex 3, there is an edge between 1 and 3. But vertex 2 is unconnected, so we’re still not golden.

The results are identical to yours, but I imagine my program runs a bit faster. Mathematica contains a built-in function to test for the existence of a Hamiltonian path.

g36Some of the graphs are interesting. I include representations of G25 and G36. Note that G36 contains a Hamiltonian cycle, so you could arrange the integers 1 … 36 on a roulette wheel such that each consecutive pair adds to a perfect square.

A somewhat similar problem:

Call N a “leaden” number if the sequence {1,2, …, N} can be reordered so that the sum of any consecutive pair is a prime number. What are the leaden numbers between 1 and 100? What about an arrangement such that the absolute value of the difference between any two consecutive numbers is prime?

[The determination of the leaden numbers was discussed in a previous Le Monde puzzle post.]

National Gallery of Ireland

Posted in pictures, R, Travel with tags , , , , , , , on October 16, 2011 by xi'an

During a short if profitable visit to Dublin for a SFI meeting on Tuesday/Friday, I had the opportunity to visit the National Gallery of Ireland in my sole hour of free time (as my classy hotel was very close). The building itself is quite nice, being well-inserted between brick houses from the outside, while providing impressive height, space, and light from the inside.

The masterpiece gallery is quite small (unless I missed a floor!), if filled with masterpieces like a painting by Caillebotte I did not know.

 

The modern art gallery was taken by a temporary (and poorly exposed) exhibit that includes live happenings (five persons wearing monkish outfits standing around a mommy floating in mid-air), tags (!), and two interesting pieces: one was made of several tables filed with piles of books glued together and sculpted, giving an output that looked like 2-D histograms, and reminding me of the fear histograms discussed on  Statisfaction by Julyan a few days ago. (Note the Mathematica book in the last picture!) While I love books very much, I am also quite interested in sculptures involving books, like the one I saw a few years ago where the artist had grown different cereals on opened books: although it may sound like an easy trick (food for thought and all that), the result was amazing and impressive!

The second piece was a beautiful board illuminated by diodes which felts very warm and comforting, maybe in reminiscence of the maternal womb, of candles, or of myriads of galaxies, but very powerful in any case. (I usually dislike constructs involving light, like the neon sculptures of the 80’s, so I started with an a priori against it.) I could have stayed there for hours…

A ridiculous email

Posted in Books, R, Statistics with tags , , , on May 11, 2010 by xi'an

Wolfram Research presumably has a robot that sends automated email following postings on arXiv:

Your article, “Evidence and Evolution: A review”, caught the attention of one of my colleagues, who thought that it could be developed into an interesting Demonstration to add to the Wolfram Demonstrations Project.

The Demonstrations Project, launched alongside Mathematica 6 in May 2007, is a collection of over 5,000 interactive Demonstrations that cover myriad subjects, interests, and skill levels. The Demonstrations are free to download and manipulate thanks to Mathematica Player, which is also free. Building a Demonstration is a simple and straightforward process. If you have little or no experience with Mathematica, you may want to attend one of our free online seminars. In our S14 seminar, “Creating Demonstrations,” members of the Demonstrations team guide you step-by-step through the authoring process.

Your published Demonstrations will appear on the Wolfram Demonstrations Project website, which averages over 50,000 hits a week. We welcome any questions you might have, and look forward to seeing a Demonstration submission from you soon.

but they definitely got it all wrong there! They picked my book review of a philosophy of science book, Evidence and Evolution, where I complain of the lack of a true experiment..!