CSE 5311 Notes 1: Mathematical Preliminaries
|
|
- Lorraine Mitchell
- 6 years ago
- Views:
Transcription
1 Chapter 1 - Algorithms Computig CSE 5311 Notes 1: Mathematical Prelimiaries Last updated 1/20/18 12:56 PM) Relatioship betwee complexity classes, eg log,, log, 2, 2, etc Chapter 2 - Gettig Started Loop Ivariats ad Desig-by-Cotract especially Table 1 o p 13): RAM Model Assumed Reality Memory Access Arithmetic Word size Chapter 3 - Asymptotic Notatio f) = Og)) g) bouds f) above by a costat factor) f) = Ωg)) g) bouds f) below by a costat factor) f) = θg)) f) = Og)) ad f) = Ωg)) Iterated Logarithms log k = log ) k log k) = loglog k-1) ) = log log log log 1) = log ) lg* = Cout the times that you ca puch a log key o your calculator before value is 1 Appedix A - Summatios Arises for algorithms that ru i practically or early costat time Review: Geometric Series p 1147) Harmoic Series p 1147) Approximatio by itegrals p 1154)
2 Chapter 4 - Recurreces 2 SUBSTITUTION METHOD - Review 1 Guess the boud 2 Prove usig strog) math iductio Exercise: ) = 4T 2 + Try Ο 3 ad cofirm by math iductio Assume T k) ck 3 for k < c ) = 4 2 4c = c = c 3 c c if is sufficietly large c 3 Improve boud to Ο 2 ad cofirm Assume T k) ck 2 for k < c ) = 4T 2 + 4c = c2 + STUCK!
3 Ω 3 as lower boud: 3 Assume T k) ck 3 for k < c ) = 4 2 4c = c Ω 2 as lower boud: = c 3 c c ? c 3 DID NOT PROVE!!! Assume T k) ck 2 for k < c ) = 4T 2 What s goig o T 1 + 4c = c2 + c 2 for 0 < c ) = d ) = 4T 1) + 2 = 4d + 2 ) = 4T 2) + 4 = 4 4d + 2) + 4 =16d =16d +12 ) = 4T 4) + 8 = 4 16d +12) + 8 = 64d = 64d + 56 ) = 4T 8) +16 = 4 64d + 56) +16 = 256d = 256d T 2 T 4 T 8 T 16 Hypothesis : T ) = d = d +1) 2 = c 2
4 Ο 2 : 4 Assume T k) ck 2 k for k < ) c T ) = 4T 2 ) + 4 c ) + = c2 2 + = c 2 Ω 2 : [This was already prove] Exercise: Assume T k) ck 2 k for k < ) c T ) = 4T 2 ) + 4 c ) + = c2 2 + = c 2 T ) = T ) +1 Ο log): Ο loglog ) Assume T k) c lgk for k < T ) c lg = c lg 2 T ) = ) +1 c lg c lg if c = c lg c lg 2 +1 Assume T k) c lglg k for k < Note : log a log a Θ log b log b )) T ) c lglg = c lg lg 2 = c lglg c ) +1 c lglg c +1 c lglg if c 1 T ) =
5 Ω loglog ) 5 Assume T k) c lglg k for k < T ) c lglg = c lg lg 2 = c lglg c ) +1 c lglg c +1 c lglg if 0 < c 1 T ) = Substitutio Method is a geeral techique - See CSE 2320 Notes 08 for quicksort aalysis RECURSION-TREE METHOD - Review ad Prelude to Master Method Covert to summatio ad the evaluate Example: Mergesort, p 38 T ) = 2T 2) + case 2 for master method) T=2k)= T/2=2k-1)= T/2=2k-1)= T/4=2k-2)= T/4=2k-2)= T/4=2k-2)= T/4=2k-2)= T/8=2k-3)= T/16=2k-4)= T/2k=2k-k=1)=
6 Exercise: 6 ) = 4T 2 + T) T/2) /2 4/2=2 T/4) /4 16/4=4 lg + 1 levels T/8) /8 64/8=8 T/16) /16 T2)=T/2lg -1) 2 256/16=16 4lg -1 /2lg -1 =2lg -1 T1) 1 4lg =lg 4 =2 Usig defiite geometric sum formula: lg 1 c 2 k + c 2 = c 2lg 1 k= c2 t Usig x k k=0 Case 1 of master method) = c 1) +c 2 = c 2 c +c 2 = Θ 2 ) + * = xt+1 1 x 1 x 1
7 Exercise: case 3 of master method) 7 ) = 2T T) 3 3 T/2) 3/8 23/8=3/4 T/4) 3/64 43/64=3/16 lg + 1 levels T/8) 3/512 83/512=3/64 T/16) 3/ /4096=3/256 T2)=T/2lg -1) 8 2lg -1/2lg -1)3=3/4lg -1 T1) 1 2lg = Usig idefiite geometric sum formula: c 3 lg 1 1 k=0 4 k + c c 3 1 k=0 4 k + c = c c From x k = 1 k=0 1 x 4 0 < x <1 = 4 3 c3 + c = O 3 ) Usig defiite geometric sum formula: ) lg 1 c 3 lg 1 1 k=0 4 k + c = c 3 1 t c Usig x k k=0 = c = Θ 3 * ) + c = c = xt+1 1 x 1 + c = 4 3 c * + c ) x 1
8 MASTER METHOD/THEOREM ew ) - CLRS 45 8 T ) = at b ) + f ) a 1 b > 1 Three mutually exclusive cases proof sketched i 461): 1 f ) = O log b a ε, ε > 0 ) = Θ log b a leaves domiate) 2 f ) = Θ log b a ) = Θ log b a log each level cotributes equally) 3 ) = Ω log b a ε f ), ε > 0, ad af b c <1 for all sufficietly large ) cf ), ) ) = Θ f ) root domiates) Problem 46-3 shows that ε > 0 i 3 follows from the existece of c ad 0 By takig = bk 0 ad the coditio o f, a c ε logb 1 c ) ) ) log b log b 0 f 0 ) f ) may be established Last step is Example: ) =10T + 10 a = 10 b = 10 f) = 5 log = Case 1: 5 = O 1-ε ), 0 < ε 05 T ) = Θ )
9 Example: recursio tree give earlier - leaves domiate) 9 ) = 4T 2 + a = 4 b = 2 f) = log 2 4 = 2 Case 1: = O 2-ε ), 0 < ε 1 Example: ) = 9T 3 ) = Θ a = 9 b = 3 f) = 2 2 log 3 9 = 2 Case 2: 2 2 = Θ 2 ) Recursio Tree ) ) = Θ 2 log ) T) T/3) 22/ T/9) 22/ T/27) 22/729 T1) c 9 22 c9log 3 =clog 3 9=c2 ) = 2 2 log 3 + c 2 = Θ 2 log
10 Example: 10 ) = 2T a = 2 b = 2 f) = 3 lg 2 = Case 3: 3 = Ω 1+ε ), 0 < ε 2 Example: ) = 2 3 af b ) = T 2 8 ) = Θ c 3 = cf ), 1 4 c <1 ) a = 1 b = 2 f) = /2 lg 1 = 0 = 1 Case 3: /2 = Ω 0 ε ), 0 < ε 1 ) =1 22 af b From CLRS, p 95: ) = 2T 2 T ) = Θ ) + lg = 4 c 2 = cf ), 1 2 c <1 a = 2 b = 2 f) = lg lg 2 = 1 = f ) = ω ), but f ) Ω ε af b ) = 2 f 2 ) = 2 2 lg 2) * for ay ε > 0 ) = lg = clg + 1 c) lg cf ) = clg for c 1 So master method case 3) does ot support T ) = Θ lg )
11 11 Usig exercise 46-2 as a hit or a simple recursio tree with = 2 k ) Substitutio method to show Ο : Assume T k) ck lg 2 k for k < ) c 2 lg2 2 ) = c 2 ) + lg 2c 2 2 T ) = 2 2 Ω : clg 2 for c ε ) = Θ lg 2 lg 1 )2 Assume T k) ck lg 2 k for k < ) c 2 lg2 2 ) = c 2 ) + lg 2c 2 2 T ) = 2 2 clg 2 for 0 < c 1 2 lg 1 )2 + lg = c lg 2 2clg + c + lg lg 1 )2 lg 1 )2 + lg = c lg 2 2clg + c + lg PROBABILISTIC ANALYSIS Hirig Problem - Iterview potetial assistats, always hirig the best available Iput: Output: Permutatio of 1 The umber of sequece values that are larger tha all previous sequece elemets Worst-case = Observatio: For ay k-prefix of sequece, the last elemet is the largest with probability Summig for all k-prefixes: l < 1 = k H l +1 k=1
12 Hirig m-of- Problem 12 Observatio: For ay k-prefix of sequece, the last elemet is oe of the m largest with probability if k m otherwise Sum for all k-prefixes expected umber that are hired) m + m k k=m+1 = m + mh mhm What data structure supports this applicatio? Coupo Collectig Kuth) types of coupo Oe coupo per cereal box How may boxes of cereal must be bought expected) to get at least oe of each coupo type? Collectig the coupos is decomposed ito steps: Step 0 = get first coupo Step 1 = get secod coupo Step m = get m+1st coupo Step - 1 = get last coupo Number of boxes for step m Let p i = probability of eedig exactly i boxes difficult) p i = m ) i 1 m, so the expected umber of boxes for coupo m + 1 is ipi i=1 Let q i = probability of eedig at least i boxes = probability that previous i - 1 boxes are failures much easier to use) So, pi = qi qi+1
13 ip i = i q i q i+1 ) i=1 i=1 = iq i iq i+1 i=1 i=1 = iq i i 1)q i i=1 i=2 = q 1 + iq i iq i + q i i=2 i=2 i=2 = q i i=1 13 q 1 =1 q2 = m q 3 = m ) 2 ) k 1 q k = m q i = m ) i = 1 1 i=1 i=0 m = m = Expected umber of boxes for coupo m + 1 Summig over all steps gives 1 i=0 i Aalyze the followig game: = ) l +1 ) sides o each die, umbered 1 through Roll dice oe at a time Keep a die oly if its umber > umbers o dice you already have a What is the expected umber of rolls icludig those ot kept) to get a die umbered? i=0 ) 1 i = = 1) =
14 b What umber of dice do you expect mathematically) to keep? 14 Keep goig util a is ecoutered Repeats of a umber are discarded Results i hirig problem H l +1) Suppose a gamblig game ivolves a sequece of rolls from a stadard six-sided die A player wis 1 whe the value rolled is the same as the previous roll If a sequece has 1201 rolls, what is the expected amout paid out? Probability of a roll payig 1 = 1/6 1200/6 = 200 Suppose a gamblig game ivolves a sequece of rolls from a stadard six-sided die A player wis 1 whe the value rolled is larger tha the previous roll If a sequece has 1201 rolls, what is the expected amout paid out? Payout for ext roll = 1 6 Expected payout after roll of i 6 i=1 1200*5/12 = 500 ) = = = 5 12 Suppose a gamblig game ivolves a sequece of rolls from a stadard six-sided die A player wis k dollars whe the value k rolled is smaller tha the previous roll If a sequece has 601 rolls, what is the expected amout paid out? ) = = *35/36 = Suppose a gamblig game ivolves a sequece of rolls from a stadard six-sided die What is the expected umber of rolls util the first pair of cosecutive sixes appears? Expected rolls to get first six = 6 = i=0 ) i = = ) * * ) Probability that ext roll is ot a six = 5 6
15 Expected rolls for cosecutive sixes = 6 +1 k=0 ) ) 5 6 k = 6 +1) = Also, see: ad alog with the book by Gristead Sell ), especially the first four chapters ad Example 46 o p 136, ) GENERATING RANDOM PERMUTATIONS PERMUTE-BY-SORTING p 125, skim) Geerates radoms i 1 3 ad the sorts to get permutatio i Θ log ) time Ca use radix/coutig sort CSE 2320 Notes 8) to perform i Θ) time RANDOMIZE-IN-PLACE Array A must iitially cotai a permutatio Could simply be idetity permutatio: A[i] = i for i=1 to swap A[i] ad A[RANDOMi,)] Code is equivalet to reachig i a bag ad choosig a umber to lock ito each slot Uiform - all! permutatios are equally likely to occur Problem 53-3 PERMUTE-WITH-ALL for i=1 to swap A[i] ad A[RANDOM1,)] Produces outcomes, but! does ot divide ito evely Not uiform - some permutatios are produced more ofte tha others Assume =3 ad A iitially cotais idetity permutatio RANDOM choices that give each permutatio 1 2 3: : : : : :
16 RANDOMIZED ALGORITHMS 16 Las Vegas Output is always correct Time varies depedig o radom choices or radomess i iput) Challege: Determie expected time Classic Examples: Radomized pivot) quicksort takes expected time i Θ log) Uiversal hashig This Semester: Treaps Perfect Hashig Smallest Eclosig Disk Rabi-Karp Text Search Asides: Mote Carlo Etheret: List Rakig - Shared Memory ad Distributed Versios Correct solutio with some large) probability Use repetitio to improve odds Usually has oe-sided error - oe of the outcomes ca be wrog Example - testig primality without factorig To check N for beig prime: Radomly geerate some a with 1 < a < N ) If N moda = 0, the report composite else report prime Oe-sided error - prime could be wrog Several observatios from umber theory are eeded to make this robust for avoidig Carmichael umbers) Cocept: Repeated applicatio of Mote Carlo techique ca lead to: Improved reliability Las Vegas algorithm that gives correct result with high probability
Data Structures and Algorithm. Xiaoqing Zheng
Data Structures ad Algorithm Xiaoqig Zheg zhegxq@fudaeduc What are algorithms? A sequece of computatioal steps that trasform the iput ito the output Sortig problem: Iput: A sequece of umbers
More informationModel of Computation and Runtime Analysis
Model of Computatio ad Rutime Aalysis Model of Computatio Model of Computatio Specifies Set of operatios Cost of operatios (ot ecessarily time) Examples Turig Machie Radom Access Machie (RAM) PRAM Map
More informationThis Lecture. Divide and Conquer. Merge Sort: Algorithm. Merge Sort Algorithm. MergeSort (Example) - 1. MergeSort (Example) - 2
This Lecture Divide-ad-coquer techique for algorithm desig. Example the merge sort. Writig ad solvig recurreces Divide ad Coquer Divide-ad-coquer method for algorithm desig: Divide: If the iput size is
More informationModel of Computation and Runtime Analysis
Model of Computatio ad Rutime Aalysis Model of Computatio Model of Computatio Specifies Set of operatios Cost of operatios (ot ecessarily time) Examples Turig Machie Radom Access Machie (RAM) PRAM Map
More informationCS / MCS 401 Homework 3 grader solutions
CS / MCS 401 Homework 3 grader solutios assigmet due July 6, 016 writte by Jāis Lazovskis maximum poits: 33 Some questios from CLRS. Questios marked with a asterisk were ot graded. 1 Use the defiitio of
More informationCS 332: Algorithms. Linear-Time Sorting. Order statistics. Slide credit: David Luebke (Virginia)
1 CS 332: Algorithms Liear-Time Sortig. Order statistics. Slide credit: David Luebke (Virgiia) Quicksort: Partitio I Words Partitio(A, p, r): Select a elemet to act as the pivot (which?) Grow two regios,
More informationAnalysis of Algorithms -Quicksort-
Aalysis of Algorithms -- Adreas Ermedahl MRTC (Mälardales Real-Time Research Ceter) adreas.ermedahl@mdh.se Autum 2004 Proposed by C.A.R. Hoare i 962 Worst- case ruig time: Θ( 2 ) Expected ruig time: Θ(
More informationAlgorithms and Data Structures Lecture IV
Algorithms ad Data Structures Lecture IV Simoas Šalteis Aalborg Uiversity simas@cs.auc.dk September 5, 00 1 This Lecture Aalyzig the ruig time of recursive algorithms (such as divide-ad-coquer) Writig
More informationCOMP26120: More on the Complexity of Recursive Programs (2018/19) Lucas Cordeiro
COMP26120: More o the Complexity of Recursive Programs (2018/19) Lucas Cordeiro lucas.cordeiro@machester.ac.uk Divide-ad-Coquer (Recurrece) Textbook: Algorithm Desig ad Applicatios, Goodrich, Michael T.
More informationCS 270 Algorithms. Oliver Kullmann. Growth of Functions. Divide-and- Conquer Min-Max- Problem. Tutorial. Reading from CLRS for week 2
Geeral remarks Week 2 1 Divide ad First we cosider a importat tool for the aalysis of algorithms: Big-Oh. The we itroduce a importat algorithmic paradigm:. We coclude by presetig ad aalysig two examples.
More informationDesign and Analysis of Algorithms
Desig ad Aalysis of Algorithms CSE 53 Lecture 9 Media ad Order Statistics Juzhou Huag, Ph.D. Departmet of Computer Sciece ad Egieerig Dept. CSE, UT Arligto CSE53 Desig ad Aalysis of Algorithms Medias ad
More informationCS583 Lecture 02. Jana Kosecka. some materials here are based on E. Demaine, D. Luebke slides
CS583 Lecture 02 Jaa Kosecka some materials here are based o E. Demaie, D. Luebke slides Previously Sample algorithms Exact ruig time, pseudo-code Approximate ruig time Worst case aalysis Best case aalysis
More informationRandomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018)
Radomized Algorithms I, Sprig 08, Departmet of Computer Sciece, Uiversity of Helsiki Homework : Solutios Discussed Jauary 5, 08). Exercise.: Cosider the followig balls-ad-bi game. We start with oe black
More informationRecurrence Relations
Recurrece Relatios Aalysis of recursive algorithms, such as: it factorial (it ) { if (==0) retur ; else retur ( * factorial(-)); } Let t be the umber of multiplicatios eeded to calculate factorial(). The
More informationSequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018
CSE 353 Discrete Computatioal Structures Sprig 08 Sequeces, Mathematical Iductio, ad Recursio (Chapter 5, Epp) Note: some course slides adopted from publisher-provided material Overview May mathematical
More informationFundamental Algorithms
Fudametal Algorithms Chapter 2b: Recurreces Michael Bader Witer 2014/15 Chapter 2b: Recurreces, Witer 2014/15 1 Recurreces Defiitio A recurrece is a (i-equality that defies (or characterizes a fuctio i
More informationA recurrence equation is just a recursive function definition. It defines a function at one input in terms of its value on smaller inputs.
CS23 Algorithms Hadout #6 Prof Ly Turbak September 8, 200 Wellesley College RECURRENCES This hadout summarizes highlights of CLRS Chapter 4 ad Appedix A (CLR Chapters 3 & 4) Two-Step Strategy for Aalyzig
More informationAnalysis of Algorithms. Introduction. Contents
Itroductio The focus of this module is mathematical aspects of algorithms. Our mai focus is aalysis of algorithms, which meas evaluatig efficiecy of algorithms by aalytical ad mathematical methods. We
More informationDesign and Analysis of Algorithms
Desig ad Aalysis of Algorithms Probabilistic aalysis ad Radomized algorithms Referece: CLRS Chapter 5 Topics: Hirig problem Idicatio radom variables Radomized algorithms Huo Hogwei 1 The hirig problem
More informationThe Growth of Functions. Theoretical Supplement
The Growth of Fuctios Theoretical Supplemet The Triagle Iequality The triagle iequality is a algebraic tool that is ofte useful i maipulatig absolute values of fuctios. The triagle iequality says that
More informationData Structures Lecture 9
Fall 2017 Fag Yu Software Security Lab. Dept. Maagemet Iformatio Systems, Natioal Chegchi Uiversity Data Structures Lecture 9 Midterm o Dec. 7 (9:10-12:00am, 106) Lec 1-9, TextBook Ch1-8, 11,12 How to
More information( ) = p and P( i = b) = q.
MATH 540 Radom Walks Part 1 A radom walk X is special stochastic process that measures the height (or value) of a particle that radomly moves upward or dowward certai fixed amouts o each uit icremet of
More informationAlgorithm Analysis. Algorithms that are equally correct can vary in their utilization of computational resources
Algorithm Aalysis Algorithms that are equally correct ca vary i their utilizatio of computatioal resources time ad memory a slow program it is likely ot to be used a program that demads too much memory
More informationMath 113 Exam 3 Practice
Math Exam Practice Exam will cover.-.9. This sheet has three sectios. The first sectio will remid you about techiques ad formulas that you should kow. The secod gives a umber of practice questios for you
More information4.3 Growth Rates of Solutions to Recurrences
4.3. GROWTH RATES OF SOLUTIONS TO RECURRENCES 81 4.3 Growth Rates of Solutios to Recurreces 4.3.1 Divide ad Coquer Algorithms Oe of the most basic ad powerful algorithmic techiques is divide ad coquer.
More informationSums, products and sequences
Sums, products ad sequeces How to write log sums, e.g., 1+2+ (-1)+ cocisely? i=1 Sum otatio ( sum from 1 to ): i 3 = 1 + 2 + + If =3, i=1 i = 1+2+3=6. The ame ii does ot matter. Could use aother letter
More informationLecture 12: November 13, 2018
Mathematical Toolkit Autum 2018 Lecturer: Madhur Tulsiai Lecture 12: November 13, 2018 1 Radomized polyomial idetity testig We will use our kowledge of coditioal probability to prove the followig lemma,
More informationCS:3330 (Prof. Pemmaraju ): Assignment #1 Solutions. (b) For n = 3, we will have 3 men and 3 women with preferences as follows: m 1 : w 3 > w 1 > w 2
Shiyao Wag CS:3330 (Prof. Pemmaraju ): Assigmet #1 Solutios Problem 1 (a) Cosider iput with me m 1, m,..., m ad wome w 1, w,..., w with the followig prefereces: All me have the same prefereces for wome:
More informationHOMEWORK 2 SOLUTIONS
HOMEWORK SOLUTIONS CSE 55 RANDOMIZED AND APPROXIMATION ALGORITHMS 1. Questio 1. a) The larger the value of k is, the smaller the expected umber of days util we get all the coupos we eed. I fact if = k
More informationCIS 121 Data Structures and Algorithms with Java Spring Code Snippets and Recurrences Monday, February 4/Tuesday, February 5
CIS 11 Data Structures ad Algorithms with Java Sprig 019 Code Sippets ad Recurreces Moday, February 4/Tuesday, February 5 Learig Goals Practice provig asymptotic bouds with code sippets Practice solvig
More informationAn Introduction to Randomized Algorithms
A Itroductio to Radomized Algorithms The focus of this lecture is to study a radomized algorithm for quick sort, aalyze it usig probabilistic recurrece relatios, ad also provide more geeral tools for aalysis
More informationAdvanced Course of Algorithm Design and Analysis
Differet complexity measures Advaced Course of Algorithm Desig ad Aalysis Asymptotic complexity Big-Oh otatio Properties of O otatio Aalysis of simple algorithms A algorithm may may have differet executio
More informationRecursive Algorithms. Recurrences. Recursive Algorithms Analysis
Recursive Algorithms Recurreces Computer Sciece & Egieerig 35: Discrete Mathematics Christopher M Bourke cbourke@cseuledu A recursive algorithm is oe i which objects are defied i terms of other objects
More informationSECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES
SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES Read Sectio 1.5 (pages 5 9) Overview I Sectio 1.5 we lear to work with summatio otatio ad formulas. We will also itroduce a brief overview of sequeces,
More informationCSI 5163 (95.573) ALGORITHM ANALYSIS AND DESIGN
CSI 5163 (95.573) ALGORITHM ANALYSIS AND DESIGN CSI 5163 (95.5703) ALGORITHM ANALYSIS AND DESIGN (3 cr.) (T) Topics of curret iterest i the desig ad aalysis of computer algorithms for graphtheoretical
More informationClassification of problem & problem solving strategies. classification of time complexities (linear, logarithmic etc)
Classificatio of problem & problem solvig strategies classificatio of time complexities (liear, arithmic etc) Problem subdivisio Divide ad Coquer strategy. Asymptotic otatios, lower boud ad upper boud:
More informationOPTIMAL ALGORITHMS -- SUPPLEMENTAL NOTES
OPTIMAL ALGORITHMS -- SUPPLEMENTAL NOTES Peter M. Maurer Why Hashig is θ(). As i biary search, hashig assumes that keys are stored i a array which is idexed by a iteger. However, hashig attempts to bypass
More informationLecture 19: Convergence
Lecture 19: Covergece Asymptotic approach I statistical aalysis or iferece, a key to the success of fidig a good procedure is beig able to fid some momets ad/or distributios of various statistics. I may
More informationMatriculation number: You have 90 minutes to complete the exam of InformatikIIb. The following rules apply:
Departmet of Iformatics Prof. Dr. Michael Böhle Bizmühlestrasse 14 8050 Zurich Phoe: +41 44 635 4333 Email: boehle@ifi.uzh.ch AlgoDat Midterm1 Sprig 016 08.04.016 Name: Matriculatio umber: Advice You have
More informationINFINITE SEQUENCES AND SERIES
11 INFINITE SEQUENCES AND SERIES INFINITE SEQUENCES AND SERIES 11.4 The Compariso Tests I this sectio, we will lear: How to fid the value of a series by comparig it with a kow series. COMPARISON TESTS
More informationExamples: data compression, path-finding, game-playing, scheduling, bin packing
Algorithms - Basic Cocepts Algorithms so what is a algorithm, ayway? The dictioary defiitio: A algorithm is a well-defied computatioal procedure that takes iput ad produces output. This class will deal
More informationCS161 Handout 05 Summer 2013 July 10, 2013 Mathematical Terms and Identities
CS161 Hadout 05 Summer 2013 July 10, 2013 Mathematical Terms ad Idetities Thaks to Ady Nguye ad Julie Tibshirai for their advice o this hadout. This hadout covers mathematical otatio ad idetities that
More informationGenerating Functions II
Geeratig Fuctios II Misha Lavrov ARML Practice 5/4/2014 Warm-up problems 1. Solve the recursio a +1 = 2a, a 0 = 1 by usig commo sese. 2. Solve the recursio b +1 = 2b + 1, b 0 = 1 by usig commo sese ad
More informationInfinite Sequences and Series
Chapter 6 Ifiite Sequeces ad Series 6.1 Ifiite Sequeces 6.1.1 Elemetary Cocepts Simply speakig, a sequece is a ordered list of umbers writte: {a 1, a 2, a 3,...a, a +1,...} where the elemets a i represet
More informationCS161: Algorithm Design and Analysis Handout #10 Stanford University Wednesday, 10 February 2016
CS161: Algorithm Desig ad Aalysis Hadout #10 Staford Uiversity Wedesday, 10 February 2016 Lecture #11: Wedesday, 10 February 2016 Topics: Example midterm problems ad solutios from a log time ago Sprig
More informationTest One (Answer Key)
CS395/Ma395 (Sprig 2005) Test Oe Name: Page 1 Test Oe (Aswer Key) CS395/Ma395: Aalysis of Algorithms This is a closed book, closed otes, 70 miute examiatio. It is worth 100 poits. There are twelve (12)
More informationAlgorithms Design & Analysis. Divide & Conquer
Algorithms Desig & Aalysis Divide & Coquer Recap Direct-accessible table Hash tables Hash fuctios Uiversal hashig Perfect Hashig Ope addressig 2 Today s topics The divide-ad-coquer desig paradigm Revised
More information6.3 Testing Series With Positive Terms
6.3. TESTING SERIES WITH POSITIVE TERMS 307 6.3 Testig Series With Positive Terms 6.3. Review of what is kow up to ow I theory, testig a series a i for covergece amouts to fidig the i= sequece of partial
More informationThe Ratio Test. THEOREM 9.17 Ratio Test Let a n be a series with nonzero terms. 1. a. n converges absolutely if lim. n 1
460_0906.qxd //04 :8 PM Page 69 SECTION 9.6 The Ratio ad Root Tests 69 Sectio 9.6 EXPLORATION Writig a Series Oe of the followig coditios guaratees that a series will diverge, two coditios guaratee that
More informationFinal Review for MATH 3510
Fial Review for MATH 50 Calculatio 5 Give a fairly simple probability mass fuctio or probability desity fuctio of a radom variable, you should be able to compute the expected value ad variace of the variable
More information6.046 Recitation 5: Binary Search Trees Bill Thies, Fall 2004 Outline
6.046 Recitatio 5: Biary Search Trees Bill Thies, Fall 2004 Outlie My cotact iformatio: Bill Thies thies@mit.edu Office hours: Sat 1-3pm, 36-153 Recitatio website: http://cag.lcs.mit.edu/~thies/6.046/
More informationCS 332: Algorithms. Quicksort
CS 33: Aorithms Quicsort David Luebe //03 Homewor Assiged today, due ext Wedesday Will be o web page shortly after class Go over ow David Luebe //03 Review: Quicsort Sorts i place Sorts O( ) i the average
More informationMathematical Foundation. CSE 6331 Algorithms Steve Lai
Mathematical Foudatio CSE 6331 Algorithms Steve Lai Complexity of Algorithms Aalysis of algorithm: to predict the ruig time required by a algorithm. Elemetary operatios: arithmetic & boolea operatios:
More informationCS 330 Discussion - Probability
CS 330 Discussio - Probability March 24 2017 1 Fudametals of Probability 11 Radom Variables ad Evets A radom variable X is oe whose value is o-determiistic For example, suppose we flip a coi ad set X =
More informationIn number theory we will generally be working with integers, though occasionally fractions and irrationals will come into play.
Number Theory Math 5840 otes. Sectio 1: Axioms. I umber theory we will geerally be workig with itegers, though occasioally fractios ad irratioals will come ito play. Notatio: Z deotes the set of all itegers
More informationHashing and Amortization
Lecture Hashig ad Amortizatio Supplemetal readig i CLRS: Chapter ; Chapter 7 itro; Sectio 7.. Arrays ad Hashig Arrays are very useful. The items i a array are statically addressed, so that isertig, deletig,
More informationIntroduction to Algorithms 6.046J/18.401J LECTURE 3 Divide and conquer Binary search Powering a number Fibonacci numbers Matrix multiplication
Itroductio to Algorithms 6.046J/8.40J LECTURE 3 Divide ad coquer Biary search Powerig a umber Fiboacci umbers Matrix multiplicatio Strasse s algorithm VLSI tree layout Prof. Charles E. Leiserso The divide-ad-coquer
More informationECEN 655: Advanced Channel Coding Spring Lecture 7 02/04/14. Belief propagation is exact on tree-structured factor graphs.
ECEN 655: Advaced Chael Codig Sprig 014 Prof. Hery Pfister Lecture 7 0/04/14 Scribe: Megke Lia 1 4-Cycles i Gallager s Esemble What we already kow: Belief propagatio is exact o tree-structured factor graphs.
More informationCSE 4095/5095 Topics in Big Data Analytics Spring 2017; Homework 1 Solutions
CSE 09/09 Topics i ig Data Aalytics Sprig 2017; Homework 1 Solutios Note: Solutios to problems,, ad 6 are due to Marius Nicolae. 1. Cosider the followig algorithm: for i := 1 to α log e do Pick a radom
More informationProblems from 9th edition of Probability and Statistical Inference by Hogg, Tanis and Zimmerman:
Math 224 Fall 2017 Homework 4 Drew Armstrog Problems from 9th editio of Probability ad Statistical Iferece by Hogg, Tais ad Zimmerma: Sectio 2.3, Exercises 16(a,d),18. Sectio 2.4, Exercises 13, 14. Sectio
More informationLecture 3: Asymptotic Analysis + Recurrences
Lecture 3: Asymptotic Aalysis + Recurreces Data Structures ad Algorithms CSE 373 SU 18 BEN JONES 1 Warmup Write a model ad fid Big-O for (it i = 0; i < ; i++) { for (it j = 0; j < i; j++) { System.out.pritl(
More informationSignals & Systems Chapter3
Sigals & Systems Chapter3 1.2 Discrete-Time (D-T) Sigals Electroic systems do most of the processig of a sigal usig a computer. A computer ca t directly process a C-T sigal but istead eeds a stream of
More informationMathematics review for CSCI 303 Spring Department of Computer Science College of William & Mary Robert Michael Lewis
Mathematics review for CSCI 303 Sprig 019 Departmet of Computer Sciece College of William & Mary Robert Michael Lewis Copyright 018 019 Robert Michael Lewis Versio geerated: 13 : 00 Jauary 17, 019 Cotets
More informationAlgorithm Analysis. Chapter 3
Data Structures Dr Ahmed Rafat Abas Computer Sciece Dept, Faculty of Computer ad Iformatio, Zagazig Uiversity arabas@zu.edu.eg http://www.arsaliem.faculty.zu.edu.eg/ Algorithm Aalysis Chapter 3 3. Itroductio
More informationLecture 2: April 3, 2013
TTIC/CMSC 350 Mathematical Toolkit Sprig 203 Madhur Tulsiai Lecture 2: April 3, 203 Scribe: Shubhedu Trivedi Coi tosses cotiued We retur to the coi tossig example from the last lecture agai: Example. Give,
More informationSeries III. Chapter Alternating Series
Chapter 9 Series III With the exceptio of the Null Sequece Test, all the tests for series covergece ad divergece that we have cosidered so far have dealt oly with series of oegative terms. Series with
More informationBertrand s Postulate
Bertrad s Postulate Lola Thompso Ross Program July 3, 2009 Lola Thompso (Ross Program Bertrad s Postulate July 3, 2009 1 / 33 Bertrad s Postulate I ve said it oce ad I ll say it agai: There s always a
More informationCS166 Handout 02 Spring 2018 April 3, 2018 Mathematical Terms and Identities
CS166 Hadout 02 Sprig 2018 April 3, 2018 Mathematical Terms ad Idetities Thaks to Ady Nguye ad Julie Tibshirai for their advice o this hadout. This hadout covers mathematical otatio ad idetities that may
More informationAxioms of Measure Theory
MATH 532 Axioms of Measure Theory Dr. Neal, WKU I. The Space Throughout the course, we shall let X deote a geeric o-empty set. I geeral, we shall ot assume that ay algebraic structure exists o X so that
More informationThe Binomial Theorem
The Biomial Theorem Lecture 47 Sectio 9.7 Robb T. Koether Hampde-Sydey College Fri, Apr 8, 204 Robb T. Koether (Hampde-Sydey College The Biomial Theorem Fri, Apr 8, 204 / 25 Combiatios 2 Pascal s Triagle
More informationSolutions to Tutorial 5 (Week 6)
The Uiversity of Sydey School of Mathematics ad Statistics Solutios to Tutorial 5 (Wee 6 MATH2962: Real ad Complex Aalysis (Advaced Semester, 207 Web Page: http://www.maths.usyd.edu.au/u/ug/im/math2962/
More informationIt is always the case that unions, intersections, complements, and set differences are preserved by the inverse image of a function.
MATH 532 Measurable Fuctios Dr. Neal, WKU Throughout, let ( X, F, µ) be a measure space ad let (!, F, P ) deote the special case of a probability space. We shall ow begi to study real-valued fuctios defied
More informationMath 25 Solutions to practice problems
Math 5: Advaced Calculus UC Davis, Sprig 0 Math 5 Solutios to practice problems Questio For = 0,,, 3,... ad 0 k defie umbers C k C k =! k!( k)! (for k = 0 ad k = we defie C 0 = C = ). by = ( )... ( k +
More informationDepartment of Informatics Prof. Dr. Michael Böhlen Binzmühlestrasse Zurich Phone:
Departmet of Iformatics Prof. Dr. Michael Böhle Bizmühlestrasse 14 8050 Zurich Phoe: +41 44 635 4333 Email: boehle@ifi.uzh.ch Iformatik II Midterm1 Sprig 018 3.03.018 Advice You have 90 miutes to complete
More informationCHAPTER 10 INFINITE SEQUENCES AND SERIES
CHAPTER 10 INFINITE SEQUENCES AND SERIES 10.1 Sequeces 10.2 Ifiite Series 10.3 The Itegral Tests 10.4 Compariso Tests 10.5 The Ratio ad Root Tests 10.6 Alteratig Series: Absolute ad Coditioal Covergece
More informationCSE 20 Discrete Math. Perturbation method. Winter, February 23, Day 14
CSE 0 Discrete Math Witer, 00 February 3, Day 14 Summatios (portios from Cocrete Mathematics by Graham, Kuth, Patashik) Iductio Give: S = 0 k a k, d last term: Perturbatio method Rewrite S+1 by splittig
More informationFrequentist Inference
Frequetist Iferece The topics of the ext three sectios are useful applicatios of the Cetral Limit Theorem. Without kowig aythig about the uderlyig distributio of a sequece of radom variables {X i }, for
More informationSequences of Definite Integrals, Factorials and Double Factorials
47 6 Joural of Iteger Sequeces, Vol. 8 (5), Article 5.4.6 Sequeces of Defiite Itegrals, Factorials ad Double Factorials Thierry Daa-Picard Departmet of Applied Mathematics Jerusalem College of Techology
More informationZeros of Polynomials
Math 160 www.timetodare.com 4.5 4.6 Zeros of Polyomials I these sectios we will study polyomials algebraically. Most of our work will be cocered with fidig the solutios of polyomial equatios of ay degree
More informationTrial division, Pollard s p 1, Pollard s ρ, and Fermat s method. Christopher Koch 1. April 8, 2014
Iteger Divisio Algorithm ad Cogruece Iteger Trial divisio,,, ad with itegers mod Iverses mod Multiplicatio ad GCD Iteger Christopher Koch 1 1 Departmet of Computer Sciece ad Egieerig CSE489/589 Algorithms
More informationPRACTICE PROBLEMS FOR THE FINAL
PRACTICE PROBLEMS FOR THE FINAL Math 36Q Fall 25 Professor Hoh Below is a list of practice questios for the Fial Exam. I would suggest also goig over the practice problems ad exams for Exam ad Exam 2 to
More informationChapter 2 The Monte Carlo Method
Chapter 2 The Mote Carlo Method The Mote Carlo Method stads for a broad class of computatioal algorithms that rely o radom sampligs. It is ofte used i physical ad mathematical problems ad is most useful
More informationNUMERICAL METHODS FOR SOLVING EQUATIONS
Mathematics Revisio Guides Numerical Methods for Solvig Equatios Page 1 of 11 M.K. HOME TUITION Mathematics Revisio Guides Level: GCSE Higher Tier NUMERICAL METHODS FOR SOLVING EQUATIONS Versio:. Date:
More informationFind a formula for the exponential function whose graph is given , 1 2,16 1, 6
Math 4 Activity (Due by EOC Apr. ) Graph the followig epoetial fuctios by modifyig the graph of f. Fid the rage of each fuctio.. g. g. g 4. g. g 6. g Fid a formula for the epoetial fuctio whose graph is
More informationSorting Algorithms. Algorithms Kyuseok Shim SoEECS, SNU.
Sortig Algorithms Algorithms Kyuseo Shim SoEECS, SNU. Desigig Algorithms Icremetal approaches Divide-ad-Coquer approaches Dyamic programmig approaches Greedy approaches Radomized approaches You are ot
More information4.1 Sigma Notation and Riemann Sums
0 the itegral. Sigma Notatio ad Riema Sums Oe strategy for calculatig the area of a regio is to cut the regio ito simple shapes, calculate the area of each simple shape, ad the add these smaller areas
More informationAverage-Case Analysis of QuickSort
Average-Case Aalysis of QuickSort Comp 363 Fall Semester 003 October 3, 003 The purpose of this documet is to itroduce the idea of usig recurrece relatios to do average-case aalysis. The average-case ruig
More informationTopic 1 2: Sequences and Series. A sequence is an ordered list of numbers, e.g. 1, 2, 4, 8, 16, or
Topic : Sequeces ad Series A sequece is a ordered list of umbers, e.g.,,, 8, 6, or,,,.... A series is a sum of the terms of a sequece, e.g. + + + 8 + 6 + or... Sigma Notatio b The otatio f ( k) is shorthad
More informationCEE 522 Autumn Uncertainty Concepts for Geotechnical Engineering
CEE 5 Autum 005 Ucertaity Cocepts for Geotechical Egieerig Basic Termiology Set A set is a collectio of (mutually exclusive) objects or evets. The sample space is the (collectively exhaustive) collectio
More informationRecurrences: Methods and Examples
Reurrees: Methods ad Examples CSE 30 Algorithms ad Data Strutures Alexadra Stefa Uiversity of exas at Arligto Updated: 308 Summatios Review Review slides o Summatios Reurrees Reursive algorithms It may
More informationA Probabilistic Analysis of Quicksort
A Probabilistic Aalysis of Quicsort You are assumed to be familiar with Quicsort. I each iteratio this sortig algorithm chooses a pivot ad the, by performig comparisios with the pivot, splits the remaider
More informationCSE 202 Homework 1 Matthias Springer, A Yes, there does always exist a perfect matching without a strong instability.
CSE 0 Homework 1 Matthias Spriger, A9950078 1 Problem 1 Notatio a b meas that a is matched to b. a < b c meas that b likes c more tha a. Equality idicates a tie. Strog istability Yes, there does always
More informationNUMERICAL METHODS COURSEWORK INFORMAL NOTES ON NUMERICAL INTEGRATION COURSEWORK
NUMERICAL METHODS COURSEWORK INFORMAL NOTES ON NUMERICAL INTEGRATION COURSEWORK For this piece of coursework studets must use the methods for umerical itegratio they meet i the Numerical Methods module
More informationDesign and Analysis of ALGORITHM (Topic 2)
DR. Gatot F. Hertoo, MSc. Desig ad Aalysis of ALGORITHM (Topic 2) Algorithms + Data Structures = Programs Lessos Leared 1 Our Machie Model: Assumptios Geeric Radom Access Machie (RAM) Executes operatios
More informationChapter 6. Advanced Counting Techniques
Chapter 6 Advaced Coutig Techiques 6.: Recurrece Relatios Defiitio: A recurrece relatio for the sequece {a } is a equatio expressig a i terms of oe or more of the previous terms of the sequece: a,a2,a3,,a
More informationCOMP285 Midterm Exam Department of Mathematics
COMP85 Midterm Exam Departmet of Mathematics Fall 010/011 - November 8, 010 Name: Studet Number: Please fiish withi 90 miutes. All poits above 100 are cosidered as bous poit. You ca reach maximal 1 poits.
More informationConvergence of random variables. (telegram style notes) P.J.C. Spreij
Covergece of radom variables (telegram style otes).j.c. Spreij this versio: September 6, 2005 Itroductio As we kow, radom variables are by defiitio measurable fuctios o some uderlyig measurable space
More informationCSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo
Coutig Methods CSE 191, Class Note 05: Coutig Methods Computer Sci & Eg Dept SUNY Buffalo c Xi He (Uiversity at Buffalo CSE 191 Discrete Structures 1 / 48 Need for Coutig The problem of coutig the umber
More informationDiscrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22
CS 70 Discrete Mathematics for CS Sprig 2007 Luca Trevisa Lecture 22 Aother Importat Distributio The Geometric Distributio Questio: A biased coi with Heads probability p is tossed repeatedly util the first
More informationSequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence
Sequeces A sequece of umbers is a fuctio whose domai is the positive itegers. We ca see that the sequece 1, 1, 2, 2, 3, 3,... is a fuctio from the positive itegers whe we write the first sequece elemet
More information