Re: "Strong typing vs. strong testing"

R

RG

Gregory Ewing said:
That's not true. Consider the distance travelled by a
falling object: y(t) = y0 + v0*t + 0.5*a*t**2. Here t has
dimensions of time, and it's being raised to different
powers in different terms. It works because the
coefficents have dimensions too, and all the terms end up
having the same dimensions.

This reminds me of back when I was a kid and my dad was trying to teach
me basic physics. He kept saying that the acceleration of gravity was
9.8 meters per second squared and I just couldn't wrap my brain around
what it meant to square a second.

Now that I think about it, I still can't. :)

rg
 
T

Tim Bradshaw

But what exactly *is* this number? Is it 0.25, 1.57 or 90?

Its pi/2, the same way 90% is 9/10.

I can also write 12 inches, 1 foot, 1/3 yards, 1/5280 miles, 304.8 mm
and so on. They are all the same number, roughly 1/131000000 of the
polar circumference of the Earth.

They are not numbers they are lengths.
 
R

RG

+---------------
| This reminds me of back when I was a kid and my dad was trying to teach
| me basic physics. He kept saying that the acceleration of gravity was
| 9.8 meters per second squared and I just couldn't wrap my brain around
| what it meant to square a second.
|
| Now that I think about it, I still can't. :)
+---------------

Write it our longhand and it's easier to grok:

9.8 m/s^2 ==> 9.8 m/(s*s) ==> 9.8 m/(s*s) ==>
(9.8 meters per second) per second.
\ /
\__ speed added __/ per second

Oh, that part I get. It's the abstract squared second that's still a
deep mystery to me. A squared length is easily visualized. But
according to relativity space and time are just two aspects of the same
thing, so a squared second should make some kind of physical sense.

rg
 
B

BartC

RG said:
It's an irrational number, so it cannot be written out exactly. But
it's approximately 1.57.

My money would have been on 0.25, based on using 1.0 for a 360° circular
angle. It seems far more attractive than using the arbitrary-looking 6.28...

(I understand that when 2 pi is used, this works more naturally in certain
mathematical formulae.)
These aren't numbers, these are lengths. They correspond to a physical
thing out there in the real world. Numbers don't.


Why does it seem "little different"? That is exactly the difference.
What you're doing in your "1/131000000 of the polar circumference of the
Earth" is taking the number 1/131000000 and using it to describe a
length.

My example was based on the fact that a metre was once defined as 1/10000000
of the equator-pole distance. They were taking the number 1/10000000 and
using it to describe a length (of a unit called a metre).

Above, you're using 1/(two pi), and using it to describe an angle (of a unit
called a radian).

The only difference is that on a different planet, they would almost
certainly use a different unit for length, but would quite possibly still
use radians for angles, amongst others units.
 
T

Tim Bradshaw

My money would have been on 0.25, based on using 1.0 for a 360°
circular angle. It seems far more attractive than using the
arbitrary-looking 6.28...

It may look arbitrary, but it isn't: it's about as non-arbitrary as it
is possible to be.
 
S

Steven D'Aprano

Hmmm, my ISP's news software really doesn't like it when I cross-post to
more than three newsgroups. So, trying again without comp.lang.c.

But what exactly *is* this number? Is it 0.25, 1.57 or 90?

That's the wrong question. It's like asking, what exactly "is" the number
twenty-one -- is it "one and twenty", or 21, or 0x15, or 0o25, or 21.0, or
20.999... recurring, or 63/3, or XXI, or 0b10101, or "vinet et un", or any
one of many other representations.

Whether you say "two tens plus one unit" or "two to the power of four plus
two to the power of two plus two to the power of zero", the number is the
same number. So long as you use a consistent notation, the results you get
is independent of the notation. (Of course, some notations are more
convenient than others.)

Likewise, it doesn't matter whether you write 45° or π/4 radians, the
angle you are describing -- the number -- is the same. It turns out that
trigonometric functions have very nice (= important, useful) mathematical
properties if the notation we use for angles is the radian measure, where
2Ï€ radians make a full circle. This leads some people to mistakenly say
that radians are more fundamental than degrees, or that they are the
"actual" value for the angle.

But that's like saying that binary is the "actual" base for numbers
because addition and subtraction in binary have the nice property that
they're easy to implement in electrical circuits. Well, yes, and those
properties are very important, and mathematicians have done the sensible
thing to declare radians to be "the" mathematical measure of angles, but
triangles will still be triangles regardless of whether we represent the
angles using base ten radians or balanced ternary rational fractions. No
matter what language we use to represent a number, the properties of the
number remain the same. Or to put it another way, a rose by any other
name would smell just the same.
 
S

Steven D'Aprano

What's to prove? That's the definition of pi.

Incorrect -- it's not necessarily so that the ratio of the circumference
to the radius of a circle is always the same number. It could have turned
out that different circles had different ratios.

In fact, in the real world, this *is* the case -- as space-time is not
flat except far away from any gravitational mass, classical geometry is
only approximately valid for real circles.

Even in mathematics, there are spherical and hyperbolic geometries that
doesn't assume that the angles in a triangle add to 180 degrees, or
another way of putting it, that the ratio of circumference to radius is
not necessarily pi.

http://mathforum.org/library/drmath/view/55021.html
 
A

Arnaud Delobelle

Tim Bradshaw said:
It may look arbitrary, but it isn't: it's about as non-arbitrary as it
is possible to be.

Consider a few formulae that kids learn at school.

In radians, given an angle θ in a circle of radius r:

* length of arc = rθ
* area of sector = 1/2 r²θ
* d/dx(sin x) = cos x
* d/dx(cos x) = -sinx x

Let's use 1 for the angle 2Ï€. Then:

* length of arc = 2πrθ
* area of sector = πr²θ
* d/dx(sin x) = 2Ï€cos x
* d/dx(cos x) = 2Ï€sin x

We've removed one π, but now π crops up in every formula!
 
T

Tim Bradshaw

ncorrect -- it's not necessarily so that the ratio of the circumference
to the radius of a circle is always the same number. It could have turned
out that different circles had different ratios.

But pi is much more basic than that, I think. My background is in
physics so I tend to do things from the geometrical point of view - and
obviously you are correct that there are non-euclidean geometries. But
pi crops up, for instance, when dealing with complex numbers (e^(i pi)
= -1 is the poster-child formula for this), and there are all sorts of
series expressions for pi which have no really obvious geometrical
interpretation.

(Of course, my view of the pi-in-complex-numbers is that this is
because complex numbers turn out to essentially //be// two-dimensional
euclidean geometry, but that's mostly because I want eerything to be
geometry I think. In any case, I think you can get to pi being
important in the same sort of way that you can get to e being
important.)

(And, it sounds in the above like I think you might not know that pi
crops up in complex numbers: that's just clumsy wording, sorry).
 
A

Antoon Pardon

Incorrect -- it's not necessarily so that the ratio of the circumference
to the radius of a circle is always the same number. It could have turned
out that different circles had different ratios.

If that is your concern, you should have reacted to the previous poster
since in that case his equation couldn't be proven either.

Since by not reacting to the previous poster, you implicitely accepted
the equation and thus the context in which it is true: euclidean geometry.
So I don't think that concerns that fall outside this context have any
relevance.
 
K

Keith Thompson

RG said:
This reminds me of back when I was a kid and my dad was trying to teach
me basic physics. He kept saying that the acceleration of gravity was
9.8 meters per second squared and I just couldn't wrap my brain around
what it meant to square a second.

Now that I think about it, I still can't. :)

Fuel economy can be measured in reciprocal acres (or reciprocal
hectares if you prefer).

miles/gallon or km/liter is distance / distance**3 --> distance**-2.
 
P

Pascal J. Bourguignon

Steven D'Aprano said:
Hmmm, my ISP's news software really doesn't like it when I cross-post to
more than three newsgroups. So, trying again without comp.lang.c.



That's the wrong question. It's like asking, what exactly "is" the number
twenty-one -- is it "one and twenty", or 21, or 0x15, or 0o25, or 21.0, or
20.999... recurring, or 63/3, or XXI, or 0b10101, or "vinet et un", or any
one of many other representations.

This is not the wrong question. These are two different things.

In the case of 0.25, 1.57 or 90, you have elements of the same set of
real numbers â„, which are used to represent the same entity, which IS NOT
a number, but an angle. Angles are not in the â„ set, but in â„/2Ï€, which
is an entirely different set with entirely different properties.



In the other case, we have strings "21", "0x15", "0o25", "21.0",
"20.999...", "63/3", "XXI", "0b10101", "vingt et un", that represent the
same number in â„.




So you have different pairs of sets and different representationnal
mapping. There's very little in common between an angle of 90 degree,
and the number 21.



Likewise, it doesn't matter whether you write 45° or π/4 radians, the
angle you are describing -- the number -- is the same.

No. The numbers ARE different. One number is 45, the other is π/4.
What is the same, is the angle that is represented.

I cannot fathom how you can arrive at such a misunderstanding. It's
rather easy to picture out:

â„.... .....â„/2Ï€......................
: : : :
: : degree : full turn :
: 45 ----------------------\ :
: : : \ :
: : : angle of an eighth of a turn :
: : radian : / :
: π/4 ---------------------/ :
: : : quarter turn :
: : : :
....... ................................
 
S

Steven D'Aprano

But pi is much more basic than that, I think.

Well yes it is, but how did anyone *know* that it was? How did anyone
even know that there was a constant pi = 3.1415... ? It's not like it was
inscribed on the side of some mountain in letters of fire 100 ft high,
and even if it were, why should we believe it?

The context of my comment was the statement that there is no need to
prove that C = 2Ï€r because that's the definition of pi. That may be how
pi was first defined, but the Greeks didn't just *decide* that the ratio
C/r was a constant, they discovered it. They constructed a pair of
regular polygons with n sides, the circle inscribing one polygon and in
turn being inscribed by the second, and observed that as n approached
infinity two things happened: the inner and outer polygons both became
infinitesimally close to the circle, and the ratio of the perimeter of
either polygon to twice the radius approached the same constant.

By modern standards it wasn't *quite* vigorous -- the Greeks hadn't
invented calculus and limits, and so had to do things the hard way -- but
nevertheless it was an inspired proof. I call it a proof rather than a
definition because, prior to this, nobody knew that there was such a
number as pi, let alone what it's value was.
 
S

Steven D'Aprano

If that is your concern, you should have reacted to the previous poster
since in that case his equation couldn't be proven either.

"Very difficult to prove" != "cannot be proven".

Since by not reacting to the previous poster, you implicitely accepted
the equation and thus the context in which it is true: euclidean
geometry. So I don't think that concerns that fall outside this context
have any relevance.

You've missed the point that, 4000 years later it is easy to take pi for
granted, but how did anyone know that it was special? After all, there is
a very similar number 3.1516... but we haven't got a name for it and
there's no formulae using it. Nor do we have a name for the ratio of the
radius of a circle to the proportion of the plane that is uncovered when
you tile it with circles of that radius, because that ratio isn't (as far
as I know) constant.

Perhaps this will help illustrate what I'm talking about... the
mathematician Mitchell Feigenbaum discovered in 1975 that, for a large
class of chaotic systems, the ratio of each bifurcation interval to the
next approached a constant:

δ = 4.66920160910299067185320382...

Every chaotic system (of a certain kind) will bifurcate at the same rate.
This constant has been described as being as fundamental to mathematics
as pi or e. Feigenbaum didn't just *define* this constant, he discovered
it by *proving* that the ratio of bifurcation intervals was constant.
Nobody had any idea that this was the case until he did so.
 
S

Steven D'Aprano

This is not the wrong question. These are two different things.

Which is why I said it was LIKE asking the second.

In the case of 0.25, 1.57 or 90, you have elements of the same set of
real numbers â„, which are used to represent the same entity, which IS
NOT a number, but an angle. Angles are not in the â„ set, but in â„/2Ï€,
which is an entirely different set with entirely different properties.

It's quite standard to discuss (say) sin(theta) where theta is an element
of â„. The fact that angles can extent to infinity in both directions is
kind of fundamental to the idea of saying that the trig functions are
periodic.
So you have different pairs of sets and different representationnal
mapping. There's very little in common between an angle of 90 degree,
and the number 21.

Would it have been easier to understand if I had made the analogy between
angles and (say) time? A time of 1 minute and a time of 60 seconds are
the same time, regardless of what representation you use for it.

No. The numbers ARE different. One number is 45, the other is π/4.
What is the same, is the angle that is represented.

Fair enough. I worded that badly.
 
A

Arnaud Delobelle

Steven D'Aprano said:
"Very difficult to prove" != "cannot be proven".

But in another section of your previous post you argued that it cannot
be proven as it doesn't hold in projective or hyperbolic geometry.
You've missed the point that, 4000 years later it is easy to take pi for
granted, but how did anyone know that it was special? After all, there is
a very similar number 3.1516... but we haven't got a name for it and
there's no formulae using it. Nor do we have a name for the ratio of the
radius of a circle to the proportion of the plane that is uncovered when
you tile it with circles of that radius, because that ratio isn't (as far
as I know) constant.

Perhaps this will help illustrate what I'm talking about... the
mathematician Mitchell Feigenbaum discovered in 1975 that, for a large
class of chaotic systems, the ratio of each bifurcation interval to the
next approached a constant:

δ = 4.66920160910299067185320382...

Every chaotic system (of a certain kind) will bifurcate at the same rate.
This constant has been described as being as fundamental to mathematics
as pi or e. Feigenbaum didn't just *define* this constant, he discovered
it by *proving* that the ratio of bifurcation intervals was constant.
Nobody had any idea that this was the case until he did so.

But you were claiming that the proposition "C = 2Ï€r is the definition of
π" was false. Are you claiming that "δ is defined as the ratio of
bifurcation intervals" is false as well? If you are not, how does this
tie in with the current discussion?

Also, it is very intuitive to think that the ratio of the circumference
of a circle to it radius is constant:

Given two circles with radii r1 and r2, circumferences C1 and C2, one is
obviously the scaled-up version of the other, therefore the ratio of
their circumferences is equal to the ratio of their radii:

C1/C2 = r1/r2

Therefore:

C1/r1 = C2/r2

This constant ratio can be called 2Ï€. There, it wasn't that hard. You
can pick nits with this "proof" but it is very simple and is a convincing
enough argument.

This to show that AFAIK (and I'm no historian of Mathematics) there
probably has never been much of a debate about whether the ratio of
circumference to diameter is constant. OTOH, there were centuries of
intense mathematical labour to find out the value of π.
 
G

Gregory Ewing

RG said:
I just couldn't wrap my brain around
what it meant to square a second.

That's nothing. Magnetic permeability is measured in
newtons per square amp...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top