0% found this document useful (0 votes)
44 views2 pages

COMP 410 (Spring 2012)

This document provides an introduction and overview for a computer science course. It discusses that computer science involves abstractions that simplify complex systems by hiding details. As an example, it discusses how data structures represent data and operations on that data. It then provides organizational details for the course website and teaching assistant. It outlines the expected mathematical background and reviews topics like proofs, logarithms, and series that will be useful for the course.

Uploaded by

Kat Hawthorne
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views2 pages

COMP 410 (Spring 2012)

This document provides an introduction and overview for a computer science course. It discusses that computer science involves abstractions that simplify complex systems by hiding details. As an example, it discusses how data structures represent data and operations on that data. It then provides organizational details for the course website and teaching assistant. It outlines the expected mathematical background and reviews topics like proofs, logarithms, and series that will be useful for the course.

Uploaded by

Kat Hawthorne
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1

COMP 410 (Spring 2012)


Sk B

L ECTURE 1
Introduction

Computer science is all about abstractions Too complex to know everything abstractions simplify by hiding the details (and allow us to know about more things...) Example: electronic circuits bits bytes assembly But someone has to know the details; for DSs, you do Many examples in CS. The one well be discussing: data-structures or objects, which are data + operations Example: Arrays. Operations are create (declare; not in all languages). E.g., double[] A = new double[10]; retrieve e.g., x = A[i]; assign e.g., A[i] = 5.5; The standard representation, and a representation as (index, value) ordered pairs. Standard representation needs size to be known beforehand; but allows faster access(random access) Notion of preconditions: what if the index i in A[i] is > A.length?

Organizational details

The web-site: http://www.cs.unc.edu/baruah/Teaching/2012-1Sp/ TA: primarily grading responsibilities appointment by email. (TuTh 11:00 -12:00)

Expected background

Math (Proofs, etc. sections from book) Sec 1.1 (the selection problem) Sec 1.2 - Math Review 1.2.1-1.2.3, 1.2.5 (proofs) Sec 1.3 Recursion Fluency in programming (just the basics nothing fancy; e.g., no GUIs needed) Well have a test soon, after 3 lectures

Math review (Sec 1.2) Sec 1.2.1 X AX B X A /X B (X A )B X


N

= = = = =

X A+B X AB X AB 2X N 2N +1 (= X2N )!!

+X

2N + 2 N

Sec 1.2.2: Logarithms (base 2, unless otherwise specied) Denition: logb n = k means that bk = n. (In base 2: (log n = k) (2k = n)) log AB log(AX ) = = log A + log B X log A

log 1 = 0; log 2 = 1; . . . , log 1024 = 10; . . . log 1000 10; log 106 20; log 109 30; . . . Sec 1.2.3: Series N
i=0

Ai =

AN +1 1 A1

(A = 1)

Instantiate for A = 2 Some derivations:

i=0

Ai ,

for A < 1

Some sums:
N i=1

1 2i i=0

= =

N (N + 1) 2 N (N + 1)(2N + 1) 6 N k+1 k+1 ( N3 ) 3

Sec 1.2.5: Proofs (particularly by induction) N Illustrating the technique by an example: i=1 i. k k(k+1) Let STMT(k) denote the statement i=1 i = 2 We wish to prove that STMT(k) is true for all k 0. Easy to prove for specic values of k (e.g., k = 0, k = 1, etc.) using simple algebra. The method of induction: Explicitly show STMT(k) is true for small values of k (base case) Assume STMT(k) is true for all values of k n (induction hypothesis), and use these to show STMT(n + 1) is true as well It then follows that STMT(k) is true for all n

N i=1

N i=1

i2 ik

You might also like