AP CSP: The Need for Programming Languages and Algorithms

Slides:



Advertisements
Similar presentations
S.T.A.I.R.. General problem solving strategy that can be applied to a range problems.
Advertisements

Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Computer Systems Architecture Edited by Original lecture by Ian Sunley Areas: Computer users Basic topics What is a computer?
11 Making Decisions in a Program Session 2.3. Session Overview  Introduce the idea of an algorithm  Show how a program can make logical decisions based.
AP CSP: Sending Binary Messages
JavaScript: API’s, Parameters and Creating Functions with Parameters
AP CSP: Making Visualizations & Discovering a Data Story
AP CSP: Creating Functions & Top-Down Design
ORAL WORK.
The Need for Algorithms
Creativity of Algorithms & Simple JavaScript Commands
JavaScript/ App Lab Programming:
VEX IQ Curriculum Smart Machines Lesson 09 Lesson Materials:
Algorithms and Problem Solving
Introduction: Computer programming
Computer Programming.
Vocabulary Prototype: A preliminary sketch of an idea or model for something new. It’s the original drawing from which something real might be built or.
AP CSP: Sending Binary Messages with the Internet Simulator
Eigenfaces (for Face Recognition)
Vocabulary Algorithm - A precise sequence of instructions for processes that can be executed by a computer Low level programming language: A programming.
Olweus class meeting may 19, 2017
AP Computer Science Principles
Unit 3: Lesson 1 - The Need for Programming Languages
Lesson 02: Introduction to Python
Lesson 5-2 AP Computer Science Principles
UNIT 2 – LESSON 6 ENCODE AN EXPERIENCE.
Unit 3 lesson 2&3 The Need For Algorithms- Creativity in Algorithms
Creativity in Algorithms
UNIT 3 – LESSON 5 Creating Functions.
A451 Theory – 7 Programming 7A, B - Algorithms.
The Need for Programming Languages
The Need for Algorithms 2 days
AP CSP: Bytes, File Sizes, and Text Compression
Vocabulary Algorithm - A precise sequence of instructions for processes that can be executed by a computer.
V I S O N All these people were still living by faith when they died. They did not receive the things promised; they only saw them and welcomed them from.
Foundations of Programming: Introduction to Programming
CS 240 – Lecture 11 Pseudocode.
Language is a medium of communication.
Foundations of Computer Science
Graph Paper Programming
Creativity in Algorithms
Algorithms September 28, 2017.
Reasoning and Problem Solving Maths Café
Lesson 15: Processing Arrays
UNIT 3 CHAPTER 1 LESSON 4 Using Simple Commands.
An Introduction to VEX IQ Programming with Modkit
Asking Questions Diego Aguirre.
This Lecture Substitution model
Programming Basics - RobotC
Coding Concepts (Basics)
Ways to Use Writing.
Lesson 3: No One Communicates Alone
Algorithms and Problem Solving
How to be a historian Utah Studies.
#1 Make sense of problems and persevere in solving them
Unit 3 lesson 2-5 The Need For Algorithms- Creativity in Algorithms – Simple Commands - Functions Day 18.
COMPUTATIONAL THINKING COMPUTATIONAL THINKING IN PROGRAMMING
Tonga Institute of Higher Education IT 141: Information Systems
U3L1 The Need For Programming
Unit 3: Lesson 1 - The Need for Programming Languages
Vocabulary Algorithm - A precise sequence of instructions for processes that can be executed by a computer Low level programming language: A programming.
Tonga Institute of Higher Education IT 141: Information Systems
This Lecture Substitution model
Type Topic in here! Created by Educational Technology Network
U3L2 The Need For Algorithms
Series of Paragraphs.
U3L4 Using Simple Commands
Constructing a Test We now know what makes a good question:
Presentation transcript:

AP CSP: The Need for Programming Languages and Algorithms

Introduction: Welcome to Unit 3 - Introduction to Programming This unit is an introduction to the principles of programming. As you’ll see one of the most important things you can do in programming starts well before you write any code. It’s about how you think. We’re going to launch into an activity right now that reveals an important principle of programming. Try your best, and we’ll discuss at the end.

Building Blocks of Drawing Challenge: Create instructions your classmates could use to reproduce a simple arrangement of drawn blocks. Similar to the one shown at the right You have 3 different sized blocks (small, medium, large) Create Your Arrangement: With a pen, draw a figure of variously sized rectangles (or squares) similar to the one shown at right. Design Your Algorithm: As you draw think about the fundamental operations - the most basic set of commands - you would need in order to write out a list of instructions for another person to draw it the same way you did.  Your instructions may only use words, so you cannot use pictures to help you. Try to make your instructions as clear as possible. Your neighbor is about to use them!

Discuss Instructions: Were you always able to create the intended arrangement? Were your instructions as clear as you thought? Why do you think we are running into these miscommunications? Computers don’t have room for interpretation when it comes to executing instructions. How can we change human language to improve our odds of succeeding at this activity, what types of changes would we need to make?

Defining Clear Instructions: So long as there are multiple ways to interpret language, we cannot have perfect precision. If we rigorously define the meaning of each command we use, then we can avoid misinterpretation and confidently express algorithms. This is different from the way we normally think and talk, and it might even take a while to get comfortable with communicating in this way.

The Need for Programming Languages:  Human language may not always be precise enough to express algorithms, even for something as simple as building a small arrangement. We need to use a new kind of language for expressing algorithms, which we as computer scientists call a programming language. Where commands only have one interpretation. No wiggle room. We will use these commands only when developing instructions to complete a task. (Developing an algorithm) In the coming unit we are going to learn a lot more about how we can use programming languages to express our ideas as algorithms, build new things, and solve problems.

Algorithms: To get computers to do what we want we need  know what are the “primitive” operations - the most basic set of operations that will allow us to do most of the tasks that the situation requires. The art (and science) of using a well-defined language of primitive operations to solve problems is the art and science of algorithms.  Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages. One way to think of the study of algorithms is that it is the study of processes – how can you use a small set of instructions to clearly and correctly define a process. Any time you are trying to write a precise set of instructions for a process to solve a problem you are designing an algorithm.

Find Minimum Card Activity: We have to think like a computer can act. We have to think of computational processes – processes that can be executed by a computer - which have specific sets of constraints. You will act as a “Human Machine” while working on this activity When acting as a machine, we have to keep the limitations of a computer in mind. Follow the instructions on the activity guide and come up with an algorithm to find the smallest card in a set. Some things to consider: How do you know when to stop? Do your instructions state where and how to start? Is it clear where to put cards back down after you’ve picked them up?

Defining Actions: As we look at these algorithms you came up with, we can see they are not all the same. However, there are common things that you are all making the human machine do and commonalities in some of your instructions. Can we define a language of common Human Machine commands for moving cards around? What are the commands or actions most of these instructions have in common?” SHIFT (hand) - some form of shifting hands one position down the row left or right MOVE (hand) - some form of moving a hand directly to a particular card based on its position in the list or to the position of one of the other hands. COMPARE - some way to compare cards and do something based on the result like: “if card in right hand is less than card in left hand then…” GO TO LINE - some way to jump to an earlier or later line in the program PICK CARD UP/PUT CARD DOWN - some way to do this that also makes clear where to put a card back do

The Human Machine: For our next activity you will be using the commands we just went over in the last slide and performing the commands within algorithms. Complete the packet using these commands First learn about how the different commands can be used in a sequence so that you can later apply these commands to create a more complex algorithm. After getting the gist of things you will then use these same commands to create an algorithm to find the smallest card in a set. All cards are face up. Card positions have numbers Don’t need to pick up cards or put them down. There is actually no way to move cards at all - only hands The ending state is well defined - left hand touching the min card.

Solution to Find Min:

Wrap-up: Different algorithms can be developed to solve the same problem Even though you were all trying to solve the same problem (find min) as a class we came up with different methods for doing it. We would say we came up with different algorithms. Different code can be written to implement the same algorithm This is sometimes surprising to newcomers. When writing “code” (even with the human machine language) two people trying to write code to implement the same algorithm may very easily code it differently. These two facts  embody art of programming and what makes programming so fun, engaging and creative. A beautiful algorithm is an elegant and clever idea for how to solve a problem. A beautiful program is an elegant use of whatever language structures are provided to make the algorithm actually work on a computer.