INFO 150: A Mathematical Foundation for Informatics Peter J. Haas - - PowerPoint PPT Presentation

info 150 a mathematical foundation for informatics
SMART_READER_LITE
LIVE PREVIEW

INFO 150: A Mathematical Foundation for Informatics Peter J. Haas - - PowerPoint PPT Presentation

INFO 150: A Mathematical Foundation for Informatics Peter J. Haas Lecture 1 1/ 20 Course Overview and Logistics Brief overview Course Logistics Introductions Number Puzzles and Sequences Number puzzles Sequences and Sequence Notation


slide-1
SLIDE 1

INFO 150: A Mathematical Foundation for Informatics

Peter J. Haas Lecture 1 1/ 20
slide-2
SLIDE 2 Course Overview and Logistics Brief overview Course Logistics Introductions Number Puzzles and Sequences Number puzzles Sequences and Sequence Notation Discovering Patterns in Sequences Sums Lecture 1 2/ 20
slide-3
SLIDE 3

INFO 150: A Mathematical Foundation for Informatics

Details at the course website: tinyurl.com/INFO150-F19 Teaching Staff I Instructor: Prof. Peter J. Haas I TA: Shivam Srivastava I UCA: Lucy Cousins I Grader: David Ter-Ovanesyan What is this introductory course about? I Discrete mathematics and the mathematical method I Versus continuous mathematics (calculus) I Because computers deal with 0’s and 1’s Aimed at students in Informatics I The “outward looking” area of computer science I Focus on development & application of computational principles and techniques to advance other disciplines I Prerequisites: A high school math background (algebra! ya × yb = ya+b) Lecture 1 3/ 20
slide-4
SLIDE 4

Course Goals and Objectives

Goals I Learn to think (more) mathematically I Learn to communicate thinking using mathematical language I Prep for future courses in computer science Objectives (see website) I Recursive thinking: dealing wth complexity I Mathematical logic: thinking clearly I Mathematical writing: communicating clearly I Abstraction: Leveraging what you know I Functions, relations, sets: basis for programs and data I Combinatorics: counting things I Probability: dealing with uncertainty I Graphs: dealing with relationships Applications to puzzles, games, programming, and important real-world problems Lecture 1 4/ 20 HS Friends College Friends Girlfriend's Friends University Friends Other Academic Friends griffsgraphs.wordpress.com/2012/07/02/a-facebook-network/
slide-5
SLIDE 5

Course logistics

Textbook: Ensley and Crawley I Expensive, but can buy used or rent (e.g., eCampus) I Do not buy Student Solutions Manual in place of textbook Schedules I Class meetings MW 2:30-3:45 in CompSci 140 I Attendance is required! I In class graded activities (bring paper and pencil!) I Lecture topics and readings: see syllabus on website I My office hours: Mon 4:30-5:30, Wed 10-11, and by appointment I Shivam’s office hours: Tues 10:30-noon, Fri 10:30-noon I Two evening midterms (7-9pm): I Thurs 17 Oct in ILC S331 I Thurs 14 Nov (location TBD) I Final exam: Fri 13 Dec, 3:30-5:30 (location TBD) Lecture slides I Annotated corrected slides posted after each unit Lecture 1 5/ 20
slide-6
SLIDE 6

More Logistics

Piazza for online discussion I Sign up via webpage link I Announcements will emailed from Piazza & posted on website I Ground rules I Be respectful, on-topic, and helpful (anonymity allowed—don’t abuse!) I Hints or clarifications only (don’t just ask for or post answers) I For private matters, post privately (preferred) or email me. Academic honesty policy I See link to UMass policy page on website—ignorance is no excuse! (AIQ quiz) I Exams: closed book, no outside help (cheating = F) I In-class assignments: help from classmates & instructor (writeup must be in own words) I Homework (we will use Gradescope) I Can discuss with other students I Writeup in your own words: appearance of copying = F I External sources (print or web) must be cited I No posting of class materials (incl. video/audio recordings) online without prior instructor permission, or providing to third party such as StudySoup Lecture 1 6/ 20
  • sign
up now ! Taken rite then
slide-7
SLIDE 7

Course Requirements and Grading

I Homework/attendance: 40% I Two midterm exams: 30% I Final exam: 30% I Optional Project: I Research report on a topic in discrete math I 3-5 pages of text exclusive of pictures I Report due by end of semester I Will push grade up if on boundary I More pushing if lower current grade I If doing well, won’t hurt not to do the project I Let us know if you are falling behind (Academic Alert...) Lecture 1 7/ 20
slide-8
SLIDE 8

Introductions

Me I Joined UMass in 2017 after 30 years at IBM Research & Stanford University I Math/CS interests: Data management & analytics, prob/stats, computer simulation I Real-world applications: air pollution modeling, computational biology (Watson and P53), healthcare I Random fact: related by marriage to the screenwriter for Star Wars You? Lecture 1 8/ 20
slide-9
SLIDE 9

Mathematics as a Language

A language has two parts: I Syntax and Grammar: How do we talk about things? I Math notation (a = a1, a2, . . .; S = Pk i=1 i2; Y = X>X, etc.) I Logic (∀x ∈ N, ∃y ∈ N such that y = x/2) I Mathematical objects: What things do we talk about? I Numbers (sequences, numerical patterns, series, divisibility, . . .) I Sets I Functions I Probabilities I Graphs I Matrices We use mathematical language to talk about the real world via abstraction I 35 = approximate number of people in the room I S = the set of people in the room I Is a math “sentence” true? (proofs & counter-examples) Lecture 1 9/ 20
slide-10
SLIDE 10

Number Puzzles [E&C Section 1.2]

  • 1. 1, 9, 17, 25, 33, 41, ??
  • 2. 1, 4, 9, 16, 25, 36, ??
  • 3. 2, 4, 8, 16, 32, 64, ??
  • 4. 1, 2, 6, 24, 120, 720, ??
Why do we care? I Training for recursive thinking in a simple setting I Used later when learning how to write proofs I Diagnosing time and space complexity of computations I “At each time step, each process spawns two more processes” I “Each sampling step removes 2/3 of the items and adds 10 more items” I “The nth pass through the data has to process n rows of the table Lecture 1 10/ 20
slide-11
SLIDE 11

Guess the Next Number

  • 1. 1, 9, 17, 25, 33, 41, ??
  • 2. 1, 4, 9, 16, 25, 36, ??
  • 3. 2, 4, 8, 16, 32, 64, ??
  • 4. 1, 2, 6, 24, 120, 720, ??
Strategy: Look for Patterns I Relate each term to previous terms (arithmetic formula) I Describe in terms of position in sequence I Recognize the set of integers from the examples Lecture 1 11/ 20
slide-12
SLIDE 12

Patterns

Example I Describe the sequence 1, 3, 5, 7, 9, ... each of the three ways Solution I Relate each term to previous terms I Describe in terms of position in sequence I Recognize the set of integers from the examples Lecture 1 12/ 20 Each term is 2 more than previous nth form is
  • 2. n
  • I
The
  • dd
natural numbers
slide-13
SLIDE 13

Sequences and Sequence Notation

Recursive Formula Each term is described in relation to previous terms via a recurrence relation Closed Formula Each term is described in terms of its position in the sequence Sequence Notation Sequence name is a lower-case letter (a, b, . . .) and a subscript gives position in sequence: an = nth term in sequence a Example I a = 1, 3, 5, 7, 9, . . . I a1 = 1, a2 = 3, a5 = 9 (it’s like a function; subscript = ordinal number) I Closed formula: an = 2n − 1 (for n ≥ 1) I Recursive formula: a1 = 1 and an = an1 + 2 (for n ≥ 2) Lecture 1 13/ 20
slide-14
SLIDE 14

Examples

For the sequence an = 2n − 1 with a1 = 1: I Write the first 3 terms: I Value of 10th term: a10 = I Formula for (k + 1)st term: I Formula for bi = a2i−3: For the sequence an = an−1 + 5 with a1 = 1: I Write the first 3 terms: I Recursive formula for 80th term: a80 = I Recursive formula for (k + 1)st term: I Recursive formula for a2j−3: Lecture 1 14/ 20 9--1,92=22
  • 1--3,95-23-1=7
210
  • I
= 1024
  • I
= 1023 Get , = 2kt '
  • I
bi
  • an :3
= Ii
  • I fbi-E-I-i.ly)
91=1 , Asea , +5=6 , Az =

92+5=11%+5

akti-acn.ly
  • it 5=945
Aaj . 5- Aaj
  • D
  • It 5=9141-5
slide-15
SLIDE 15

Discovering Patterns in Sequences

Give Recursive and closed formulas:
  • 1. 1, 9, 17, 25, 33, 41, ??
  • 2. 1, 4, 9, 16, 25, 36, ??
(1) look for differences and quotients—how fast do the numbers grow? (2) compare to simple series with same recurrence Lecture 1 15/ 20 tutti . . . µg recursive form bn " 8,16 , 24,32

di-lahdan-an.mg

bn
  • 8h
and an " bn -7 , so

an=8n-C7

' 49

an,

Ap
  • g
= n '
  • ( n
  • if
= n '
  • (
hunt 1) = Lh
  • I
, ' so

e1awdan=amt2hT

slide-16
SLIDE 16

Discovering Patterns in Sequences

Give Recursive and closed formulas:
  • 1. 2, 4, 8, 16, 32, 64, ??
  • 2. 1, 2, 6, 24, 120, 720, ??
(1) look for differences and quotients—how fast do the numbers grow? (2) compare to simple series with same recurrence Lecture 1 16/ 20 ' "

an-uzn.m.IT

an
  • an
  • i
= I
  • Ji
" I I
  • ' Ch
  • t )
i I ' , so

ar-2and9ni9n.itI-t@pnnotethataaI_aa3jaa4-n.so

F.iq

so9isandan-29@nI5o4oaaT-rasai-3.a

¥
  • 4
, aang

;

n so 9-uiandan-nan.IT a , i I , a 2 . 9=2 . I , a 5- 3 . ai . 3 ' L ' I

An=n-Cn-D.ln.2il=#T

q " n factorial "
slide-17
SLIDE 17

A Rockstar Sequence: Fibonacci Numbers

The Sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, . . . The recurrence relation F1 = F2 = 1 and Fn = Fn−1 + Fn−2 for n ≥ 3 The closed formula (Binet’s formula) Fn = 1 √ 5 1 + √ 5 2 !n − 1 − √ 5 2 !n! Applications include (see Fibonacci Quarterly):
  • 1. Fibonacci search, Fibonacci heaps
  • 2. Biology and more (leaf/petal patterns, tree branching, . . .)
Lecture 1 17/ 20
slide-18
SLIDE 18

Sums

Notation for sums n X k=1 ak = a1 + a2 + · · · + an = sum of first n terms of sequence a Extended notation for sums n X k=m ak = am + am+1 + · · · + an Example: Evaluate the sums I 3 X k=1 (2k − 1): I 2 X j=0 3j: I 3 X k=3 k2: I 3 X k=1 1 k(k + 1): Lecture 1 18/ 20 n
  • Mtl
terms 11-345=9 5=9 3%31+5=11-31-9--13

It f-t.fi?g--f

slide-19
SLIDE 19

Sums: More Examples

Notation for sums n X k=1 ak = a1 + a2 + · · · + an = sum of first n terms of sequence a Examples I Sum of first 10 numbers in sequence ak = 1/k with k ≥ 1 I 2 + 4 + 8 + 16 + 32 + 64 Lecture 1 19/ 20 10 E ' q = 's t 's t . .
  • t.to
K = I an I 2h

E

n so

E

2 n= I
slide-20
SLIDE 20

Sums: Complexity Example

kth pass through database looks at k records I How many records are looked at by the end of the nth pass? S = n X k=1 k = 1 + 2 + · · · + n Obtain closed form: Lecture 1 20/ 21 S = It 2 t .
  • t
µ
  • I )
th sa n t Cn
  • Dt
  • t
2 t I
  • 25
= cuts ) t ( nm ) t .
  • t
Intl ) tlntl ) =h( ntl ) so

s=ncn

slide-21
SLIDE 21

Stability of Sequences

Example Give the first 4 terms of an = 3an−1 − 6 with I a1 = 2: I a1 = 4: I a1 = 3: 20 40 60 80 100 10 20 30 40 50 60 70 n a1 = 1 a1 = 30 a1 = 60 an an = 0.9 an−1 + 3 Lecture 1 20/ 20 Try it ! Q : How to figure
  • ut the
stable

starting

value without plotting?