Saturday, April 20, 2019

mathematics - Hidden in plain sight - By what method do these images hide a prime number?



Note: This question has been severely edited from its original version to better fit the format of this site. Some answers below - including the accepted, correct answer - have been given based on the original question.






Consider the following two digital images below:


Image 1 Image 2


Although they depict two very different things, they share a strong common feature: They hide an identical 3-digits prime number within themselves.


Not only do the hide the identical number, but they hide it by the identical method.



If you apply the method on image one, you'll get the prime number.
If you apply the identical method in the identical way to the other image, you will get the same prime number.





Important hints & restrictions:




  • The answer to this puzzle is not an ambiguous or subjective solution. Subjective interpretation is not involved.
    ("...looks like..."; "...reminds me of..."; "...could be interpreted as...";... are all invalid concepts.)




  • The answer lies within the image itself and can not be 'forced' upon it by altering the data.
    ( "...paint everything black and draw the prime onto it...";... is not a valid answer. )





  • There is no hidden meta-data to the images.
    (You can right-click & save it from here; or you may print it and then rescan it again; or you may simply take a good picture of you screen and use that; all of this will keep the image suitable for the method in question. However, you do need to use a computer to find the answer -- simply looking at the images does not suffice.)





Answer



The answer is 101, which you can see



by computing the Fourier transform.
Fourier transform




How this works


You can think of an image as a function $F$ of two variables, $x$ and $y$. $x$ and $y$ represent the horizontal and vertical positions of each pixel, and $F(x,y)$ represents the pixel intensity (lightness or darkness). Now it turns out that any periodic function (and with images we only care about a finite range, so we can always just suppose $F$ to repeat once you reach the image boundaries) can be represented as a weighted sum of sine and cosine functions of different frequencies. These sums are called fourier series; the image below (taken from Wolfram MathWorld) shows various sums of sinusoids converging to a few different periodic functions in the one-dimensional case.


Fourier series examples from MathWorld


Note that in general for this representation to be exact for a continuous function you may need an infinite number of terms in the sum. However, in the discrete case, you only need to sum over as many different frequency values as you have samples (pixels) of the original function (image).


So in our discrete, two-dimensional case, what we have is this: a function $F(x,y)$ representing an image of size M-by-N can be written as a weighted sum of 2D sinusoids with horizontal frequency $u$ and vertical frequency $v$, where $u$ ranges from $1$ to $M$ and $v$ ranges from $1$ to $N$. You can think of the weight of each term as a function, say $G$, of the frequency variables $u$ and $v$. There's then nothing stopping you from thinking of $u$ and $v$ as horizontal and vertical positions of a new image, with $G(u,v)$ determining pixel intensity at each point. This is the process that was carried out to produce the "101" image above.


I've tried to keep this explanation as non-technical as possible; if you'd like to see the gory details of how the coefficients are actually calculated, MathWorld's Discrete Fourier Transform article has a nice overview of the 1D case. You can see the (relatively straightforward) generalization to two dimensions here.


To play around with this stuff yourself you could try ImageJ, a public domain image processing package developed by the NIH. It'll do all the dirty work for you -- just install, open an image, and select Process->FFT (Fast Fourier Transform).


To see a reason (one of the many, I swear) why you'd bother to do this outside of solving puzzles, try this nice, quick example of using FFT filtering in ImageJ to remove periodic noise from an image.


For a deep understanding of why this works, I recommend a course in applied analysis. (Or, I'm sure, any number of good books or online tutorials -- but I don't know what the good ones are, so I won't try to suggest one.)



No comments:

Post a Comment

classical mechanics - Moment of a force about a given axis (Torque) - Scalar or vectorial?

I am studying Statics and saw that: The moment of a force about a given axis (or Torque) is defined by the equation: $M_X = (\vec r \times \...