Computational Thinking

Joel Gethin Lewis

Lecture 6: Looping

What I'm going to talk about today:

  1. Boolean algebra and control flow.
  2. Functions and recursion.
  3. Object-oriented programming.
  4. The Jacquard Loom, Charles Babbage and Ada Lovelace.
  5. Pāṇini, al-Khwarizmi, al-Jazari, Alan Turing, Tommy Flowers, Grace Hopper, Margaret Hamilton, Bugs and Hacking.
  6. Bonus: Fuzzy logic, Computer Vision and Neural Networks.

1. Boolean algebra and control flow.

  • Boolean algebra, named after George Boole. The Boolean data type is a common to most programming languages - only two values - True (1) or False (0). One is true, nothing is false.
  • Boolean operators allow you to combine or invert boolean data types - the three basic ones are AND, OR and NOT.
  • Control flow in programming is how you control the flow of which part of the program is executed next.
  • Conditional statements, such as if statements are very common.
  • Loops such as while loops and for loops are also very common.

2. Functions and recursion.

  • Instead of writing long lists of commands, one after another, functions allow programmers to package up functionality into smaller mini programs, known as functions or subroutines.
  • Take input and return an output - an example might be a function that returns the square of an input number, or as complicated as the answer to everything.
  • Recursion is when something is defined in terms of itself. Recursive humour is funny. Recursion is also found in graphic design, art and cooking. In computer science recursion is when a function calls itself repeatedly. The method of working out the Factorial of any number is a classic example.
  • A fractal is a good example of something that is visually recursive.

3. Abstraction and Object-oriented programming.

4. The Jacquard Loom, Charles Babbage and Ada Lovelace.

  • The Jacquard Loom was the worlds first programmable object.
  • Charles Babbage is the inventor of the concept of a digital computer. Babbage was aware of the Jacquard Loom and expanded upon the punch card to invent both the Difference Engine and the Analytical Engine.
  • Ada Lovelace was the worlds first computer programmer, even realising that the computer could be used to make music and art.

5. Pāṇini, al-Khwarizmi, al-Jazari, Alan Turing, Tommy Flowers, Grace Hopper, Margaret Hamilton, Bugs and Hacking.

  • Pāṇini pioneered a grammar that incorporated metarules and recursion - making the first formal language.
  • Muhammad ibn Musa al-Khwarizmi formalised algebra, his name gave rise to the word algorithm and introduced the decimal system to the western world.
  • Ismail al-Jazari invented programmable machines, including programmable humanoid robots and an astronomical clock considered the first programmable analogue computer.

5. Pāṇini, al-Khwarizmi, al-Jazari, Alan Turing, Tommy Flowers, Grace Hopper, Margaret Hamilton, Bugs and Hacking (continued).

  • Alan Turing formalised the concept of the algorithm and computation in general. During the Second World War he led the team that broke German Naval codes. He went on to design one of the first stored program computers and did pioneering work in Morphogenesis, or how living things form themselves. He was prosecuted by the British Government for being gay, and committed suicide in 1954. If an system is capable of general computation it is said to be Turing complete. The Turing test is a test of machine intelligence in comparison to human intelligence.
  • Tommy Flowers was the engineer who built Turing's machine.

5. Pāṇini, al-Khwarizmi, al-Jazari, Alan Turing, Tommy Flowers, Grace Hopper, Margaret Hamilton, Bugs and Hacking (continued).

6. Bonus: Fuzzy logic, Computer Vision and Neural Networks.

Thanks!