Subject: Avogadro's Number (2)
This applet counts from 0 to Avogadro's number and displays elapsed time. As it is in Java, it is platform independent - it will run in any browser provided it is Java-enabled. Since Java can handle larger (Java can handle up to 1.7 x 10^308!!!) numbers than other languages, it is well suited for this purpose. Given the inherent inaccuracies in representing real numbers of large magnitude in terms of bits, the likelihood of ever truly reaching Avogadro's number is fairly small. Even with this degree of inaccuracy, the elapsed time is still staggering.
This applet is correct to at least 15 significant digits ("double" precision). The actual time to reach Avogadro's number will vary from computer to computer and even from trial to trial, depending on a number of factors: processor speed, CPU load, etc.
Applets often have problems repainting themselves after the browser window is obscured, closed or resized. I therefore recommend that the browser window be resized to just slightly larger than the applet size before initiating the counting process. It should then be left alone until completion. If this is not possible, the elapsed time and the count will still be updated and displayed properly. The only problem is that certain areas of the applet will not be painted properly.
This applet may be incorporated into an existing page or viewed from the HTML code provided. All that is needed is a computer with a Java-enabled browser. Permission to distribute this freely by any means is granted, provided due credit is given to the author.
Perry Schlanger (firstname.lastname@example.org)
Webmaster's note: The two files available for downloading are not required to run this applet from the current web browser window. They are included in the event you wish to use this applet on another web page. The zip file can be uncompressed on any PC with an upzip program. The executable file is a self-extracting version of the same files and does not require an unzip program.