[Edu-sig] Why Python?

kirby urner kirby.urner at gmail.com
Tue Apr 13 01:43:31 CEST 2010


On Mon, Apr 12, 2010 at 12:36 AM, kirby urner <kirby.urner at gmail.com> wrote:

<< SNIP >>

> How about scholarships for veterans to enter nursing, other medical
> professions?
>
> The health professions are ravenous for computing and data
> services.
>
> My daughter is the Portland district champion debater at 15,
> having started her high school's team in the first place.  I worry
> though:  why waste her talents at some backward academy
> that doesn't even teach about tetrahedral mensuration?  How
> many dead mineshaft canaries does it take I wonder?
>
> Maybe by the time she graduates we'll have some respectable
> colleges out there.
>

Of course the above won't make a whole lot of sense if you're
just tuning in, as what means "tetrahedral mensuration" and
why should any respectable college -- such as Earlham in
Indiana (the topic of a cell phone conversation from the Pauling
House this morning) -- include that on a syllabus?

The following three posts may provide some elucidation, plus
they are using Python (the 1st shows execution, the 2nd
shows source code) and so are especially apropos on edu-sig:

http://groups.yahoo.com/group/synergeo/message/58259
http://groups.yahoo.com/group/synergeo/message/58260
http://groups.yahoo.com/group/synergeo/message/58262

Basically I'm using the Decimal type to give the flavor of
some extended precision "arithmetic" regarding some basic
polyhedral relationships.

As some of you know, our subculture (ethnicity) has a
unit volume tetrahedron, per this TV segment outline
(more storyboarding for CSN):

http://coffeeshopsnet.blogspot.com/2010/04/smart-bar-lcds.html

Also here:
http://groups.google.com/group/mathfuture/browse_thread/thread/4aa4b568e87ba90b?hl=en

A problem with the Synergeo archive, however, is it doesn't
support significant whitespace, whereas this Mailman archive
does, making it much better for sharing actual source code.

Therefore I am taking the liberty of reposting that here:

#=====

import decimal
from decimal import Decimal
import re

print """
I will now give you the radius of a rhombic
triacontahedron of volume five, computing in tetra-
volumes.

"""

myothercontext = decimal.Context(prec=100, rounding=decimal.ROUND_HALF_DOWN)
decimal.setcontext(myothercontext)

print decimal.getcontext()


# long limo vip numbers
one = Decimal('1.000000000000000000000000000000000000000000000000000000000000')
two = Decimal('2.000000000000000000000000000000000000000000000000000000000000')
three = Decimal('3.000000000000000000000000000000000000000000000000000000000000')
five = Decimal('5.000000000000000000000000000000000000000000000000000000000000')

print "Five: %s" % five
radical2 = two.sqrt()
radical3 = three.sqrt()
radical5 = five.sqrt()

print "2nd root of 2: %s" % radical2

phi = (one + radical5) / two
print "Phi: %s" % phi

scalefactor = (two/three) ** (one/three)

print "Shrink by: %s" % scalefactor
print "Radius: %s" % ((phi / radical2) * scalefactor, )

"""
phi to a 100K places
(potentially, check this resource:
http://goldennumber.net/PhiTo100000Places.txt )
"""

phi_million = "1.618033988749894848204586834365638117720309179805762862135448..."
 # add more digits for a match

strphi = str(phi)
results = re.match(strphi, phi_million)
if results:
    print "Successful match for phi value: %s" % (results.span(), ) #
((  ),) returns tuple as single %s
else:
    print "No match with phi_million"

#=====

Kirby


More information about the Edu-sig mailing list