This document discusses programming languages and computation. It introduces programming for artificial intelligence and data science. It defines programming as a set of precise instructions to achieve a specified task written in a particular stylised language. It discusses computation in terms of bits, bytes, and how a computer calculates and stores results based on the instructions provided by a programmer. Finally, it discusses algorithms as a sequence of simple steps with flow control and conditions to stop.
This document discusses programming languages and computation. It introduces programming for artificial intelligence and data science. It defines programming as a set of precise instructions to achieve a specified task written in a particular stylised language. It discusses computation in terms of bits, bytes, and how a computer calculates and stores results based on the instructions provided by a programmer. Finally, it discusses algorithms as a sequence of simple steps with flow control and conditions to stop.
Programming for Artificial Intelligence and Data Science
Objectives • Primitives of computation • Python • Interpreter • Basic Types • Operators & Their order • Variables, assignment, and re-binding Programming – What is it?
• A precise set of instructions to achieve a specified task
• Written in a particular stylised language • Analogues There was a • Cooking : Recipes question on this in the • Knitting & Crochet : Pattern Books introduction • Music : Reading and writing score quiz – this is why! • Need to learn the symbols and notation Computation • What does a computer do? • Calculates then stores results • All data is comprised of bits (0 or 1). Example 0110 0100 • 8 of these bits => Byte. The base unit of storage measurement. • Modern storage it is common to see 1-3 TeraBytes (TB = 1 x1012 bytes ) • Computation defined by the programmer. • Computer only does what you tell it. Can you count Binary? What is 128 x 1 + 10101000 in 64 x 0 + • There are 10 people who understand binary: decimal? 32 x 1 + 16 x 0 + • Those that do and those that don’t 8x1+ 4x0+ 2x0+ 1x0= ------------ 168 Computation • How do we define how to compute something? • Primitives – Fundamental operations with which everything is constructed. • Moving something, Arithmetic, Store/Erase, Read • Alan Turing first described a theoretical system to compute anything • We’ve since developed more user-friendly building blocks • If we can compute something in one language, it can be computable in any other language. • It’s just a matter of telling the computer what to do! Computation • How do we define how to compute something? • We can construct a sequence of these primitives • READ 5, ADD 10, STORE => 15 • As a human we can follow this, but how does the computer know? • An Interpreter is a program which reads the instructions and executes them in order. • We can build up complex behaviour, using tests to change the control flow of our sequence. • Stops when finished / out of instructions. Algorithms
• A sequence of simple steps
• A measure of flow control • Conditional Branching • Someway to stop • A condition, or exhaustion. • Any task you want to do can be accomplished via an algorithm. Thank you
Data Storytelling and Visualization with Tableau: A Hands-on Approach 1st Edition Prachi Manoj Joshi - Quickly download the ebook to read anytime, anywhere