Archive for January, 2008

Time & Logic

dj_logic-zen_of_logic_b.jpg

My Discrete Math professor is the same gentleman who shepherded (if that is the right word) me through my first Calculus class last semester. Seeing his name on the schedule for this class, then, was not disturbing. For me, he is a known quantity, and a good professor. And, like most of the professors encountered on this journey, he is very giving of his time outside of the class. On the first day of each course, he lets the class vote on the most opportune times for his “extra help” sessions, adjusting his schedule to suit the needs of the majority of the students. He will be available at that time for any student, with any question.

I have attended his sessions this semester. If I may speak in the terms of a logician, I in this case implies the existential quantification: As in, of all the students in the universe of discourse (his class), there exists 1 student who has attended his “extra help” sessions.

I am that existential quantifier.

Today, while exploring the labyrinth of nested quantifiers during the “extra-help”, he made the most remarkable comment.

As I recall, we were talking about implications in a proposition: x implies y….or, if p, then q…..you get the drift. A relationship exists between two variables.

As he said, the logical relationship exists, but that the rules of logic ignore the existence of time. That is, the logic assumes that the relationship is timeless, until one of the variables changes. He further stated that he suspects the existence of a physical, universal law that must apply to logic and time. Even though he can prove, through logic, that an implication is not timeless, he has not yet persuaded his wife, a fellow mathematician, that his argument is true. Thus, the theory awaits further development.

This is beautiful stuff!

Happy Birthday

On her birthday, a poem for my mother……

In Memory of My Mother

I do not think of you lying in the wet clay
Of a Monaghan graveyard; I see
You walking down a lane among the poplars
On your way to the station, or happily Going to second Mass on a summer Sunday–
You meet me and you say:
‘Don’t forget to see about the cattle–’
Among your earthiest words the angels stray.
And I think of you walking along a headland
Of green oats in June,
So full of repose, so rich with life–
And I see us meeting at the end of a town on a fair day by accident,
after the bargains are all made and we can walk
Together through the shops and stalls and markets
Free in the oriental streets of thought.
O you are not lying in the wet clay,
For it is harvest evening now and we
Are piling up the ricks against the moonlight
And you smile up at us — eternally.

By: Patrick Kavanagh

Why I Love Mathematics…

One of the few endearing characteristics of my Calculus textbook is the sidebars sprinkled randomly through the book…..where the author attempts to instill some small bits of humanity in the almost mechanical process of acquiring the knowledge of calculus. For example, in the section of the “Mean Value Theorem”, we learn that the MVT was first formulated by Joseph-Louis Lagrange

lagrange.jpg

….”born in Italy of a French father and an Italian mother. He was a child prodigy and became a professor in Turin at the tender age of 19….He was a kind and quiet man, though, living only for science.” Bully for him, I say.

Then in my Discrete Mathematics textbook, in the section dealing with “Constructing New Logical Equivalences”, the sidebar contains this story (excerpted for the sake of brevity) about Augusta Ada, Countess of Lovelance (1815 – 1852):

ada.jpg

“Augusta Ada was the only child from the marriage of the famous poet Lord Byron and Lady Byron, Annabella Milbanke, who separated when Ada was 1 month old, becasue of Lord Byron’s scandalous affair with his half-sister. The Lord Byron had quite a reputation, being described by one of his lovers as ‘mad, bad, and dangerous to know‘. Lady Byron was noted for her intellect and had a passion for mathematics; she was called by Lord Byron ‘The Princess of Parallelograms’. In 1838 Augusta Ada married Lord King, later elevated to Earl of Lovelance. Together they had three children…

…Ada continued her mathematical studies after her marriage. Charles Babbage had continued work on his Analytic Engine…In 1842 Babbage asked Augusta Ada to translate an article in French describing Babbage’s invention….

babbage.jpg

She recognized the promises of the machine as a general purpose computer much better than Babbage did. She stated that the “engine is the material expression of any indefinite function of any degree of generality and complexity‘. Her notes on the Analytic Engine anticipate many future developments, including computer-generated music. After 1845 she and Babbage worked toward the development of a system to predict horse races. Unfortunately, their system did not work well, leaving Augusta heavily in debt at the time of her death at an unfortunately young age from uterine cancer.”

How can I not appreciate the work of such people without seeing their humanity and frailties as the perfect expression of the human form?

Keyboard Shortcuts

For the record, I’ve been using a pc since 1984. The first machine was an IBM PC-XT. Self taught in Lotus 1-2-3, and then in Excel. Used to be completely functional in WordPerfect, until Word conquered the world. I’m no application wiz, but I can get basic stuff done. I’m a professionally trained typist, once capable of 60 WPM with a very high accuracy rate (today, the rate is much lower, but I’m still pretty good).

Last semester, I watched my computer science professor teach on a overhead connected to his laptop. He had the Python interpreter running, had the class website up, and the class wiki. Man, he was flying through the screens like Paul Revere through Boston. Highlighting, cutting, pasting, copying…….each class was a masterful performance of keyboard shortcuts. I, of course, had no clue how he was doing it.

One day, in our lab class, he came over to my partner and me to check our progress on a program. The method we used in the lab setting was that one of us was the ‘driver’, i.e., the keyboard operator, and the other was the ‘navigator’, i.e., the creator of the code. I happened to be driving that day, and thus had to repair some code to suit the professor’s taste. My ham-handed attempt at manipulation evoked a comment from the prof like this: “Why aren’t you using shortcuts?”…..”I don’t know how…..”….(to the other student) “How could you let him drive without knowing the shortcuts…..get on the keyboard!”

My humiliation was utter and complete. I imagined that I was the only buffoon in the entire class lacking such basic knowledge…..a leftover from the DOS universe, a remnant from a long dead culture. Such was my low estate that I never dared ask anyone else how to use the keyboard shortcuts.

Yesterday, while perusing the web-site for my new programming class, I stumbled upon a link to something call Productivity Hints. There they were! The techniques that I assumed were hidden to old Neanderthals such as myself…….

Ctrl + Tab………..Alt + Tab…..Shift arrows…….Ctrl + x…….Ctrl + C……Ctrl + v……

I have been practicing all day. I get them. I love it!

The New Guy

In one of our final programming classes last semester, while waiting for Prof. X, a strange face wandered into the classroom. It belonged to a younger middle-aged guy who looked confused, and, since I sat in the back, he asked me a few questions. Turned out that he was planning a return to college for the Spring semester, and hope to major in Discovery Informatics. Quelle surprise! A fellow traveller……..why should I consider my story so unique?

We chatted after the class, exchanged contact info, and went our separate ways. With exams looming, I quickly forgot about the encounter and focused slaying the Dominion of Darkness (Calculus).

Lo and behold, who should I spy upon arrival in my campus hideaway, aka the computer science lab, the other day……..none other than the New Guy. Looking somewhat apprehensive, not quite sure how to act or where to sit, listening to the banter but not yet able to participate, his presence instantly transported me back in time, to those days, just a year ago, when I walked in his shoes.

We re-acquainted ourselves and I sat down to start working. In a minute, sure enough, he leaned over and asked a question. I responded, there was another question, and then we moved closer together and began to discuss his first attempt at writing code in Python. With the wisdom of my one semester on the subject, I was able to help him with some basic setup issues and even suggested an alternative to his initial logic. Then he asked about algebra…..

In an instant, I realized how far I have come in this adventure. I can write basic code. I can explain/help with Algebra. My latest programming assignment was submitted yesterday, TWO days ahead of the deadline…..a first for me. I’m in more classes than ever, and the load is not (yet) unmanageable.

I think I’m turning into a fully realized, actuated student.

The Edge

The Edge Questions . Not enough time to explain….but check it out if you are feeling adventurous….

Abe, the Logician

“How many legs does a dog have, if you call the tail a leg? Four. Calling a tail a leg doesn’t make it a leg.”
— Abraham Lincoln

This will be of great assistance in my comprehension of logic.

Thanks to Overcoming Bias.

Datasets and Organization

New for this semester is a course on databases. Of all the work I have done so far, however hard/frustrating/educational it has been, it is worth the price of admission to this class. This is the first ‘hands-on’ class I will take that might establish a skill that will generate income dollars in the future. This is big-boy stuff, even though we are toddlers compared to the professionals.

Tonight I will download and install Microsoft’s SQL Server 2005. If it works, and it didn’t the first time, I will create my very first (and small) database.

database1.jpg

Yippee!

First Program of the Semester

So the professor asks us to write a program in Python, after which she will show us the same program written in Java. The program was easy to develop conceptually, and the programming was, for the most part, easy. There were a few looks back into our Python Quick Reference, but not bad after a 4 week layoff. We’ll see what she thinks about the algorithm and the design. I expect the Java version to be way more complex, from a syntax point of view.

Here’s my code…..feel free to comment; it’s already been submitted so your thoughts will not incur an Honor violation.

———————————————————————————————————-

import math

def ordQty(): # Get order quantity

n = input(“How many bags of coffee do you want to order? “)

while n <= 0: # Makes sure order is larger than 0

print”Invalid quantity. Your order must be at least 1 bag.”

n = input(“how many bags of coffee do you want to order? “)

return n

def discountTable(n, cost): # creates discount based on volume (per assignment parameters)

if n < 25:
discount = cost * 0.0

if n >= 25 and n < 50:
discount = cost * .05

if n >= 50 and n< 100:
discount = cost * .10

if n >= 100 and n< 200:
discount = cost * .15

if n >= 200 and n < 250:
discount = cost * .20

if n >= 250 and n < 300:
discount = cost * .25

if n >= 300:
discount = cost * .30

return discount

def boxTable(n): # calculates number of boxes required for order

A = n / 20 # A is the variable for large boxes. Returns an integer value

remA = n % 20 # remA calculates the remainder value for the A box divisor

B = remA / 10 # B is the variable for the medium boxes. Returns an integer value

remB = remA % 10 # remB calculates the remainder value for the B box divisor

C = remB / 5.0 # C is the variable for the small boxes. Returns a float value

Last = math.ceil(C) # Use ‘ceil’ function to determine next highest integer

costA = A * 2.0 # costA is the box charge for large boxes

costB = B * 1.0 # costB is the box charge for medium boxes

costLast = Last * .50 # costLast is the box charge for small boxes

boxCharge = (costA + costB + costLast) # Calculate total box cost for return

return boxCharge

def main():

n = ordQty()

cost = n * 5.50 # calculate cost of coffee before any discount

print “You have ordered”,n,”bags of coffee. The price is $%0.2f” % (cost)

discount = discountTable(n, cost) # create discount function, return discount amount

print “Your quantity discount is $%0.2f” % (discount)

boxCharge = boxTable(n) # calculate number of boxes required and cost

print”The box charge is $%0.2f” % (boxCharge)

totalCost = cost – discount + boxCharge # calculate order total

print “The total cost of your order is $%0.2f” % (totalCost)

main()

———————————————————————————————————-

The output of a test run:

———————————————————————————————————-

How many bags of coffee do you want to order? 999
You have ordered 999 bags of coffee. The price is $5494.50
Your quantity discount is $1648.35
The box charge is $100.00
The total cost of your order is $3946.15

———————————————————————————————————

We Love Python

Viaxkcd.


“Life’s hard, son. It’s harder when you’re stupid.” — The Duke.

Education is a companion which no misfortune can depress, no crime can destroy, no enemy can alienate,no despotism can enslave. At home, a friend, abroad, an introduction, in solitude a solace and in society an ornament.It chastens vice, it guides virtue, it gives at once grace and government to genius. Without it, what is man? A splendid slave, a reasoning savage. - Joseph Addison
The term informavore (also spelled informivore) characterizes an organism that consumes information. It is meant to be a description of human behavior in modern information society, in comparison to omnivore, as a description of humans consuming food. George A. Miller [1] coined the term in 1983 as an analogy to how organisms survive by consuming negative entropy (as suggested by Erwin Schrödinger [2]). Miller states, "Just as the body survives by ingesting negative entropy, so the mind survives by ingesting information. In a very general sense, all higher organisms are informavores." - Wikipedia

Blog Stats

  • 31,160 hits