Disappearing lines

Here the task is similar to that of shifting staircases. In the applet below, there again are two parts - a stationary lower part and a moving upper part. To open the eyes one should slide the upper part up and to the right one notch.


This applet requires Sun's Java VM 2 which your browser may perceive as a popup. Which it is not. If you want to see the applet work, visit Sun's website at https://www.java.com/en/download/index.jsp, download and install Java VM and enjoy the applet.


Now, if you count the number of lines displayed, you'll discover that, compared to the original diagram, there is one line less. I assure you that no cheating is involved here. You could perform this trick on a piece of paper with the same result. Where did the line go?

Actually nowhere. The total length of the newly obtained lines is the same as the total length of the original ones.

This puzzle may seem to have little educational content. But this is not the case. Try to figure out how the moving part has been implemented. Everything is being drawn in real time. How would you do this?

A second reason for my creating the applet is what's called nowadays software reuse. Writing software is a very expensive and error prone undertaking. About 9-10 years ago it was realized what great advantage might be drawn from creating reusable components which eventually lead to the appearance of Object-Oriented languages and programming. Java is such an object-oriented language. I'd consider this a sin not to make a good use of Java's object-oriented nature.

This puzzle is described by Martin Gardner in his delightful "aha! Gotcha".

|Contact| |Front page| |Contents| |Eye opener| |Geometry|

Copyright © 1996-2018 Alexander Bogomolny [an error occurred while processing this directive]
[an error occurred while processing this directive]