Comp 11 Lectures. Dr. Mike Shah. August 9, Tufts University. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

Size: px
Start display at page:

Download "Comp 11 Lectures. Dr. Mike Shah. August 9, Tufts University. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34"

Transcription

1 Comp 11 Lectures Dr. Mike Shah Tufts University August 9, 2017 Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

2 Please do not distribute or host these slides without prior permission. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

3 Wrap Up Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

4 Comp 11 - Pre-Class warm up Today s Agenda Pizza come to class hungry! Return Finals Course wrap up Learn about C Learn about Python Share what you did for final project (Optional) Class Picture Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

5 Lecture Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

6 Hidden Figures Figure 1: Katherine Johnson, Dorothy Vaughan, and Mary Jackson, were part of NASA s team of human computers. They were a group of programmers and mathematicians who helped send John Glenn around the Earth. The 2016 Hollywood movie is excellent in my opinion. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

7 Course Wrap up Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

8 Summary We learned modern C++ Completed 6 homework assignments, 14 labs, and 15 in-class activities Got a preview of Data Structures (Comp 15), and Algorithms (Comp 160). You should be proud! I recommend continuing to learn a little bit of c++ each day keep practicing! Lynda, pluralsight, learncpp, cpluscplus, and youtube! Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

9 Programming in C Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

10 What is C? The C Programming language was created by Denis Ritchie. Popular Programming in C book is by Brian Kernighan and Ritchie, which is still a good read today! (Referred to as K and R book) C is essentially C++, without the object-oriented parts. It was one of the original systems programming languages. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

11 Hello World from C 1 // The C l i b r a r y f o r i n p u t and output 2 #i n c l u d e <s t d i o. h> 3 4 i n t main ( ) { 5 6 // E q u i v a l e n t to s t d : : cout s t a t e m e n t 7 p r i n t f ( H e l l o world! \ n ) ; 8 9 r e t u r n 0 ; 0 } Listing 1: Back to where we first started this time in C! Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

12 Compiling Hello World When we compile, we use only clang without the ++. clang hello.c -o hello This means we are explicitly compiling C code only. No C++ features are available. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

13 Similarities So it looks quite familiar to C++! What has changed from C++ are the libraries we call functions from. C++ was originally built on top of C. We can use in our C++ code, any of the C libraries (remember to compile with clang++). Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

14 Memory is King In C, we are often working very closely with memory. We use malloc instead of new - to allocate memory We use free instead of delete - to reclaim memory. Mixing the two will cause compiler problems. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

15 Malloc and Free Example 1 #i n c l u d e <s t d i o. h> 2 #i n c l u d e < s t d l i b. h> 3 4 i n t main ( ) { 5 i n t s i z e = ; 6 i n t myintarray = ( i n t ) m a l l o c (100 s i z e o f ( i n t ) ) ; 7 8 f o r ( i n t i =0; i < s i z e ; ++i ) { 9 myintarray [ i ] = i ; 0 p r i n t f ( %d, myintarray [ i ] ) ; 1 } 2 3 f r e e ( myintarray ) ; 4 5 r e t u r n 0 ; 6 } Listing 2: Equivalent to new and delete in C++ but they should not be mixed Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

16 Memory functions C offers some powerful functions for quickly operating on memory. memset memcpy Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

17 memset example 1 #i n c l u d e <s t d i o. h> 2 #i n c l u d e <s t r i n g. h> 3 4 i n t main ( ) { 5 6 i n t n = ; 7 i n t myarray [ n ] ; 8 // Set each b y t e at a time to 0 9 memset ( myarray, 0, n s i z e o f ( myarray [ 0 ] ) ) ; 0 1 f o r ( i n t i =0; i < n ; ++i ) { 2 p r i n t f ( %d, myarray [ i ] ) ; 3 } 4 5 r e t u r n 0 ; 6 } Listing 3: Set one byte at a time to 0 Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

18 Why use C over C++ Generally a smaller footprint (executable sizes are smaller) This is helpful if we are programming embedded devices (think watches, a refrigerator, or a microwave, or items where we have limited storage). C has a more 1 to 1 ratio with assembly language, where you have even more control of how machine uses your code. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

19 Here is what assembly looks like by the way 1 ; example from h t t p : / / a s m. s o u r c e f o r g e. n e t / i n t r o / h e l l o. h t m l 2 s e c t i o n. t e x t 3 g l o b a l s t a r t ; must be d e c l a r e d f o r l i n k e r ( l d ) 4 5 s t a r t : ; t e l l l i n k e r e n t r y p o i n t 6 mov edx, l e n ; message l e n g t h 7 mov ecx, msg ; message to w r i t e 8 mov ebx, 1 ; f i l e d e s c r i p t o r ( s t d o u t ) 9 mov eax, 4 ; system c a l l number ( s y s w r i t e ) 0 i n t 0 x80 ; c a l l k e r n e l 1 mov eax, 1 ; system c a l l number ( s y s e x i t ) 2 i n t 0 x80 ; c a l l k e r n e l 3 s e c t i o n. d a t a 4 msg db H e l l o, world!,0 xa ; our d e a r s t r i n g 5 l e n equ $ msg ; l e n g t h o f our d e a r s t r i n g Listing 4: Assembly actually maps almost 1 to 1 with machine code Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

20 Python Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

21 What is Python? Python is a high-level programming language created by Guido van Rossum. It is general purpose, in that any sort of program can be made. It is more a scripting language, that is, programs do not compile to executables. There is Python 2.7.X and Python 3 most actively used. (Similar to how we have C++ and C++11/14/17) Today we will be discussing Python 3, which is slightly different than 2.7, but will long term likely be the more dominant language. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

22 Python - Follow Along Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

23 Python - Hello World 1 p r i n t H e l l o World \n Listing 5: Hello world in python Wait-should we have more source code here, this slide looks empty Nope! Some trade offs on the next slides. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

24 Python - Guessing Game in a Slide! 1 # Pound i s t h e comment symbol 2 import random # i n c l u d e a l i b r a r y 3 s e c r e t = r a n d i n t ( 1, 10) # G e n e r a t e a random number 4 g u e s s = # C r e a t e our w h i l e l o o p 7 w h i l e g u e s s!= s e c r e t ; 8 g u e s s = r a w i n p u t ( ) 9 0 i f g u e s s < s e c r e t : 1 p r i n t g u e s s h i g h e r 2 e l s e : 3 p r i n t g u e s s l o w e r 4 5 p r i n t You got i t! Listing 6: Guessing Game Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

25 A few observations No curly braces {} s Instead, Python uses whitespace to create code blocks terminated with a colon to determine scope Also, less parentheses () s or semi-colons The language is very clean! Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

26 Python - The List 1 mylist = [ ] 2 3 mylist. append ( 1 ) 4 mylist. append ( 2 ) 5 mylist. append ( 3 ) 6 7 p r i n t mylist 8 9 mylist. pop ( ) 0 mylist. pop ( ) 1 2 p r i n t mylist Listing 7: The fundamental data structure in Python Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

27 Python - List Comprehension 1 numbers = [ 1, 2, 3, 4, 5 ] 2 3 # 3 l i n e s o f code to make a new l i s t 4 s q u a r e s L i s t = [ ] 5 f o r n i n numbers : 6 s q u a r e s L i s t. append ( n n ) 7 8 # 1 l i n e o f code to make a new l i s t 9 s q u a r e s L i s t C o m p r e h e n s i o n = [ n n f o r n i n numbers ] Listing 8: Generate a list Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

28 Python - Plots 1 import m a t p l o t l i b. p y p l o t as p l t 2 import math 3 4 f i g, ax = p l t. s u b p l o t s ( ) 5 6 loggrowth = [ ] 7 l i n e a r G r o w t h = [ ] 8 q u a d r a t i c G r o w t h = [ ] 9 f o r i i n range ( 1, ) : 0 l i n e a r G r o w t h. append ( i ) 1 loggrowth. append ( math. l o g ( i, 2 ) ) 2 q u a d r a t i c G r o w t h. append ( i i ) ; 3 4 ax. p l o t ( loggrowth ) 5 ax. p l o t ( l i n e a r G r o w t h ) 6 ax. p l o t ( q u a d r a t i c G r o w t h ) 7 8 p l t. show ( ) Listing 9: Generate a list Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

29 Python - Functions 1 # D e f i n e a f u n c t i o n ( r e t u r n t y p e i n f e r r e d at run time ) 2 d e f s q u a r e ( x ) : 3 r e t u r n x x 4 5 # C r e a t e a l i s t o f 10 numbers 6 numbers = range ( 0, 1 0 ) 7 8 # Use a l i s t comprehension 9 s q u a r e s = [ s q u a r e ( n ) f o r n i n numbers ] 0 1 # P r i n t out the r e s u l t 2 p r i n t s q u a r e s Listing 10: Create a simple function Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

30 Python trade offs part 1 Python is extremely productive, in that there exist many libraries(i.e. package) to do the heavy lifting for us. The language was designed 20+ years after C, so there was time to innovate. C did its job for providing a higher level language in a resource constrained environment. There is no need to manage memory in Python (It is a memory managed language) There is no need to even declare the data type! (It is dynamically type, as opposed to statically typed the interpreter figures out what you mean) Python also has a nice REPL (Read-evaluate-print-loop) that lets you rapidly prototype code and ideas. You can do Object-Oriented program in Python just like in C++! Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

31 Python trade offs part 2 Typically, a Python program will run more slowly because it is interpreted. This means there is some overhead of the Python Interpreter that reads each line of python code you wrote over and over. There is no translation to 1 s and 0 s that the computer can quickly munch on. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

32 In-Class Activity Quick 1-2 sentence pitch of your final project State your name (so your classmates remember you!) 1-2 sentence project pitch. Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

33 The End! (Of Comp 11) Figure 2: We made it! Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

34 Glossary Dr. Mike Shah (Tufts University) Comp 11 Lectures August 9, / 34

Comp 11 Lectures. Mike Shah. July 26, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures July 26, / 45

Comp 11 Lectures. Mike Shah. July 26, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures July 26, / 45 Comp 11 Lectures Mike Shah Tufts University July 26, 2017 Mike Shah (Tufts University) Comp 11 Lectures July 26, 2017 1 / 45 Please do not distribute or host these slides without prior permission. Mike

More information

Comp 11 Lectures. Mike Shah. July 26, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures July 26, / 40

Comp 11 Lectures. Mike Shah. July 26, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures July 26, / 40 Comp 11 Lectures Mike Shah Tufts University July 26, 2017 Mike Shah (Tufts University) Comp 11 Lectures July 26, 2017 1 / 40 Please do not distribute or host these slides without prior permission. Mike

More information

Comp 11 Lectures. Mike Shah. July 12, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures July 12, / 33

Comp 11 Lectures. Mike Shah. July 12, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures July 12, / 33 Comp 11 Lectures Mike Shah Tufts University July 12, 2017 Mike Shah (Tufts University) Comp 11 Lectures July 12, 2017 1 / 33 Please do not distribute or host these slides without prior permission. Mike

More information

Python & Numpy A tutorial

Python & Numpy A tutorial Python & Numpy A tutorial Devert Alexandre School of Software Engineering of USTC 13 February 2012 Slide 1/38 Table of Contents 1 Why Python & Numpy 2 First steps with Python 3 Fun with lists 4 Quick tour

More information

Lecture 3: Finite Automata

Lecture 3: Finite Automata Administrivia Lecture 3: Finite Automata Everyone should now be registered electronically using the link on our webpage. If you haven t, do so today! I d like to have teams formed by next Monday at the

More information

Lecture 3: Finite Automata

Lecture 3: Finite Automata Administrivia Lecture 3: Finite Automata Everyone should now be registered electronically using the link on our webpage. If you haven t, do so today! I d like to have teams formed by next Wednesday at

More information

Comp 11 Lectures. Mike Shah. June 20, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures June 20, / 38

Comp 11 Lectures. Mike Shah. June 20, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures June 20, / 38 Comp 11 Lectures Mike Shah Tufts University June 20, 2017 Mike Shah (Tufts University) Comp 11 Lectures June 20, 2017 1 / 38 Please do not distribute or host these slides without prior permission. Mike

More information

Outline. policies for the first part. with some potential answers... MCS 260 Lecture 10.0 Introduction to Computer Science Jan Verschelde, 9 July 2014

Outline. policies for the first part. with some potential answers... MCS 260 Lecture 10.0 Introduction to Computer Science Jan Verschelde, 9 July 2014 Outline 1 midterm exam on Friday 11 July 2014 policies for the first part 2 questions with some potential answers... MCS 260 Lecture 10.0 Introduction to Computer Science Jan Verschelde, 9 July 2014 Intro

More information

Announcements. Problem Set 6 due next Monday, February 25, at 12:50PM. Midterm graded, will be returned at end of lecture.

Announcements. Problem Set 6 due next Monday, February 25, at 12:50PM. Midterm graded, will be returned at end of lecture. Turing Machines Hello Hello Condensed Slide Slide Readers! Readers! This This lecture lecture is is almost almost entirely entirely animations that that show show how how each each Turing Turing machine

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Warren Hunt, Jr. and Bill Young Department of Computer Sciences University of Texas at Austin Last updated: September 3, 2014 at 08:38 CS429 Slideset C: 1

More information

Lecture 4: Finite Automata

Lecture 4: Finite Automata Administrivia Lecture 4: Finite Automata Everyone should now be registered electronically using the link on our webpage. If you haven t, do so today! I dliketohaveteamsformedbyfriday,ifpossible,butnextmonday

More information

Unit 1 A.CED.1 One step Inequalities September 22, 2015

Unit 1 A.CED.1 One step Inequalities September 22, 2015 Answer: Journal Prompt Cristina was working on a multi step problem but she made a mistake. Find the error and explain how she could fix it. 3 x 6 + 4 x + 1 = 7x 10 3x 6 + 4x + 4 = 7x 10 x 2 = 7x 10 +2

More information

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University Prof. Mi Lu TA: Ehsan Rohani Laboratory Exercise #4 MIPS Assembly and Simulation

More information

CS187 - Science Gateway Seminar for CS and Math

CS187 - Science Gateway Seminar for CS and Math CS187 - Science Gateway Seminar for CS and Math Fall 2013 Class 3 Sep. 10, 2013 What is (not) Computer Science? Network and system administration? Playing video games? Learning to use software packages?

More information

Turing Machines Part II

Turing Machines Part II Turing Machines Part II Problem Set Set Five Five due due in in the the box box up up front front using using a late late day. day. Hello Hello Condensed Slide Slide Readers! Readers! This This lecture

More information

Students will read supported and shared informational materials, including social

Students will read supported and shared informational materials, including social Grade Band: Middle School Unit 18 Unit Target: Earth and Space Science Unit Topic: This Is the Solar System Lesson 9 Instructional Targets Reading Standards for Informational Text Range and Level of Text

More information

Scripting Languages Fast development, extensible programs

Scripting Languages Fast development, extensible programs Scripting Languages Fast development, extensible programs Devert Alexandre School of Software Engineering of USTC November 30, 2012 Slide 1/60 Table of Contents 1 Introduction 2 Dynamic languages A Python

More information

Homework 2: MDPs and Search

Homework 2: MDPs and Search Graduate Artificial Intelligence 15-780 Homework 2: MDPs and Search Out on February 15 Due on February 29 Problem 1: MDPs [Felipe, 20pts] Figure 1: MDP for Problem 1. States are represented by circles

More information

Today s Menu. Administrativia Two Problems Cutting a Pizza Lighting Rooms

Today s Menu. Administrativia Two Problems Cutting a Pizza Lighting Rooms Welcome! L01 Today s Menu Administrativia Two Problems Cutting a Pizza Lighting Rooms Administrativia Course page: https://www.cs.duke.edu/courses/spring13/compsci230/ Who we are: Instructor: TA: UTAs:

More information

How to write maths (well)

How to write maths (well) How to write maths (well) Dr Euan Spence 29 September 2017 These are the slides from a talk I gave to the new first-year students at Bath, annotated with some of the things I said (which appear in boxes

More information

Homework. Turing Machines. Announcements. Plan for today. Now our picture looks like. Languages

Homework. Turing Machines. Announcements. Plan for today. Now our picture looks like. Languages Homework s TM Variants and the Universal TM Homework #6 returned Homework #7 due today Homework #8 (the LAST homework!) Page 262 -- Exercise 10 (build with JFLAP) Page 270 -- Exercise 2 Page 282 -- Exercise

More information

1 SIMPLE PENDULUM 1 L (1.1)

1 SIMPLE PENDULUM 1 L (1.1) 1 SIMPLE PENDULUM 1 October 13, 2015 1 Simple Pendulum IMPORTANT: You must work through the derivation required for this assignment before you turn up to the laboratory. You are also expected to know what

More information

CSE370: Introduction to Digital Design

CSE370: Introduction to Digital Design CSE370: Introduction to Digital Design Course staff Gaetano Borriello, Brian DeRenzi, Firat Kiyak Course web www.cs.washington.edu/370/ Make sure to subscribe to class mailing list (cse370@cs) Course text

More information

Lab 10: DC RC circuits

Lab 10: DC RC circuits Name: Lab 10: DC RC circuits Group Members: Date: TA s Name: Objectives: 1. To understand current and voltage characteristics of a DC RC circuit 2. To understand the effect of the RC time constant Apparatus:

More information

Theory of Computation. Theory of Computation

Theory of Computation. Theory of Computation Theory of Computation Theory of Computation What is possible to compute? We can prove that there are some problems computers cannot solve There are some problems computers can theoretically solve, but

More information

Python. chrysn

Python. chrysn Python chrysn 2008-09-25 Introduction Structure, Language & Syntax Strengths & Weaknesses Introduction Structure, Language & Syntax Strengths & Weaknesses Python Python is an interpreted,

More information

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations Lab 2 Worksheet Problems Problem : Geometry and Linear Equations Linear algebra is, first and foremost, the study of systems of linear equations. You are going to encounter linear systems frequently in

More information

Theory of Computer Science

Theory of Computer Science Theory of Computer Science E1. Complexity Theory: Motivation and Introduction Malte Helmert University of Basel May 18, 2016 Overview: Course contents of this course: logic How can knowledge be represented?

More information

Selection and Adversary Arguments. COMP 215 Lecture 19

Selection and Adversary Arguments. COMP 215 Lecture 19 Selection and Adversary Arguments COMP 215 Lecture 19 Selection Problems We want to find the k'th largest entry in an unsorted array. Could be the largest, smallest, median, etc. Ideas for an n lg n algorithm?

More information

Theory of Computer Science. Theory of Computer Science. E1.1 Motivation. E1.2 How to Measure Runtime? E1.3 Decision Problems. E1.

Theory of Computer Science. Theory of Computer Science. E1.1 Motivation. E1.2 How to Measure Runtime? E1.3 Decision Problems. E1. Theory of Computer Science May 18, 2016 E1. Complexity Theory: Motivation and Introduction Theory of Computer Science E1. Complexity Theory: Motivation and Introduction Malte Helmert University of Basel

More information

Physics 351 Wednesday, January 10, 2018

Physics 351 Wednesday, January 10, 2018 Physics 351 Wednesday, January 10, 2018 Chapers 1 5 mostly review freshman physics, so we ll go through them very quickly in the first few days of class. Read Chapters 1+2 for Friday. Read Chapter 3 (momentum

More information

Turing Machines Part II

Turing Machines Part II Turing Machines Part II Hello Hello Condensed Slide Slide Readers! Readers! This This lecture lecture is is almost almost entirely entirely animations that that show show how how each each Turing Turing

More information

Prealgebra. Edition 5

Prealgebra. Edition 5 Prealgebra Edition 5 Prealgebra, Edition 5 2009, 2007, 2005, 2004, 2003 Michelle A. Wyatt (M A Wyatt) 2009, Edition 5 Michelle A. Wyatt, author Special thanks to Garry Knight for many suggestions for the

More information

Parts 3-6 are EXAMPLES for cse634

Parts 3-6 are EXAMPLES for cse634 1 Parts 3-6 are EXAMPLES for cse634 FINAL TEST CSE 352 ARTIFICIAL INTELLIGENCE Fall 2008 There are 6 pages in this exam. Please make sure you have all of them INTRODUCTION Philosophical AI Questions Q1.

More information

CSC321 Lecture 9 Recurrent neural nets

CSC321 Lecture 9 Recurrent neural nets CSC321 Lecture 9 Recurrent neural nets Roger Grosse and Nitish Srivastava February 3, 2015 Roger Grosse and Nitish Srivastava CSC321 Lecture 9 Recurrent neural nets February 3, 2015 1 / 20 Overview You

More information

SAMPLE. Read the information below and follow the instructions.

SAMPLE. Read the information below and follow the instructions. Sometimes errors can be made when using a calculator because of the nature of a question. Because a calculator is a machine, it doesn t always know what order to carry out functions, and so brackets must

More information

The P-vs-NP problem. Andrés E. Caicedo. September 10, 2011

The P-vs-NP problem. Andrés E. Caicedo. September 10, 2011 The P-vs-NP problem Andrés E. Caicedo September 10, 2011 This note is based on lecture notes for the Caltech course Math 6c, prepared with A. Kechris and M. Shulman. 1 Decision problems Consider a finite

More information

- Why aren t there more quantum algorithms? - Quantum Programming Languages. By : Amanda Cieslak and Ahmana Tarin

- Why aren t there more quantum algorithms? - Quantum Programming Languages. By : Amanda Cieslak and Ahmana Tarin - Why aren t there more quantum algorithms? - Quantum Programming Languages By : Amanda Cieslak and Ahmana Tarin Why aren t there more quantum algorithms? there are only a few problems for which quantum

More information

Computer Science Introductory Course MSc - Introduction to Java

Computer Science Introductory Course MSc - Introduction to Java Computer Science Introductory Course MSc - Introduction to Java Lecture 1: Diving into java Pablo Oliveira ENST Outline 1 Introduction 2 Primitive types 3 Operators 4 5 Control Flow

More information

Material Covered on the Final

Material Covered on the Final Material Covered on the Final On the final exam, you are responsible for: Anything covered in class, except for stories about my good friend Ken Kennedy All lecture material after the midterm ( below the

More information

Tutorial Three: Loops and Conditionals

Tutorial Three: Loops and Conditionals Tutorial Three: Loops and Conditionals Imad Pasha Chris Agostino February 18, 2015 1 Introduction In lecture Monday we learned that combinations of conditionals and loops could make our code much more

More information

Fourth Grade News Flash

Fourth Grade News Flash S Fourth Grade News Flash November 8, 2013 Dates to Remember 11/4 - No School 11/8 - End of 1 st Trimester 11/13 and 11/14 - Family Breakfast 11/15 - Report Cards sent home Language Arts This week s selection

More information

How to Make or Plot a Graph or Chart in Excel

How to Make or Plot a Graph or Chart in Excel This is a complete video tutorial on How to Make or Plot a Graph or Chart in Excel. To make complex chart like Gantt Chart, you have know the basic principles of making a chart. Though I have used Excel

More information

Convolutional Coding LECTURE Overview

Convolutional Coding LECTURE Overview MIT 6.02 DRAFT Lecture Notes Spring 2010 (Last update: March 6, 2010) Comments, questions or bug reports? Please contact 6.02-staff@mit.edu LECTURE 8 Convolutional Coding This lecture introduces a powerful

More information

Deterministic Finite Automata

Deterministic Finite Automata Deterministic Finite Automata COMP2600 Formal Methods for Software Engineering Ranald Clouston Australian National University Semester 2, 2013 COMP 2600 Deterministic Finite Automata 1 Pop quiz What is

More information

Announcements. Final exam review session tomorrow in Gates 104 from 2:15PM 4:15PM Final Friday Four Square of the quarter!

Announcements. Final exam review session tomorrow in Gates 104 from 2:15PM 4:15PM Final Friday Four Square of the quarter! The Big Picture Problem Problem Set Set 99 due due in in the the box box up up front. front. Congrats Congrats on on finishing finishing the the last last problem problem set set of of the the quarter!

More information

COMP424 Computer Security

COMP424 Computer Security COMP424 Computer Security Prof. Wiegley jeffw@csun.edu Rivest, Shamir & Adelman (RSA) Implementation 1 Relatively prime Prime: n, is prime if its only two factors are 1 and n. (and n 1). Relatively prime:

More information

10 - Celestron Telescope II: Operation

10 - Celestron Telescope II: Operation 10 - Celestron Telescope II: Operation Purpose: Gain more experience setting up a 6 Celestron telescope, familiarize yourself with the software interface, and acquire an image with the CCD camera. Due:

More information

5th Grade. Slide 1 / 191. Slide 2 / 191. Slide 3 / 191. Algebraic Concepts. Table of Contents What is Algebra?

5th Grade. Slide 1 / 191. Slide 2 / 191. Slide 3 / 191. Algebraic Concepts. Table of Contents What is Algebra? Slide 1 / 191 Slide 2 / 191 5th Grade Algebraic Concepts 2015-10-16 www.njctl.org Table of Contents click on the topic to go to that section Slide 3 / 191 What is Algebra? Order of Operations Grouping

More information

MATH36061 Convex Optimization

MATH36061 Convex Optimization M\cr NA Manchester Numerical Analysis MATH36061 Convex Optimization Martin Lotz School of Mathematics The University of Manchester Manchester, September 26, 2017 Outline General information What is optimization?

More information

Algorithms for Data Science

Algorithms for Data Science Algorithms for Data Science CSOR W4246 Eleni Drinea Computer Science Department Columbia University Tuesday, December 1, 2015 Outline 1 Recap Balls and bins 2 On randomized algorithms 3 Saving space: hashing-based

More information

Satellite project, AST 1100

Satellite project, AST 1100 Satellite project, AST 1100 Introduction and useful information 0.1 Project overview In this project you are going to send a satellite from your home planet, in your own personal star system, to visit

More information

Building a Computer Adder

Building a Computer Adder Logic Gates are used to translate Boolean logic into circuits. In the abstract it is clear that we can build AND gates that perform the AND function and OR gates that perform the OR function and so on.

More information

Kurt Schmidt. June 5, 2017

Kurt Schmidt. June 5, 2017 Dept. of Computer Science, Drexel University June 5, 2017 Examples are taken from Kernighan & Pike, The Practice of ming, Addison-Wesley, 1999 Objective: To learn when and how to optimize the performance

More information

Lecture 11: Information theory THURSDAY, FEBRUARY 21, 2019

Lecture 11: Information theory THURSDAY, FEBRUARY 21, 2019 Lecture 11: Information theory DANIEL WELLER THURSDAY, FEBRUARY 21, 2019 Agenda Information and probability Entropy and coding Mutual information and capacity Both images contain the same fraction of black

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.1 Construct finite automata using algorithms from closure arguments Determine

More information

Chemical Applications of Symmetry and Group Theory Prof. Manabendra Chandra Department of Chemistry Indian Institute of Technology, Kanpur

Chemical Applications of Symmetry and Group Theory Prof. Manabendra Chandra Department of Chemistry Indian Institute of Technology, Kanpur Chemical Applications of Symmetry and Group Theory Prof. Manabendra Chandra Department of Chemistry Indian Institute of Technology, Kanpur Lecture - 09 Hello, welcome to the day 4 of our second week of

More information

CHAPTER 1 LINEAR EQUATIONS

CHAPTER 1 LINEAR EQUATIONS CHAPTER 1 LINEAR EQUATIONS Sec 1. Solving Linear Equations Kids began solving simple equations when they worked missing addends problems in first and second grades. They were given problems such as 4 +

More information

Queues. Principles of Computer Science II. Basic features of Queues

Queues. Principles of Computer Science II. Basic features of Queues Queues Principles of Computer Science II Abstract Data Types Ioannis Chatzigiannakis Sapienza University of Rome Lecture 9 Queue is also an abstract data type or a linear data structure, in which the first

More information

1 SIMPLE PENDULUM 1 L (1.1)

1 SIMPLE PENDULUM 1 L (1.1) 1 SIMPLE PENDULUM 1 October 15, 2016 1 Simple Pendulum IMPORTANT: You must work through the derivation required for this assignment before you turn up to the laboratory. You are also expected to know what

More information

CSC321 Lecture 15: Recurrent Neural Networks

CSC321 Lecture 15: Recurrent Neural Networks CSC321 Lecture 15: Recurrent Neural Networks Roger Grosse Roger Grosse CSC321 Lecture 15: Recurrent Neural Networks 1 / 26 Overview Sometimes we re interested in predicting sequences Speech-to-text and

More information

Announcements. Using a 72-hour extension, due Monday at 11:30AM.

Announcements. Using a 72-hour extension, due Monday at 11:30AM. The Big Picture Announcements Problem Set 9 due right now. Using a 72-hour extension, due Monday at 11:30AM. On-time Problem Set 8's graded, should be returned at the end of lecture. Final exam review

More information

Circuit Analysis and Ohm s Law

Circuit Analysis and Ohm s Law Study Unit Circuit Analysis and Ohm s Law By Robert Cecci Circuit analysis is one of the fundamental jobs of an electrician or electronics technician With the knowledge of how voltage, current, and resistance

More information

Thermodynamics (Classical) for Biological Systems Prof. G. K. Suraishkumar Department of Biotechnology Indian Institute of Technology Madras

Thermodynamics (Classical) for Biological Systems Prof. G. K. Suraishkumar Department of Biotechnology Indian Institute of Technology Madras Thermodynamics (Classical) for Biological Systems Prof. G. K. Suraishkumar Department of Biotechnology Indian Institute of Technology Madras Module No. # 04 Thermodynamics of Solutions Lecture No. # 25

More information

HW8. Due: November 1, 2018

HW8. Due: November 1, 2018 CSCI 1010 Theory of Computation HW8 Due: November 1, 2018 Attach a fully filled-in cover sheet to the front of your printed homework Your name should not appear anywhere; the cover sheet and each individual

More information

Let s start by defining what it means for two statements to be logically equivalent.

Let s start by defining what it means for two statements to be logically equivalent. Boolean Algebra Boolean Algebra ( ) So far we have been presented with statements such as p, q, p, p q, p q, etc. It would be nice if we had a means of manipulating these statements in an algebraic manner.

More information

Today s Agenda: 1) Why Do We Need To Measure The Memory Component? 2) Machine Pool Memory / Best Practice Guidelines

Today s Agenda: 1) Why Do We Need To Measure The Memory Component? 2) Machine Pool Memory / Best Practice Guidelines Today s Agenda: 1) Why Do We Need To Measure The Memory Component? 2) Machine Pool Memory / Best Practice Guidelines 3) Techniques To Measure The Memory Component a) Understanding Your Current Environment

More information

import java. u t i l. ;... Scanner sc = new Scanner ( System. in ) ;

import java. u t i l. ;... Scanner sc = new Scanner ( System. in ) ; CPSC 490 Input Input will always arrive on stdin. You may assume input is well-formed with respect to the problem specification; inappropriate input (e.g. text where a number was specified, number out

More information

Introduction to Logic and Axiomatic Set Theory

Introduction to Logic and Axiomatic Set Theory Introduction to Logic and Axiomatic Set Theory 1 Introduction In mathematics, we seek absolute rigor in our arguments, and a solid foundation for all of the structures we consider. Here, we will see some

More information

Neural Networks Teaser

Neural Networks Teaser 1/11 Neural Networks Teaser February 27, 2017 Deep Learning in the News 2/11 Go falls to computers. Learning 3/11 How to teach a robot to be able to recognize images as either a cat or a non-cat? This

More information

Math Fundamentals for Statistics I (Math 52) Unit 7: Connections (Graphs, Equations and Inequalities)

Math Fundamentals for Statistics I (Math 52) Unit 7: Connections (Graphs, Equations and Inequalities) Math Fundamentals for Statistics I (Math 52) Unit 7: Connections (Graphs, Equations and Inequalities) By Scott Fallstrom and Brent Pickett The How and Whys Guys This work is licensed under a Creative Commons

More information

CSE 211. Pushdown Automata. CSE 211 (Theory of Computation) Atif Hasan Rahman

CSE 211. Pushdown Automata. CSE 211 (Theory of Computation) Atif Hasan Rahman CSE 211 Pushdown Automata CSE 211 (Theory of Computation) Atif Hasan Rahman Lecturer Department of Computer Science and Engineering Bangladesh University of Engineering & Technology Adapted from slides

More information

The Basics COPYRIGHTED MATERIAL. chapter. Algebra is a very logical way to solve

The Basics COPYRIGHTED MATERIAL. chapter. Algebra is a very logical way to solve chapter 1 The Basics Algebra is a very logical way to solve problems both theoretically and practically. You need to know a number of things. You already know arithmetic of whole numbers. You will review

More information

Lecture 5. September 4, 2018 Math/CS 471: Introduction to Scientific Computing University of New Mexico

Lecture 5. September 4, 2018 Math/CS 471: Introduction to Scientific Computing University of New Mexico Lecture 5 September 4, 2018 Math/CS 471: Introduction to Scientific Computing University of New Mexico 1 Review: Office hours at regularly scheduled times this week Tuesday: 9:30am-11am Wed: 2:30pm-4:00pm

More information

Mathematics I. Quarter 2 : ALGEBRAIC EXPRESSIONS AND FIRST-DEGREE EQUATIONS AND INEQUALITIES IN ONE VARIABLE

Mathematics I. Quarter 2 : ALGEBRAIC EXPRESSIONS AND FIRST-DEGREE EQUATIONS AND INEQUALITIES IN ONE VARIABLE Mathematics I Quarter : ALGEBRAIC EXPRESSIONS AND FIRST-DEGREE EQUATIONS AND INEQUALITIES IN ONE VARIABLE Hello guys!!! Let s have a great time learning Mathematics. It s time for you to discover the language

More information

In July: Complete the Unit 01- Algebraic Essentials Video packet (print template or take notes on loose leaf)

In July: Complete the Unit 01- Algebraic Essentials Video packet (print template or take notes on loose leaf) Hello Advanced Algebra Students In July: Complete the Unit 01- Algebraic Essentials Video packet (print template or take notes on loose leaf) The link to the video is here: https://www.youtube.com/watch?v=yxy4tamxxro

More information

GRIDLang. Move-Driven Game Programming Language Final Report. May 10, 2017

GRIDLang. Move-Driven Game Programming Language Final Report. May 10, 2017 GRIDLang Move-Driven Game Programming Language Final Report Akshay Nagpal (an2756) Parth Panchmatia (psp2137) Dhruv Shekhawat (ds3512) Sagar Damani (ssd2144) May 10, 2017 1 Contents 1 Introduction 4 2

More information

MiniMat: Matrix Language in OCaml LLVM

MiniMat: Matrix Language in OCaml LLVM Terence Lim - tl2735@columbia.edu August 17, 2016 Contents 1 Introduction 4 1.1 Goals........................................ 4 1.1.1 Flexible matrix notation......................... 4 1.1.2 Uncluttered................................

More information

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: Mapping Reducibility 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/mapping.pdf 1 Last time Reducibility

More information

vsyscall and vdso Adrien «schischi» Schildknecht vsyscall and vdso March 17, 2014

vsyscall and vdso Adrien «schischi» Schildknecht vsyscall and vdso March 17, 2014 March 17, 2014 Section 1 Introduction Goal In computing, a system call is how a program requests a service from an operating system s kernel. This may include hardware related services (e.g. accessing

More information

Designing Information Devices and Systems I Spring 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

Designing Information Devices and Systems I Spring 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way EECS 16A Designing Information Devices and Systems I Spring 018 Lecture Notes Note 1 1.1 Introduction to Linear Algebra the EECS Way In this note, we will teach the basics of linear algebra and relate

More information

Guidelines for Graphing Calculator Use at the Commencement Level

Guidelines for Graphing Calculator Use at the Commencement Level Guidelines for Graphing Calculator Use at the Commencement Level Introduction Graphing calculators are instrumental in the teaching and learning of mathematics. The use of this technology should be encouraged

More information

CS 700: Quantitative Methods & Experimental Design in Computer Science

CS 700: Quantitative Methods & Experimental Design in Computer Science CS 700: Quantitative Methods & Experimental Design in Computer Science Sanjeev Setia Dept of Computer Science George Mason University Logistics Grade: 35% project, 25% Homework assignments 20% midterm,

More information

Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2:

Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2: Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2: 03 17 08 3 All about lines 3.1 The Rectangular Coordinate System Know how to plot points in the rectangular coordinate system. Know the

More information

Rotational Motion. Figure 1: Torsional harmonic oscillator. The locations of the rotor and fiber are indicated.

Rotational Motion. Figure 1: Torsional harmonic oscillator. The locations of the rotor and fiber are indicated. Rotational Motion 1 Purpose The main purpose of this laboratory is to familiarize you with the use of the Torsional Harmonic Oscillator (THO) that will be the subject of the final lab of the course on

More information

P vs. NP. Data Structures and Algorithms CSE AU 1

P vs. NP. Data Structures and Algorithms CSE AU 1 P vs. NP Data Structures and Algorithms CSE 373-18AU 1 Goals for today Define P, NP, and NP-complete Explain the P vs. NP problem -why it s the biggest open problem in CS. -And what to do when a problem

More information

ISLAND BIOGEOGRAPHY Lab 7

ISLAND BIOGEOGRAPHY Lab 7 Reminders! Bring memory stick Read papers for Discussion Key Concepts Biogeography/Island biogeography Convergent evolution Dynamic equilibrium Student Learning Outcomes After Lab 7 students will be able

More information

High-Performance Scientific Computing

High-Performance Scientific Computing High-Performance Scientific Computing Instructor: Randy LeVeque TA: Grady Lemoine Applied Mathematics 483/583, Spring 2011 http://www.amath.washington.edu/~rjl/am583 World s fastest computers http://top500.org

More information

S C F F F T T F T T S C B F F F F F T F T F F T T T F F T F T T T F T T T

S C F F F T T F T T S C B F F F F F T F T F F T T T F F T F T T T F T T T EECS 270, Winter 2017, Lecture 1 Page 1 of 6 Use pencil! Say we live in the rather black and white world where things (variables) are either true (T) or false (F). So if S is Mark is going to the Store

More information

Physics 212E Spring 2004 Classical and Modern Physics. Computer Exercise #2

Physics 212E Spring 2004 Classical and Modern Physics. Computer Exercise #2 Physics 212E Spring 2004 Classical and Modern Physics Chowdary Computer Exercise #2 Launch Mathematica by clicking on the Start menu (lower left hand corner of the screen); from there go up to Science

More information

Introduction to MPI. School of Computational Science, 21 October 2005

Introduction to MPI. School of Computational Science, 21 October 2005 Introduction to MPI John Burkardt School of Computational Science Florida State University... http://people.sc.fsu.edu/ jburkardt/presentations/ mpi 2005 fsu.pdf School of Computational Science, 21 October

More information

Lesson 20B: Absolute Value Equations and Inequalities

Lesson 20B: Absolute Value Equations and Inequalities : Absolute Value Equations and Inequalities Warm-Up Exercise 1. Watch the absolute value video on YouTube Math Shorts Episode 10 and then answer the questions below. https://www.youtube.com/watch?v=wrof6dw63es

More information

Extended Introduction to Computer Science CS1001.py. Lecture 8 part A: Finding Zeroes of Real Functions: Newton Raphson Iteration

Extended Introduction to Computer Science CS1001.py. Lecture 8 part A: Finding Zeroes of Real Functions: Newton Raphson Iteration Extended Introduction to Computer Science CS1001.py Lecture 8 part A: Finding Zeroes of Real Functions: Newton Raphson Iteration Instructors: Benny Chor, Amir Rubinstein Teaching Assistants: Yael Baran,

More information

Lecture 2: Linear regression

Lecture 2: Linear regression Lecture 2: Linear regression Roger Grosse 1 Introduction Let s ump right in and look at our first machine learning algorithm, linear regression. In regression, we are interested in predicting a scalar-valued

More information

Math 308 Midterm Answers and Comments July 18, Part A. Short answer questions

Math 308 Midterm Answers and Comments July 18, Part A. Short answer questions Math 308 Midterm Answers and Comments July 18, 2011 Part A. Short answer questions (1) Compute the determinant of the matrix a 3 3 1 1 2. 1 a 3 The determinant is 2a 2 12. Comments: Everyone seemed to

More information

Four-Pan Algebra Balance

Four-Pan Algebra Balance Four-Pan Algebra Balance By Dr. George Kung and Ken Vicchiollo A Guide to Teaching Strategies, Activities, and Ideas ETA 20285B 2 INTRODUCTION I hear... and I forget I see... and I remember I do... and

More information

Extensions to the Logic of All x are y: Verbs, Relative Clauses, and Only

Extensions to the Logic of All x are y: Verbs, Relative Clauses, and Only 1/53 Extensions to the Logic of All x are y: Verbs, Relative Clauses, and Only Larry Moss Indiana University Nordic Logic School August 7-11, 2017 2/53 An example that we ll see a few times Consider the

More information

GRADE 6 Projections Masters

GRADE 6 Projections Masters TEKSING TOWARD STAAR MATHEMATICS GRADE 6 Projections Masters Six Weeks 1 Lesson 1 STAAR Category 1 Grade 6 Mathematics TEKS 6.2A/6.2B Understanding Rational Numbers A group of items or numbers is called

More information

Linear Programming Test Review. Day 6

Linear Programming Test Review. Day 6 Linear Programming Test Review Day 6 Warm-Up: Test Review Practice A machine can produce either nuts or bolts, but not both at the same time. The machine can be used at most 8 hours a day. Furthermore,

More information