# Python and Computational thinking – Yasheng

The eureka moment came when Evan explains coding and representation work: “instead of enumerating a mapping between all possible character sequences and the natural numbers, we need a process for converting any text to a unique number that represents that text (10).”

Denning and Martell clarifies this process in their writing,

A representation is a pattern of symbols that stands for something. The association between a representation and what it stands for can be recorded as a link in a table or database, or as a memory in people’s brains.

• There are two important aspects of representations: syntax and stuff.
• Syntax is the rules for constructing patterns; it allows us to distinguish patterns that stand for something from patterns that do not.
• Stuff is the measurable physical states of the world that hold representations, usually in media or signals.
• Put these two together and we can build machines that can detect when a valid pattern is present (372).

These explanations are very useful this week when I was deblackboxing Python in Codecademy.  The second module of Codecademy teaches the newbie coders to use python to calculate tips – an annoying task that happens to everyone who eats out at restaurants that requires tipping. Tipping is a process we all familiar with, and we all know how to do it step by step, and of course sometimes we ask help from the calculator.

Just from looking at the interface of Python, the steps of calculating tips became very clear.

We, humans who have learned the basic procedures of tipping, first identify what is in play when calculating a tip: how much does the meal cost, what is the percentage of tax, and what percentage should my tip be? These questions are defined as “meal =,” “tip =,” and “tax =.” Then when values are assigned to these variables, an equation is formed to conduct proper calculation based on these variables.

Python and I both calculate tips in a same manner, the only differences are 1. I am not as fast as Python at calculation (I am an Asian who cannot do math well L) and 2. I filter out certain steps in the process of calculation, like defining variables, because I do it subconsciously though it is still very much a step I take in my cognitive functioning. So there is actually little difference between computation thinking and human thinking. Wing puts it perfectly, “A way that humans, not computers, think. Computational thinking is a way humans solve problems; it is not trying to get humans to think like computers (35).” When we have a problem, we identify it, isolate different elements that are involved, and follow a logical sequence to solve it. Or put in Denning and Martell’s terms, Python and the humans employ same syntax when conduction cognitive works yet the stuff human have can be more nuanced.

Questions:

What if a pattern that is not visible?

What happens when the “stuff” is too nuanced for computers to interpret?