1. Programming: A Primer

Becoming a data scientist without learning how to program is similar to becoming an architect without learning how to draw. You will develop a concept design, but have no means of implementing and sharing it.

Drew Conways's Data Science venn diagram


While the modules in Data Science and AI will develop your mathematics and statistics knowledge, this module will focus on developing your hacking i.e. programming skills.

Today's learning objectives

  • Understand what is an algorithm.
  • Understand flowcharts and psuedocodes.
  • Develop an intuition for computation thinking.

Algorithm

A computer program or algorithm is a setp by step set of instructions which are designed to accomplish a specific outcome. However, the process of writing an optimal computer program involves a lot more than writing code. Designing algorithms and flowcharts to document the process flow, profiling the algorithms' accuracy, documentation and testing are all part of the process of computer programming. Algorithms are typically represented using psuedocodes- an english like syntax that resembles a programming language.

Flowcharts

One of the key skills you will gain if you succesfully complete this module is computational thinking. The first step towards acquiring this skill is being able to design your algorithm and flow of logic. This is typically done by drawing a flowchart. A flowchart allows you to break down a complex problem into simpler blocks which are then connected to create a computer program. Please watch this video for a brief introduction to a flowchart.

As you may have noticed in the video, a flowchart consists of certain elements.

Elements of a flowchart


Process start and end nodes (times when the project starts or ends), project development stages (activities to be carried out), decision nodes (times when a decision needs to be made) and connectors (arrows indicating the project time flow). In the industry, Microsoft Visio is typically used to draw flowcharts, for this module you are free to use any software you prefer (e.g., PowerPoint), or even draw a flowchart by hand.

Computational thinking

Computation thinking refers to the process of breaking down a complex task into a set of easy-to-solve simple tasks. Whether you chose to become an AI expert, data scientist or engineer, AI consultant, or a coach - you will require computational thinking. This is typically done by:

  1. Decomposition: break down a complex problem into simpler parts.
  2. Pattern recognition: look for similarities between parts
  3. Abstraction: focus on relevant information and ignore details not relevant to the problem.
  4. Algorithm: develop step-by-step rules to help solve the problem.

Look up exact instructions on youtube for similar content! It's a good lesson in computational thinking.

Assignment

a) What's an algorithm?

  • A science
  • A step by step set of instruction for solving a specific problem
  • A sequence of steps that repeats indefinitely
  • English like syntax that resembles a programming language

b) What symbol represents a conditional statement in a flowchart?

  • A circle
  • A diamond
  • A rectangle
  • An oval

c) Can a connector in a flowchart have arrows on both ends? If no, why not?

  • Yes
  • No

2 In the DataLab session for Data Science, you followed a sequence of steps in order to develop your creative brief, the Poster-Our World in Data. Represent the steps you took using a flowchart.

3 Develop an algorithm to find the largest of 3 numbers a, b, c. Use psuedocode and a flowchart to design your algorithm.

4 Using computational thinking, write down a set of ‘exact instructions' on how to cook pasta pesto.

Please click next to view the rest of the material for today