CS1101X: Programming Methodology Recitation 6 Arrays I.

Slides:



Advertisements
Similar presentations
Copyright © Cengage Learning. All rights reserved.
Advertisements

Binomial Expansion and Maclaurin series Department of Mathematics University of Leicester.
Factoring Trinomials ax 2 + bx + c (a > 1)  Model the following by drawing rectangles with the given areas.  Label the sides.  Factor the area/polynomial.
On the Density of a Graph and its Blowup Raphael Yuster Joint work with Asaf Shapira.
CSE115/ENGR160 Discrete Mathematics 03/01/12
Are You Smarter Than Mr. Alder? Are You Smarter Than a 5 th Grader? 1,000,000 5th Grade Question 1 5th Grade Question 2 4th Grade Question 3 4th Grade.
Copyright © Cengage Learning. All rights reserved.
Pascal’s Triangle Row
Chapter 18 To accompany Helping Children Learn Math Cdn Ed, Reys et al. ©2010 John Wiley & Sons Canada Ltd.
Pascal’s Triangle.
PASCAL’S TRIANGLE Unit 1, Day 10. Pascal’s Wager “If God does not exist, one will lose nothing by believing in Him, while if he does exist, one will lose.
It’s a triangle. A triangle of numbers! Pascal did not create it…. The Chinese did. Blaise Pascal discovered all of the unique patterns in it.
1 Lecture 1: Course Overview Course: CSE 360 Instructor: Dr. Eric Torng TA: Huamin Chen.
Set, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides.
Chapter 10 Sequences, Induction, and Probability Copyright © 2014, 2010, 2007 Pearson Education, Inc Mathematical Induction.
CHAPTER 8: RIGHT TRIANGLES Watch the follow clip about the Sunshine Skyway Bridge. Think about the design and construction. Do you recognize any right.
The Fundamentals: Algorithms, the Integers & Matrices.
Copyright © 2007 Pearson Education, Inc. Slide 8-1.
EXAMPLE 4 Use Pascal’s triangle School Clubs The 6 members of a Model UN club must choose 2 representatives to attend a state convention. Use Pascal’s.
HOW TO FIND AN ANGLE MEASURE FOR A TRIANGLE WITH AN EXTENDED SIDE
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
1 © 2010 Pearson Education, Inc. All rights reserved 10.1 DEFINITION OF A SEQUENCE An infinite sequence is a function whose domain is the set of positive.
Rev.S08 MAC 1140 Module 12 Introduction to Sequences, Counting, The Binomial Theorem, and Mathematical Induction.
CS1101X: Programming Methodology Recitation 7 Arrays II.
Copyright © Cengage Learning. All rights reserved.
Pascal triangle?. Blaise Pascal (Blaise Pascal) was born 1623, in Clermont, France. His father, who was educated chose not to study mathematics before.
The Binomial Theorem.
Chapter 1 Equations, Inequalities, and Mathematical Models
“Teach A Level Maths” Vol. 1: AS Core Modules
Notes 9.2 – The Binomial Theorem. I. Alternate Notation A.) Permutations – None B.) Combinations -
Examples using Arrays. Summing Squares Problem: To compute the sum of the squares of N numbers N is given N values are also given These should be read.
1-8 An Introduction to Equations. Vocabulary Equation: A mathematical sentence that uses an equal sign. Open Sentence: An equation is an open sentence.
Copyright © 2007 Pearson Education, Inc. Slide 8-1.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
5-7: The Binomial Theorem
The Commutative Property Using Tiles © Math As A Second Language All Rights Reserved next #4 Taking the Fear out of Math.
Copyright © Cengage Learning. All rights reserved. 8.4 The Binomial Theorem.
CONTROL FLOW The order in which blocks are executed is called the “control flow” of the script So far all our scripts have just executed blocks in the.
Copyright © Cengage Learning. All rights reserved. 8 Sequences, Series, and Probability.
CS1101: Programming Methodology Preparing for Practical Exam (PE)
2-6 Binomial Theorem Factorials
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
1 An Introduction to R © 2009 Dan Nettleton. 2 Preliminaries Throughout these slides, red text indicates text that is typed at the R prompt or text that.
CS1101: Programming Methodology Preparing for Practical Exam (PE)
1 2/21/2016 MATH 224 – Discrete Mathematics Sequences and Sums A sequence of the form ar 0, ar 1, ar 2, ar 3, ar 4, …, ar n, is called a geometric sequence.
Sum of Arithmetic Sequences. Definitions Sequence Series.
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
Agenda 9/27 DO NOW (3 parts) ◦Prove the following: 1.The length of a square is 5 cm. What is the measure of its width? How can you be sure? 2.What is the.
Blaise Pascal ( ) was a French mathematician.
CS1101X: Programming Methodology Recitation 6 Arrays I.
Pascal’s Triangle Is a famous number pattern that has use in the study of counting… Pascal's Triangle is named after Blaise Pascal in much of the western.
Mathematics Types of Triangles.
Name the type of triangle shown below.
Sequences, Series, and Probability
Objectives Find entries in Pascal’s triangle.
Pascal’s Triangle Permission Pending By. Ms. Barnes.
The Binomial Theorem; Pascal’s Triangle
The Binomial Theorem Objectives: Evaluate a Binomial Coefficient
PASCAL TRIANGLE
Ch 4.2: Adding, Subtracting, and Multiplying Polynomials
Pascal’s Triangle MDM 4U Lesson 5.1.
Section 4.2 Expanding Binomials Using Pascal’s Triangle
PASCAL’S TRIANGLE.
The Binomial Theorem OBJECTIVES: Evaluate a Binomial Coefficient
Section 6.3 Combinations with Pascal’s Triangle
9 x 14 9 x 12 Calculate the value of the following: 1 8 × 12 =
Pascal’s Triangle & Probability (1/2)
5-6 Inequalities in ONE Triangle
Pascal’s Triangle.
Presentation transcript:

CS1101X: Programming Methodology Recitation 6 Arrays I

CS1101X Recitation #62 Task 1: Learning-by-mistake To be given out at the recitation.

CS1101X Recitation #63 Task 2: isSorted A program IsSortedArray.java to test whether a list of integers in sorted in non-decreasing order. The method isSorted() returns true if the array is sorted; it returns false otherwise. Based on what we have discussed for task 1, can you write the isSorted() method? true false

CS1101X Recitation #64 Task 3: Second largest Given a list of integers, determine the second largest value in the list. (Assuming that the list contains at least 2 values.)

CS1101X Recitation #65 Task 4: Pascal’s Triangle (1/3) Blaise Pascal was a scientist, mathematician par excellence who lived in the 17 th century. Some of his mathematical work was fundamental to the theory of probability. There is also a programming language named after him (though in no real sense related to him). More of him in this website (for those who are interested):

CS1101X Recitation #66 Task 4: Pascal’s Triangle (2/3) In this problem, you are asked to generate Pascal's Triangle. Pascal's Triangle is useful in many areas from probability to polynomials to setting programming questions. It is a triangle of integers with 1 on top and down the sides. Any number in the interior equals the sum of the two numbers above it. For example, here are the first 5 rows of the triangle

CS1101X Recitation #67 Task 4: Pascal’s Triangle (3/3) Write a program to generate a Pascal ’ s Triangle as shown. It should be observed that the next row of the Pascal ’ s triangle can be generated from the previous row. Thus, using an array to store the values of the previous rows seems appropriate Output for n (number of rows) = 6.

CS1101X Recitation #68 To be continued… More problems on arrays (including array of objects) at the next recitation.

CS1101X Recitation #69 End of Recitation #6