2009 101: Difference between revisions

From XPUB & Lens-Based wiki
 
(37 intermediate revisions by the same user not shown)
Line 3: Line 3:
== Introduction to the Technical Day ==
== Introduction to the Technical Day ==


=== Why programming? ===
As a broad intoduction to the program we consider the following three questions:


[http://www.brucemaudesign.com/manifesto.html A Manifesto for Change]
* Why programming?
* What is Python?
* Why Python?


=== What is Python? ===
Bruce Mau's [http://www.brucemaudesign.com/manifesto.html manifesto for change] contains a few relevant points, in particular "the trouble with software is that everyone has it" as motivation for "making your own tools". We watched [http://www.vimeo.com/1093745 this video] visualizing the history of contribution to Python. We distributed the [[Think Python | textbook]] that we will be using in the class.


=== Why Python? ===
== An Human Adding Machine ==


* [[Think Python]]
We began the day by performing an [[Human Adding Machine]].


== Introduction to Computation (including performance) ==
[[Image:HumanAddingMachineComputers.png]]


=== The Number System is abstract ===
== Introduction to Computation ==


The way numbers are written today (in English) is based on ancient systems that can be traced back to the [[Wikipedia:Hindu-Arabic_numeral_system | Arab and Hindu]] origins.
=== Writing Numbers ===


There have been alternatives, for instance [[Wikipedia:Roman Numerals | Roman Numerals]]. Also see [http://en.wikipedia.org/wiki/Quipu Quipu] for an alternative to writing systems.
The modern system of writing numbers (like 2008 and 17) can be traced to early [[Wikipedia:Hindu-Arabic_numeral_system | Arab and Hindu]] origins. There are three key properties of this system:


But key features of this system are that it is positional, and decimal.
# Based on an abstract relation of symbols to notions of quantity.
# Positional: Limited (or finite) number of symbols to represent an unlimited (infinite) number of quantities
# Decimal: Based on counting in groups of tens (or powers of ten)


The fact that it is positional, is a "clever hack" in that using just 10 symbols (if one includes an explicit symbol for "nothing") you can write down an infinite (unlimited) number of quantities.


* [http://en.wikipedia.org/wiki/Oware Oware]
==== Abstract relation of symbols to quantity ====


Minimalist Math
==== Finite Symbols, Infinite Possibilites ====


* [http://www.kerryr.net/pioneers/boolean.htm Boolean Algebra]
In contrast to [Wikipedia:Roman Numerals Roman Numerals], new symbols are not needed as the quantity increases, you simply keep adding digits to the left. Sometimes the African game [http://en.wikipedia.org/wiki/Oware Oware] is used to teach children about counting.
 
==== Decimal ====
 
The common number system is based on 10 symbols (if one includes an explicit representation of nothing or zero (0)). This seems to be because we have 10 fingers (also known as digits)... thus 10 numerical digits. However, other systems are equally possible (based-4, base-9, base-173). Babylonians used a number system based on 60 (which is reflected in our representation of time). Also see [http://en.wikipedia.org/wiki/Quipu Quipu] for an early alternative writing systems.
 
=== Thinking Machines ===
 
==== Mechanical Math ====
 
[http://en.wikipedia.org/wiki/Charles_Babbage#Difference_engine Babbage's Difference Engine]
 
Babbage worked at the limits of what was physically possible in terms of producing the many mechanical parts, and produced many of his own tools, achieving a level of precision unique to his time. Ultimately his later effors (with his second machine, the Analytical Engine) failed as it was simple too complex for him to build.
 
[http://www.satyam.com.ar/Babbage/en/addinga.htm Adding a digit...]
 
and [http://www.computerhistory.org/babbage/ a flash-format video], inspiring or terrifying? you be the judge!
 
==== Minimalist Math ====
 
In [http://www.gutenberg.org/etext/15114 An Investigation of the Laws of Thought], British Mathematician [http://en.wikipedia.org/wiki/George_Boole George Boole] also worked with a notion of capturing something of the workings of human thought, though as an abstract mathematical system rather than a mechanical one. The system of algebra he developed is now called [http://www.kerryr.net/pioneers/boolean.htm Boolean Algebra].
 
Note that a key property of Boole's "algebra" was that, just as with a positional number system, it was possible to represent an infinite variety of equations using just a limited set of basic "building blocks" (or "primitives") -- the "and", "or", and "not" elements. In fact, it can be shown that and can be represented using "or" and "not", and similarly "or" can be represented using "and" and "not" -- so only the system can be reduced even further to just elements. This is called [http://en.wikipedia.org/wiki/De_Morgan%27s_laws De Morgan's Law].
 
===== Dinner with De Morgan (an aside) =====
 
To make DeMorgan's law more concrete, consider the following situations with a somewhat demanding friend:
 
On making a decision to go out to eat:
 
I am only happy if we eat Chinese OR Indian food.
is the same as saying:
I will NOT be happy if we do NOT eat Chinese AND we do NOT eat Indian.
 
The morning after:
 
I am only happy when I have a good dinner AND sleep well.
is the same as saying:
I am NOT happy if I do NOT have a good dinner OR I do NOT sleep well.
 
==== Electrical Math ====
 
It was [http://en.wikipedia.org/wiki/Claude_Shannon Claude Shannon] who later (in the 20th century) connected the idea of Babbage & Boole to realize that a machine working with a binary representation of numbers would be possible to realize using flows of electricty, and much more simply than Babbage's machine, but in principle capable of performing the same calculations.
 
[http://en.wikipedia.org/wiki/Half_adder Electronic Adders]
 
== Resources ==
 
* [http://kottke.org/02/07/the-pattern-on-the-stone-by-daniel-hillis Pattern on the Stone]
 
== Quotes ==


<blockquote>
<blockquote>
... [Y]ou can think of programming as the process of breaking a large, complex task into smaller and smaller subtasks until the subtasks are simple enough to be performed with one of these basic instructions.
... [Y]ou can think of programming as the process of breaking a large, complex task into smaller and smaller subtasks until the subtasks are simple enough to be performed with one of these basic instructions.
<br/>
<br/>
''ThinkPython, p. 3''
[[Think Python]], p. 3''
</blockquote>
</blockquote>


Exercise
== Assignments for Next Week ==
 
* Human Adding Machine
 
distribute [[ThinkPython]]
 
A brief introduction to Python


First exercise: A dialog with Python
* Make sure you've completed the [[Dialog with Python]]
* Read chapters 1 & 2 in [[Think Python]], and
* complete the exercises in the text plus these [[Think Python X2 | additional exercises]]

Latest revision as of 21:26, 13 October 2008

Technical Day 1.01: Introductions

Introduction to the Technical Day

As a broad intoduction to the program we consider the following three questions:

  • Why programming?
  • What is Python?
  • Why Python?

Bruce Mau's manifesto for change contains a few relevant points, in particular "the trouble with software is that everyone has it" as motivation for "making your own tools". We watched this video visualizing the history of contribution to Python. We distributed the textbook that we will be using in the class.

An Human Adding Machine

We began the day by performing an Human Adding Machine.

File:HumanAddingMachineComputers.png

Introduction to Computation

Writing Numbers

The modern system of writing numbers (like 2008 and 17) can be traced to early Arab and Hindu origins. There are three key properties of this system:

  1. Based on an abstract relation of symbols to notions of quantity.
  2. Positional: Limited (or finite) number of symbols to represent an unlimited (infinite) number of quantities
  3. Decimal: Based on counting in groups of tens (or powers of ten)


Abstract relation of symbols to quantity

Finite Symbols, Infinite Possibilites

In contrast to [Wikipedia:Roman Numerals Roman Numerals], new symbols are not needed as the quantity increases, you simply keep adding digits to the left. Sometimes the African game Oware is used to teach children about counting.

Decimal

The common number system is based on 10 symbols (if one includes an explicit representation of nothing or zero (0)). This seems to be because we have 10 fingers (also known as digits)... thus 10 numerical digits. However, other systems are equally possible (based-4, base-9, base-173). Babylonians used a number system based on 60 (which is reflected in our representation of time). Also see Quipu for an early alternative writing systems.

Thinking Machines

Mechanical Math

Babbage's Difference Engine

Babbage worked at the limits of what was physically possible in terms of producing the many mechanical parts, and produced many of his own tools, achieving a level of precision unique to his time. Ultimately his later effors (with his second machine, the Analytical Engine) failed as it was simple too complex for him to build.

Adding a digit...

and a flash-format video, inspiring or terrifying? you be the judge!

Minimalist Math

In An Investigation of the Laws of Thought, British Mathematician George Boole also worked with a notion of capturing something of the workings of human thought, though as an abstract mathematical system rather than a mechanical one. The system of algebra he developed is now called Boolean Algebra.

Note that a key property of Boole's "algebra" was that, just as with a positional number system, it was possible to represent an infinite variety of equations using just a limited set of basic "building blocks" (or "primitives") -- the "and", "or", and "not" elements. In fact, it can be shown that and can be represented using "or" and "not", and similarly "or" can be represented using "and" and "not" -- so only the system can be reduced even further to just elements. This is called De Morgan's Law.

Dinner with De Morgan (an aside)

To make DeMorgan's law more concrete, consider the following situations with a somewhat demanding friend:

On making a decision to go out to eat:

I am only happy if we eat Chinese OR Indian food.
is the same as saying:
I will NOT be happy if we do NOT eat Chinese AND we do NOT eat Indian.

The morning after:

I am only happy when I have a good dinner AND sleep well.
is the same as saying:
I am NOT happy if I do NOT have a good dinner OR I do NOT sleep well.

Electrical Math

It was Claude Shannon who later (in the 20th century) connected the idea of Babbage & Boole to realize that a machine working with a binary representation of numbers would be possible to realize using flows of electricty, and much more simply than Babbage's machine, but in principle capable of performing the same calculations.

Electronic Adders

Resources

Quotes

... [Y]ou can think of programming as the process of breaking a large, complex task into smaller and smaller subtasks until the subtasks are simple enough to be performed with one of these basic instructions.
Think Python, p. 3

Assignments for Next Week