# COMPENG 2SI4 Lecture 2: Math Review and Binary SearchPremium

3 pages72 viewsWinter 2017

School

McMaster UniversityDepartment

Computer EngineeringCourse Code

COMPENG 2SI4Professor

Sorina DumitrescuLecture

2This

**preview**shows half of the first page. to view the full**3 pages of the document.**Math Review

Permutations

● Ordered arrangement of a number of objects

● If there are n distinct elements there are n! Permutations

Modular Arithmetic

● The modulus function returns the remainder after dividing two integer

● Say we have 10 modulo 8 → this gives an answer of 2

○ In java this operation is written as 10%8

Arithmetic and Geometric Series

● These series are good to know

Harmonic Series

The above series diverges as n goes to infinity but it can be shown that:

And therefore we can say that the series diverges logarithmically as n approaches infinity

Sum of Consecutive Numbers Raised to the Same Power

###### You're Reading a Preview

Unlock to view full version

Subscribers Only

#### Loved by over 2.2 million students

Over 90% improved by at least one letter grade.