Top Banner
CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University
25

CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Dec 20, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

CS2420: Lecture 1

Vladimir KulyukinComputer Science Department

Utah State University

Page 2: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Outline

• What is CS 2420?

• Mathematical Preliminaries

Page 3: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Part 1

What is CS2420 is about?

Page 4: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Four Basic Questions for the Computer Scientist

• I have implemented an algorithm. How do I know how fast it runs?

• How can I prioritize tasks?

• How can I store/organize data efficiently?

• How can I retrieve/search data efficiently?

Page 5: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Textbook

Author: Mark Weiss

Title: Data Structures and Algorithm Analysis in C++, Third Edition

Publisher: Addison Wesley

ISBN: 0-321-44146-X

Page 6: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Workload

• There will be regular assignments.

• Assignments will require reading, coding and/or analysis.

• Times allocated for assignments will vary (1 – 3 weeks).

Page 7: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Homework Submission

• All coding problems should be submitted at http://eagle.cs.usu.edu.

• You must register for this class on the Eagle server.

• All analytical problems will be pencil and paper.

Page 8: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Final Grade

• Homework – 20 %

• Midterm Exam (March 5th, in class, 1:30 – 2:20) – 30 %

• Final Exam (April 28th, in class, 11:30 – 1:20) – 50 %

Page 9: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Class Attendance

• Attendance of regular classes is optional.

• Attendance of exams is mandatory (unless you want to get an F).

Page 10: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Part 2

Mathematical Prelims

(Chapter 1: Section 1.2)

Page 11: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Floors and Ceilings

.integer smallest :Ceiling

.integer greatest :Floor

xx

xx

Page 12: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Floors and Ceilings

nnn

xxxxx

22 2.

11 1.

Page 13: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Exponents

122222

NNNN

ABBA

BAB

A

BABA

XX

XX

X

XXX

Page 14: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Logarithms

.log ifonly and if ABBX XA

Page 15: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Logarithms

AB

ABA

BAAB

A

BB

BA

CB

C

CCC

C

CA

log

1log

loglog

logloglog

log

loglog :Base of Change

Page 16: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Logarithms

AN

CCC

BB

BB NA

BAB

A

AA

loglog

logloglog

log1

log

Page 17: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Arithmetic Series

.1,|1|

6

121

.2

1...321

1

1

1

2

1

kk

ni

nnnk

nnnk

n

i

kk

n

k

n

k

Page 18: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Geometric Series

.10 if ,1

1

.1

1...

0

0

1210

xx

x

x

xxxxxx

n

k

k

n

k

nnk

Page 19: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Polynomials

• Let d be a positive integer, then a polynomial in n of degree d is a function p(n) defined as

d

i

iinanp

0

)(

Page 20: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Factorials

0,)!1(

0,1!

nnn

nn

nk

e

nnn

n1

12!

Page 21: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Proofs

• A mathematical proof system consists of axioms, definitions, and terms

• Axioms are statements that are assumed to be true.

• Terms are elementary units that are not defined (dots, numbers).

• Definitions define new concepts through terms or existing definitions (lines, even numbers, odd numbers).

Page 22: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Useful Proof Techniques

• Direct proof

• Proof by contradiction

• Proof by counterexample

• Proof by induction

Page 23: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Direct Proof

• Need to Show: If P, then Q. (P Q).

• Assume that P is true and use the axioms, definitions, and previous theorems to show that Q is true.

Page 24: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Direct Proof: Example

. and

then, and ,min if that Show

21

21

dxdx

dxddd

Page 25: CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.

Proof By Contradiction

• Need to Show: If P, then Q.

• Assume that P is true and Q is false and find a contradiction, i.e., a statement that contradicts another true statement.