close
close

first Drop

Com TW NOw News 2024

Is the Mona Lisa thinking about irrational numbers?
news

Is the Mona Lisa thinking about irrational numbers?

As a math teacher I sometimes share the following problem-solving strategy: If you are really stuck on a problem, let it sit, come back the next day, and maybe you will have a fresh insight. This often works for me.

58 years later …

I recently applied this strategy with a problem posed by my beloved Bryant High School math teacher Anthony Holman. However, he posed it in 1966, so it took me 58 years before I had any insight. Unfortunately, Mr. Holman passed away in 1985, so I never had the opportunity to discuss this with him.

In calculus class Mr. Holman taught us about e, sometimes called Euler’s number, which is the base of the natural log function. He told us e, like π , would appear in many unlikely places in math, and of course he was right. Then he hypothesized that e and π and other famous irrational numbers were probably part of the great works of art like the Mona Lisa.

That was the only time I remember him making that statement. I had no idea how to approach it. This was 1966, long before computers, even mainframe computers, were readily available to the public. I forgot about his statement for about 55 years.

More recently I have been programming in R, and I have learned a little about computer images. A computer image can be represented as an array of many small elements called pixels, and every pixel is a base 16 number of the hex code of that pixel’s color. I decided to interpret Mr. Holman’s hypothesis as whether a finite sequence of the digits of a number like π were contained within the pixel hex code of the Mona Lisa. I decided to separately test four famous irrational numbers: π, e, φ, and √2.

A quick note about φ: This is the Golden Ratio phi, defined as the ratio of a/b such that φ = a/b = (a + b)/a. The Golden Ratio is well-known to appear in numerous artworks including the Mona Lisa, where various measures of the subject’s face appear in Golden ratio proportions. I am assuming this is not what Mr. Holman intended in his hypothesis.

I am making a few assumptions here. An irrational number is an infinite, non-repeating decimal. I cannot test whether an infinite sequence of digits appears within some other sequence of numbers. So I am truncating these irrational numbers to ten decimal places each, which I think is sufficient for this exercise. The tenth decimal place is truncated, not rounded. Of course the test may pass at ten decimal places and then fail at the eleventh.

Another assumption is that I have a sufficiently high-quality image of the original Mona Lisa. The painting was completed in approximately 1517. It has aged and there has been some physical restoration. A computer image is the result of a photograph, and these photographs also contain some digital retouching. So the result may not be equivalent to the original. Finally, there is a variety of available resolutions including one that has a size of 90 MB. I do not have sufficient computer memory to handle that file size and the calculations of a file that large.

I am also assuming it is sufficient to do this problem with just the Mona Lisa.

In my first attempt, I was able to get the base 16 number of the hex code of every pixel of my Mona Lisa file. The file looks like this for the first six pixels. I show each pixel’s base 16 hex code and its base 10 decimal equivalent.

I converted each of the four irrational numbers from base 10 to base 16. Each irrational number is nine characters in base 16. I created one very long string of the pixel hex codes, and I searched whether each irrational number was contained in the hex string . The string has 1.7 million characters, and I am searching for a nine character sequence. However, the result was none of the irrationals was contained in the string.

I decided the first attempt was faulty. The Mona Lisa was created in a base 10 world, and it didn’t make sense to force the irrationals into an artificial base 16 comparison.

In my second attempt, I converted each base 16 pixel to base 10, to compare against base 10 irrationals. I think this is a more natural comparison, and if an irrational is going to be contained in a larger sequence then it would be as a base ten irrational.

Unfortunately this also failed for each of the four irrationals. So sadly, I cannot confirm Mr. Holman’s hypothesis. Maybe I should let this problem sit for a few more years and come back when I have a fresh idea (or when I buy a computer with more memory). Maybe Mr. Holman has solved it in Heaven. Nevertheless, I’m sure he is smiling at my efforts.

The following is my R code:

# Mona Lisa problem matching base 10 codes
library(imager)
#url1 is huge: 89.9 MB; url2 is 70 KB.
# use url2 unless you have a lot of memory.

url1 url2 img plot(img)

img_data head(img_data) # x, y, cc(color channel: r, g, b, transparent), intensity (normalized 0.1)
dim(img_data) # 722,394 x 4
library(dplyr)
img_data

# Pivot the data to wide format so each pixel has its R, G, B values ​​in separate columns
library(tidyr)
img_wide dim(img_wide) # 240.798 x 5

# Convert normalized values ​​to 0-255 range
img_wide$R img_wide$G img_wide$B

# Convert RGB values ​​to hexadecimal format
img_wide$hex img_wide$hex

# Convert hex values ​​to decimal format
library(Rmpfr) # extended floating point computations
options(scipen = 999)
img_wide$dec

# Check the structure of img_wide
head(img_wide)
# Concatenate dec values ​​into a single string
dec_string nchar(dec_string) # 1701600

test_value1 pi_base10 e_base10 phi_base10 root_two_base10

# Check if the dec string contains the digits of pi, e, phi, root 2

check_irrational if (grepl(value, dec_string)) {
cat(“The first ten digits of”, name, “are present in the pixel data.\n”)
start_position cat(“The match starts at position:”, start_position, “\n”)
} else {
cat(“The first ten digits of”, name, “are not present in the pixel data.”)
}
}

check_irrational(test_value1, “test1”)
check_irrational(pi_base10, “π”)
check_irrational(e_base10, “e”)
check_irrational(phi_base10, “φ”)
check_irrational(root_two_base10, “√2”)

options(scipen = 0)