Traveling Salesman Puzzle

A salesman knocks on the door of a house.

When a woman answers the door, he asks her how many children she has.

She replies, “3”.

He then asks their ages.

Offended, she replies obscurely, “The product of their ages is 36.”

He says that he needs more information.

She replies, “The sum of their ages is the address of the house next door.”

Even though he is a gifted amateur mathematician, he explains that this is still not enough information.

She replies, “My oldest plays the piano.”

He says “Thank you.”, and writes their name in his notebook.

What are the ages (integer years) of the three children?


My solution:

Possible ages of 3 kids whose product is 36 (I*J*K=36) are:

(1 1 36), (1 2 18), (1 3 12), (1 4 9), (1 6 6), (2 2 9), (2 3 6), (3 3 4)

Sums of these possible age sets are:

(I+J+K) = 38, 21, 16, 14, 13, 13, 11, 10

That you need to know that there is an oldest child (who plays piano) suggests that you need to decide between (1 6 6) and (2 2 9) which both sum to 13.

My answer for kids ages are 2, 2, and 9.

Categories: Story Tags: Tags: , , ,

Circles in a Rectangle

Geometry Puzzle:

You have a 6×7 rectangle with a 6 diameter circle cut from one side.

What is the largest circle that you can cut from the remaining material?

Find the largest circles that fit in the rectangle.

Find the largest circles that fit in the rectangle.



(r + 3)² = (4 – r)² + (3 – r)²

0 = r² – 20 r + 16

r = 10 – sqrt(100 – 16) ~ 0.834849

Categories: Geometry Tags: Tags: , ,

IDL for Rapid Scripting of Image Processing

Interactive Data Language (IDL) is a language environment for rapidly scripting algorithms for processing imagery. IDL is closely tied to the more graphical ENvironment for Visualizing Images (ENVI) image processing environment from the same company. This simple high-level scripting language, supported by extensive tools, enables quickly hacking algorithms to find workable solutions.


IDL enables rapidly roughing out ideas at a high level by freeing developers from first building an extensive tool-kit of common image processing routines. As with most scripting languages, there is no need to declare variables with specific data types as in lower-level languages like C/C++. This level of control is available for optimizing performance on large arrays of data.

IDL is interactive, allowing the developer to enter and execute code fragments line by line without compiling and linking. Once the code fragment matures to being useful, it is simple to edit into a text file that can be run as a function or program within the IDL environment. Although the IDL library of functions is extensive, there will always be more functions that you will want to add.

As functions in IDL mature, they can be ported to lower level languages and compiled into binary executable code or libraries to improve speed and reduce memory requirements.

You can continue running algorithms in IDL as long as you have a licensed copy. But applying your algorithms more broadly on machines that do not have IDL, will require porting to another language.

Although there is an open-source version of MatLab, Octave, I have not heard of an open-source version of IDL. IDL does have a virtual machine that enables running IDL code “compiled” on a fully licensed version.