Re: "Strong typing vs. strong testing" [OT]

2010-10-29 Thread Gregory Ewing

Mark Wooding wrote:


Would the world be a better place if we had a name for 2 pi rather than
pi itself?


I don't think so. The women working in the factory in India
that makes most of the worlds 2s would be out of a job.

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-23 Thread Mark Wooding
Steven D'Aprano  writes:

> Well, what is the definition of pi? Is it:
>
> the ratio of the circumference of a circle to twice its radius;
> the ratio of the area of a circle to the square of its radius;
> 4*arctan(1);
> the complex logarithm of -1 divided by the negative of the complex square 
> root of -1; 
> any one of many, many other formulae.
>
> None of these formulae are intuitively correct; the formula C = 2πr isn't 
> a definition in the same sense that 1+1=2 defines 2. The point that I was 
> trying to get across is that, until somebody proved the formula, it 
> wasn't clear that the ratio was constant.

There are several possible definitions of `2'.  You've given a common
one (presumably in terms of a purely algebraic definition of the
integers as being the smallest nontrivial ring with characteristic 0).
Another can be given in terms of Peano arithmetic, possibly using an
encoding of Peano arithmetic using only the Zermelo-- Fraenkel axioms of
set theory: at this point one has only a `successor' operation and must
define addition; the obvious definition of 1 and 2 are s(0) and s(s(0))
respectively, and one then has an obligation to prove that s(0) + s(0) =
s(s(0)), though this isn't very hard.

I think my preferred definition of `pi' goes like this (following Lang's
/Analysis I/).  Suppose that there exist real functions s and c, such
that s' = c and c' = -s, with s(0) = 0 and c(0) = 1.  One can prove that
a pair of such functions is unique, and periodic.  Define pi to be half
the (common) period of these functions.  (Now we notice that they factor
through the quotient ring R/(2 pi) and define `sin' and `cos' to be the
induced functions on the quotient ring.)

Would the world be a better place if we had a name for 2 pi rather than
pi itself?

-- [mdw]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-14 Thread Arnaud Delobelle
Steven D'Aprano  writes:

> On Wed, 13 Oct 2010 21:52:54 +0100, Arnaud Delobelle wrote:
>> 
>> 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:
>
> That's exactly the sort of thing Peter Nilsson was talking about when he 
> said "Most attempts by students collapse because they assume the formula 
> in advance". It might be "obvious" to you that the two circles are merely 
> scaled up versions of each other, but that is equivalent to assuming that 
> the ratio of the circumference to radius is a constant. Well, yes, it is 
> (at least under Euclidean geometry), but assuming it is a constant 
> doesn't allow you to prove it is a constant -- that's circular reasoning, 
> if you excuse the pun.

There is no circular reasoning.  Read on to find out why.

A circle is, by definition, the locus of points equidistant from a given
point (called its centre), and this constant distance is what we call
its radius.

Let's have two circles with the same centre and radii r1 and r2.  Let's
scale up (from the centre) the first one by a factor r2/r1.  Because all
the points the first circle are r1 units of length away from the centre,
all the points on the scaled up version are r1*r2/r1 = r2 units of
length from the centre.  So the scaled up version of the first circle
*is* the second circle.

I'll let you solve the case when the centres are distinct.

-- 
Arnaud

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-14 Thread Gregory Ewing

Steven D'Aprano wrote:
under Euclidean 
geometry, there was a time when people didn't know whether or not the 
ratio of circumference to radius was or wasn't a constant, and proving 
that it is a constant is non-trivial.


I'm not sure that the construction you mentioned proves that
either, because it relies on the same assumptions about scaling
of polygons that one makes about circles in Euclidean geometry.

Seems to me the significance of it is not that it proves
anything about the constness of pi, but that it provides a way
of *calculating* pi to any desired accuracy. Before that,
people had to rely on measurements of physical circles to
come up with estimates for the value of pi.

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-14 Thread Antoon Pardon
On Wed, Oct 13, 2010 at 07:31:59PM +, Steven D'Aprano wrote:
> On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote:
> 
> > On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote:
> >> On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote:
> >> 
> >> >> The formula: circumference = 2 x pi x radius is taught in primary
> >> >> schools, yet it's actually a very difficult formula to prove!
> >> > 
> >> > 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.
> > 
> > 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".

Your missing the point. You started talking about non-euclidean geometries
as an argument against the notion that pi was defined as the ratio of
the circumference and the diameter. But in non-euclidean geometries
the equation doesn't hold. So either you think non-euclidian geometries
matter and in that case you should have questioned the equation or
you accept that the context was euclidian geometries and in that case
non euclidian considerations don't matter.

> > 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.

Your confusing the concept with its specific numerical value. It's not
uncommon in mathematics to give a name to a number that is defined in
a specific way, without knowing its numerical value.

> 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.

So? That the ratio of the circumference and the diameter of a circel was
constant was proven a long way before people had the tools to calculate
that ratio to very high precision. They did that by noting that the
ratios of the circumference of a regular polygon to the diameter of the
inscribed and outscribed circle were constants and converged to each
other as the number of sides increased.

So there is no problem defining pi as the ratio between the circumference
and the diameter of a circle even if one has only very crude approximations
to the numerical value of that ratio.

-- 
Antoon Pardon
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Paul Rubin
Steve Howell  writes:
> And yet nobody can recite this equally interesting ratio to thousands
> of digits:
>
>  0.2141693770623265...

That is 1/F1 where F1 is the first Feigenbaum constant a/k/a delta.
The mathworld article is pretty good:

  http://mathworld.wolfram.com/FeigenbaumConstant.html

It mentions that both constants were calculated to about 1000 digits in
1999.  I don't know how that was done, but presumably they could be
calculated to more digits these days if someone felt like it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steve Howell
On Oct 13, 12:31 pm, Steven D'Aprano  wrote:
0.2141693770623265
>
> 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...
>

And yet nobody can recite this equally interesting ratio to thousands
of digits:

 0.2141693770623265...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 21:52:54 +0100, Arnaud Delobelle wrote:

> Steven D'Aprano  writes:
> 
>> On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote:
>>
>>> On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote:
 On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote:
 
 >> The formula: circumference = 2 x pi x radius is taught in primary
 >> schools, yet it's actually a very difficult formula to prove!
 > 
 > 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.
>>> 
>>> 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".
> 
> 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.

But in Euclidean geometry it *can* be proven. What I was pointing out 
that it can't be taken for granted. Under non-Euclidean geometries, it 
can't be proven because it isn't necessarily true; under Euclidean 
geometry, there was a time when people didn't know whether or not the 
ratio of circumference to radius was or wasn't a constant, and proving 
that it is a constant is non-trivial.


> But you were claiming that the proposition "C = 2πr is the definition of
> π" was false.

Well, what is the definition of pi? Is it:

the ratio of the circumference of a circle to twice its radius;
the ratio of the area of a circle to the square of its radius;
4*arctan(1);
the complex logarithm of -1 divided by the negative of the complex square 
root of -1; 
any one of many, many other formulae.


None of these formulae are intuitively correct; the formula C = 2πr isn't 
a definition in the same sense that 1+1=2 defines 2. The point that I was 
trying to get across is that, until somebody proved the formula, it 
wasn't clear that the ratio was constant.


> 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:

That's exactly the sort of thing Peter Nilsson was talking about when he 
said "Most attempts by students collapse because they assume the formula 
in advance". It might be "obvious" to you that the two circles are merely 
scaled up versions of each other, but that is equivalent to assuming that 
the ratio of the circumference to radius is a constant. Well, yes, it is 
(at least under Euclidean geometry), but assuming it is a constant 
doesn't allow you to prove it is a constant -- that's circular reasoning, 
if you excuse the pun.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Arnaud Delobelle
Steven D'Aprano  writes:

> On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote:
>
>> On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote:
>>> On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote:
>>> 
>>> >> The formula: circumference = 2 x pi x radius is taught in primary
>>> >> schools, yet it's actually a very difficult formula to prove!
>>> > 
>>> > 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.
>> 
>> 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".

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.

>
>> 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.

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 π.

-- 
Arnaud
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote:

> On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote:
>> On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote:
>> 
>> >> The formula: circumference = 2 x pi x radius is taught in primary
>> >> schools, yet it's actually a very difficult formula to prove!
>> > 
>> > 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.
> 
> 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.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 15:07:07 +0100, Tim Bradshaw wrote:

> On 2010-10-13 14:20:30 +0100, Steven D'Aprano said:
> 
>> 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.

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. 


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Antoon Pardon
On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote:
> On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote:
> 
> >> The formula: circumference = 2 x pi x radius is taught in primary
> >> schools, yet it's actually a very difficult formula to prove!
> > 
> > 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. 

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.

-- 
Antoon Pardon
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Tim Bradshaw

On 2010-10-13 14:20:30 +0100, Steven D'Aprano said:


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).


--
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steven D'Aprano
On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote:

>> The formula: circumference = 2 x pi x radius is taught in primary
>> schools, yet it's actually a very difficult formula to prove!
> 
> 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


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-12 Thread RG
In article 
,
 Peter Nilsson  wrote:

> Keith Thompson  wrote:
> > The radian is defined as a ratio of lengths. That ratio
> > is the same regardless of the size of the circle.  The
> > choice of 1/(2*pi) of the circumference isn't arbitrary
> > at all; there are sound mathematical reasons for it.
> 
> Yes, but what is pi then?
> 
> > Mathematicians could have chosen to set the full
> > circumference to 1, for example, but then a lot of
> > computations would contain additional multiplications
> > and/or divisions by 2*pi.
> 
> The formula: circumference = 2 x pi x radius is taught
> in primary schools, yet it's actually a very difficult
> formula to prove!

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

rg
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Strong typing vs. strong testing" [OT]

2010-10-12 Thread Peter Nilsson
Keith Thompson  wrote:
> The radian is defined as a ratio of lengths. That ratio
> is the same regardless of the size of the circle.  The
> choice of 1/(2*pi) of the circumference isn't arbitrary
> at all; there are sound mathematical reasons for it.

Yes, but what is pi then?

> Mathematicians could have chosen to set the full
> circumference to 1, for example, but then a lot of
> computations would contain additional multiplications
> and/or divisions by 2*pi.

The formula: circumference = 2 x pi x radius is taught
in primary schools, yet it's actually a very difficult
formula to prove! Most attempts by students collapse
because they assume the formula in advance (pi is the
ratio of circle semi-circumference to its radius.)

Perhaps the most elegant approach is to define arctan x
as the integral from 0 to x of dz/(1 + z^2). The trig
functions and relationships, and their application to
normal geometry, can all be defined and derived from
that alone without any reference to pi. Pi is simply
the constant 4 times arctan 1.

--
Peter
-- 
http://mail.python.org/mailman/listinfo/python-list