August
30, 2002: We were sidetracked again this week by an interesting project
- converting a differential equation solver to Delphi.
Don't let your eyes glaze over just yet. There are lot's of academicians
to supply us with the equations describing how things work. We just
need to be able to convert them to numbers we can print, plot or
otherwise play with. Here's a
Runge-Kutta
program over in Math Topics with procedures and test cases for solving
Second Order Ordinary Differential
Equations with Known Initial Conditions. Machines that follow Newton's Laws of
Motion including projectiles,
rolling or sliding objects, pendulums, spring-mass systems, etc.
can be described with equations of this type. Useful indeed
for those of us interested in computer simulations of the real
world.
August 25, 2002: I've been working on Linkages, a
mechanical linkages simulator program this week, but it's going to take at
least another week to get anything even close to working. In the
meantime here are a couple of others of the "Can You Find?"
or "T-Shirt" variety that somehow had never gotten
posted. Pandigital
Numbers introduces that topic and asks for the smallest
pandigital that is a perfect square and the smallest number that, together
with its square, contains all of the digits from 1 through 9.
Remainder
of 1 looks for, (and finds), the smallest multiple of 13 that leaves a
remainder of 1 when divided by integers 2 through 12. We
do this in a couple of ways and compare run times measured in
microseconds. (The smart way is about 100 times faster.)
August 16, 2002: An Oscilloscope program driven by
sound card inputs has been on my list for quite a while. I finally
bit the bullet and did it this week. Here's
A
Simple Oscilloscope program that is just that.

If you use a microphone for input and click your tongue
and the "Stop Display" button at the same time, you can prove
for yourself that there are really two distinct sounds generated - one
when your tongue leaves the roof and the other when it
slaps the floor (of your mouth, of course :>)).
August 11, 2002: While developing the
"Know-Don't Know" program I fixed a silly timing problem in the U_Primes
unit which tests for primality. The IsPrime function now runs
about 100 times faster than it did last week. I posted the fix
today over in Prime Factors 1
where U_Primes originally appeared.
August 10, 2002: Here's a program that solves
"The
Know-Don't Know Logic Problem", sometimes called "The Impossible
Problem" or "The Sum-Product Problem".
Two integers, A and B, each between 2 and 100 inclusive, have been chosen.
The product, A×B, is given to mathematician Dr. P. The sum, A+B, is given to mathematician Dr. S. They each know the range of numbers. Their
conversation is as follows:
P: "I don't have the foggiest idea what your sum is, S."
S: "That's no news to me, P. I already knew that you didn't know. I don't know
either."
P: "Aha, NOW I know what your sum must be, S!"
S: "And likewise P , I have figured out your product!!"
What are the numbers?
It takes a little convoluted reasoning to solve it
and most explanations left me slightly puzzled. My
approach includes the best explanation you'll find (he said
immodestly ).
August 7, 2002: Well, it took 18 years, but here at
last is the Logic Problem
Solver program. Actually, I haven't been working on it for
that long but the original Turbo Pascal version was last compiled in
1994. I converted it to Delphi and Windows and added the user
interface a couple of years ago. This past month I finally worked up the
courage to delve back in and make the 5000+ lines of code fit for
posting.
The
program solves problems like: "Mrs.
Anderson bought boots. She has three more children than the mother
(not Mrs. Counts) who used her credit card to buy shirts.
etc., etc. ...... What item of clothing did each mother buy, how did
she pay, and how many children does she have?".
In
addition to solving these problems with pencil and paper, there are three ways to play with the
program:
as a "Solver" your job is to extract enough facts and rules from the
included sample problems so that the program can figure out the
solution. As an "Author" you can enter new problem
descriptions . And finally, as a "Programmer" you can
try to figure out how the heck it works (and perhaps make it work
better).