CPS 001 1.1 Topics l Networks revisited l Java intro l Decision Trees l Problem solving and computing with numbers l Upcoming ä Numeric computation Course.

Slides:



Advertisements
Similar presentations
ECS 15 if and random. Topic  Testing user input using if statements  Truth and falsehood in Python  Getting random numbers.
Advertisements

MATH 90 CHAPTER 4 PART I MSJC ~ San Jacinto Campus
Selection (decision) control structure Learning objective
Math 308 Discrete Mathematics Discrete Mathematics deals with “Separated” or discrete sets of objects (rather than continuous sets) Processes with a sequence.
Chapter 3 Program Design and Branching Structures Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering.
Chapter 20 Thinking Big: Functions. Copyright © 2006 Pearson Addison-Wesley. All rights reserved Anatomy of a Function Functions are packages for.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
An intro to programming The basic nitty-gritty that’ll make you scratch your head and say, “This is programming?”
1 Chapter 8 Designing Small Programs. 2 A ‘Procedure’ v A set of instructions which describe the steps to be followed in order to carry out an activity.
C++ for Engineers and Scientists Third Edition
Creating Linear Equations in One Variable
Algebra Problems… Solutions
Survey of Mathematical Ideas Math 100 Chapter 1 John Rosson Tuesday January 23, 2007.
Warm-up The mean grade on a standardized test is 88 with a standard deviation of 3.4. If the test scores are normally distributed, what is the probability.
Chapter 9 Interactive Multimedia Authoring with Flash - Introduction to Programming “Computers and Creativity” Richard D. Webster, COSC 109 Instructor.
Unit 4: Mathematics Introduce the laws of Logarithms. Aims Objectives
Unpacking the Standards for Mathematical Practice Professional Development September 16, 2013.
Microsoft Visual Basic 2005 CHAPTER 5 Mobile Applications Using Decision Structures.
CompSci Today’s topics Networks and the Internet Problem Solving Pseudocode Upcoming ä Programming language syntax ä Python Reading Brookshear,
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Chapter 5 Implementing UML Specification (Part II) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Section 8.1 Estimating  When  is Known In this section, we develop techniques for estimating the population mean μ using sample data. We assume that.
Section 2.4 Solving Linear Equations in One Variable Using the Addition-Subtraction Principle.
F22H1 Logic and Proof Week 6 Reasoning. How can we show that this is a tautology (section 11.2): The hard way: “logical calculation” The “easy” way: “reasoning”
Write down your choice of 5 different numbers between 1 and 36 Three ways to win. –In any order match: All 5 4 out of 5 3 out of 5 –Prize: Giant Book.
Math Games Compiled By: Joan Bartlett and Heather Bartlett.
CompSci Today’s topics Java Review Just a bunch of headings meant to trigger questions A contraction of previous notes Upcoming Midterm Exam Reading.
Praxis I Math Review By: Professor Peter Eley. Question 1 Text answers to A scientist has a very sophisticated microscope and laser cutting tool.
Solving Linear Programming Problems: The Simplex Method
Four Fundamental Pieces Instruction Control Structure Function Expression.
Section 2.4 Solving Linear Equations in One Variable Using the Addition-Subtraction Principle.
Conditional Expression One of the most useful tools for processing information in an event procedure is a conditional expression. A conditional expression.
CompSci Today’s topics Parsing Java Programming Reading Great Ideas, Chapter 3 & 4.
Chapter 5 Implementing UML Specification (Part II) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Chapter 2 Linear Systems in Two Variables and Inequalities with Applications Section 2.2.
Welcome to MM570 Psychological Statistics
Analyzing Puzzles and Games. What is the minimum number of moves required to complete this puzzle?
Networks. Ethernet  Invented by Dr. Robert Metcalfe in 1970 at Xerox Palo Alto Research Center  Allows group of computers to communicate in a Local.
Today’s topics Java Syntax and Grammars Sample Programs Upcoming More Java Reading Great Ideas, Chapter 2.
Year 9 Proof Dr J Frost Last modified: 19 th February 2015 Objectives: Understand what is meant by a proof, and examples.
Microsoft Visual Basic 2012 CHAPTER FIVE Decision Structures.
Today’s topics Java Input More Syntax Upcoming Decision Trees More formal treatment of grammers Reading Great Ideas, Chapter 2.
Chapter 10 So Many Paths … So Little Time (Multiple-Alternative Selection Structures) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1.1 Modeling and Equation Solving.
MATH & SCIENCE.  Pre-Algebra  Elementary algebra  Intermediate algebra  Coordinate geometry  Plane geometry  Trigonometry.
The Law of Averages. What does the law of average say? We know that, from the definition of probability, in the long run the frequency of some event will.
Introduction to programming in java Lecture 11 Boolean Expressions and Assignment no. 2.
Control Structure  What is control Structure?  Types of Controls  Use the control structure in VBScript.  Example Summery.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 1 FINAL EXAMINATION STUDY MATERIAL III A ADDITIONAL READING MATERIAL – INTRO STATS 3 RD EDITION.
CIS 100 Test #3 Review REACH Computer Resource Center.
IF STATEMENTS AND BOOLEAN EXPRESSIONS. BOOLEAN EXPRESSIONS Evaluate to a value of true or false Use relational or equivalence operators Boolean operators.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Chapter 10 Programming Fundamentals with JavaScript
Organization of Programming Languages
CHAPTER FIVE Decision Structures.
Chapter 4 Select…Case Multiple-Selection Statement & Logical Operators
Solving Systems Using Substitution
Chapter 4 Select…Case Multiple-Selection Statement & Logical Operators
CHAPTER FIVE Decision Structures.
Chapter 10 Programming Fundamentals with JavaScript
Chapter 4 Select…Case Multiple-Selection Statement & Logical Operators
Chapter 5: Control Structure
Chapter 4 Select…Case Multiple-Selection Statement & Logical Operators
Chapter 4 Select…Case Multiple-Selection Statement & Logical Operators
SSEA Computer Science: Track A
Comparing Data & the ‘switch’ Statement
Comparing Data & the ‘switch’ Statement
Algebra 1 Section 2.8.
Chapter 4 Select…Case Multiple-Selection Statement & Logical Operators
Chapter 4 Select…Case Multiple-Selection Statement & Logical Operators
Presentation transcript:

CPS Topics l Networks revisited l Java intro l Decision Trees l Problem solving and computing with numbers l Upcoming ä Numeric computation Course Notes: Chapter 3 Great Ideas : Chapter 3

CPS Ethernet l Invented by Dr. Robert Metcalfe in 1970 at Xerox Palo Alto Research Center l Allows group of computers to communicate in Local Area Network

CPS The Ethernet

CPS An Internet Ethernet 2 Ethernet Ace Network Red

CPS Number of networks needed? l Suppose you are dealing with Ethernets that can each only handle four computers. How many nets would you need to connect 100 such machines and tell how you would connect them. Assume that one machine can connect to no more than two networks simultaneously.

CPS Network transfers l A network transfer is the passage of a message from one network to another through a gateway machine. l We wish to connect 100 machines having 2 network controllers each. l How many computers can a message reach without leaving the 2 networks the originating computer is attached to? l How many networks can a message reach in after 1 network transfer or 2 network transfers? l How many network transfers are necessary to reach 100 computers or 1024 computers?

CPS Decision trees l If-Then statements if (logical expression) { “true” actions } l If-Then-Else statements if (logical expression) { “true” actions } else (logical expression 2) { “false” actions } l Logical expressions ä analogous to yes or no questions  true or false Statements that are true ä (5 < 7) ä (100 == 100) ä (100 != 10) ä (10 <= 10) Statements that are false ä (-2 > -1) ä (10 != 10)

CPS A decision tree He received the Physics Price in Try A. Solzhenitsyn, Literature Look up the Peace Prize in Try the Medicine Prize in Would you prefer a humanitarian? Would you like to read about a scientist? Would you like to read about Einstein?

CPS More Java Syntax l Assignment statement variable = expression; l Method invocation ä Also called function or procedure ä Invoking also called “calling” a function ä Methods can take arguments button.setText(“This text is an argument”); init() l Variable declaration VariableType variableName; Button choice;

CPS Problem Solving Programming is a strenuous exercise in problem solving G. Polya. How to Solve It, 2 nd ed., Princeton University Press, l Understand the problem ä What are its parts? unknown, data, condition ä Does the problem make sense? Is it feasible? ä Think about the problem, get a sense of what it needs l Make a plan ä Find the connection between givens and result ä What kind of problem is it? Is it familiar? ä Think about generalizations, specializations, variants l Carry out the plan ä Check each step l Examine the result ä Does it make sense?

CPS Back of the envelope calculations Jon Bentley. Programming Pearls. 2 nd edition. Addison-Wesley, l Engineering technique to approximate and check answers ä Two answers are better than one ä Quick checks ä Rules of thumb ä Practice l Ad claims that salesperson drove 100,000 miles in a year. True? l Newspaper article states that a United States quarter dollar coin has “an average life of 30 years.” How can you check that claim?

CPS Game l 10 coins ä You and a friend have a stack of 10 coins ä On each person’s turn, they remove either 1 or 2 coins from the stack ä The person who removes the last coin wins. ä Can you win? l 10 coins with a twist ä 10 coins, can now ALSO place 1 or 2 coins back on the stack ä Person who removes last coin wins ä Should you go first or second, and what’s your strategy

CPS Puzzle: Pennies Heads Up From Car Talk! l You're sitting at a table with a bunch of pennies on it. Some are facing heads up and some are facing tails up. You're wearing a blindfold, and you're wearing mittens so that you can't actually feel the coins and tell which side is facing up. l I will tell you that a certain number of the pennies are facing heads up. Let's say 10 are facing heads up. l Is it possible to separate those pennies into two groups, so that each group has the same number of pennies facing heads up? How do you do it? ä Pennies can be flipped or moved as much as needed