MA 513: Data Structures Lecture Note Partha Sarathi Mandal

Size: px
Start display at page:

Download "MA 513: Data Structures Lecture Note Partha Sarathi Mandal"

Transcription

1 MA 513: Dt Structures Lecture Note Prth Srthi Mndl Dept. of Mthemtics, IIT Guwhti Tue 9:00-9:55 Wed 10:00-10:55 Thu 11:00-11:55 Clss Room : 1G2 MA514 Dt Structure L : Tue 14:00-16:55

2 Expression Trees It s inry tree. The leves of the expression tree re opernds. The other nodes re contin opertors. + - % A * * 4 / 2 D 5 C 5 (A ( (C / 5) * 2 ) ) + ( (D * 5) % 4 )

3 Tree Trversl Gol: visit every node of tree in-order trversl + - % A * * 4 / 2 D 5 C 5 void Node::inOrder () { if (left!= NULL) { cout << ( ; left->inorder(); cout << ) ; } cout << dt << endl; if (right!= NULL) right->inorder() } Output: A C / 5 * 2 + D * 5 % 4 To dismigute: print rckets

4 Tree Trversl (contd.) pre-order nd post-order: void Node::preOrder () { cout << dt << endl; if (left!= NULL) left->preorder (); if (right!= NULL) right->preorder (); } void Node::postOrder () { if (left!= NULL) left->preorder (); if (right!= NULL) right->preorder (); cout << dt << endl; } Output: + - A * / C 5 2 % * D % A * * 4 / 2 D 5 C 5 Output: A C 5 / 2 * - D 5 * 4 % +

5 Binry Tree Trversl Methods In trversl of inry tree, ech element of the inry tree is visited exctly once. During the visit of n element, ll ction (mke clone, disply, evlute the opertor, etc.) with respect to this element is tken.

6 Binry Tree Trversl Methods Preorder Inorder Postorder Level order

7 Preorder Trversl pulic sttic void preorder(binrytreenode t){ (t!= null){ visit(t); preorder(t.leftchild); preorder(t.rightchild); } }

8 Preorder Exmple (visit = print) c c

9 Preorder Exmple (visit = print) d e g h i f c j d g h e i c f j

10 Preorder Of Expression Tree / * e f c d / * + - c d + e f Gives prefix form of expression!

11 Inorder Trversl pulic sttic void inorder(binrytreenode t){ if (t!= null){ inorder(t.leftchild); visit(t); inorder(t.rightchild); } }

12 Inorder Exmple (visit = print) c c

13 Inorder Exmple (visit = print) d e g h i f c j g d h e i f j c

14 Inorder By Projection (Squishing) d e g h i f c j g d h e i f j c

15 Inorder Of Expression Tree / * e f c d + * c - d / e + f Gives infix form of expression (sns prentheses)!

16 Postorder Trversl pulic sttic void postorder(binrytreenode t){ (t!= null){ postorder(t.leftchild); postorder(t.rightchild); visit(t); } }

17 Postorder Exmple (visit = print) c c

18 Postorder Exmple (visit = print) d e g h i f c j g h d i e j f c

19 Postorder Of Expression Tree / * e f c d + c d - * e f + / Gives postfix form of expression!

20 Trversl Applictions d e g h i f c j Mke clone. Determine height. Determine numer of nodes.

21 Level Order Let t e the tree root. while (t!= null){ visit t nd put its children on FIFO queue; remove node from the FIFO queue nd cll it t; // remove returns null when queue is empty }

22 Level-Order Exmple (visit = print) d e g h i f c j c d e f g h i j

23 Binry Tree Construction Suppose tht the elements in inry tree re distinct. Cn you construct the inry tree from which given trversl sequence cme? When trversl sequence hs more thn one element, the inry tree is not uniquely defined. Therefore, the tree from which the sequence ws otined cnnot e reconstructed uniquely.

24 Some Exmples preorder = inorder = postorder = level order =

25 Binry Tree Construction Cn you construct the inry tree, given two trversl sequences? Depends on which two sequences re given.

26 Preorder And Postorder preorder = postorder = Preorder nd postorder do not uniquely define inry tree. Nor do preorder nd level order (sme exmple). Nor do postorder nd level order (sme exmple).

27 Inorder And Preorder inorder = g d h e i f j c preorder = d g h e i c f j Scn the preorder left to right using the inorder to seprte left nd right sutrees. is the root of the tree; gdhei re in the left sutree; fjc re in the right sutree. gdhei fjc

28 Inorder And Preorder gdhei fjc preorder = d g h e i c f j is the next root; gdh re in the left sutree; ei re in the right sutree. gdh ei fjc

29 Inorder And Preorder gdh preorder = d g h e i c f j fjc ei d is the next root; g is in the left sutree; h is in the right sutree. fjc d ei g h

30 Inorder And Postorder Scn postorder from right to left using inorder to seprte left nd right sutrees. inorder = g d h e i f j c postorder = g h d i e j f c Tree root is ; gdhei re in left sutree; fjc re in right sutree.

31 Inorder And Level Order Scn level order from left to right using inorder to seprte left nd right sutrees. inorder = g d h e i f j c level order = c d e f g h i j Tree root is ; gdhei re in left sutree; fjc re in right sutree.

Data Structures (INE2011)

Data Structures (INE2011) Dt Strutures (INE2011) Eletronis nd Communition Engineering Hnyng University Hewoon Nm Leture 7 INE2011 Dt Strutures 1 Binry Tree Trversl Mny inry tree opertions re done y perorming trversl o the inry

More information

COMP 250. Lecture 20. tree traversal. Oct. 25/26, 2017

COMP 250. Lecture 20. tree traversal. Oct. 25/26, 2017 COMP 250 Lecture 20 tree trversl Oct. 25/26, 2017 1 2 Tree Trversl How to visit (enumerte, iterte through, trverse ) ll the nodes of tree? 3 depthfirst (root){ // preorder if (root is not empty){ visit

More information

CMSC 132, Object-Oriented Programming II Summer Lecture 12

CMSC 132, Object-Oriented Programming II Summer Lecture 12 CMSC 132, Object-Oriented Programming II Summer 2016 Lecturer: Anwar Mamat Lecture 12 Disclaimer: These notes may be distributed outside this class only with the permission of the Instructor. 12.1 Trees

More information

n f(x i ) x. i=1 In section 4.2, we defined the definite integral of f from x = a to x = b as n f(x i ) x; f(x) dx = lim i=1

n f(x i ) x. i=1 In section 4.2, we defined the definite integral of f from x = a to x = b as n f(x i ) x; f(x) dx = lim i=1 The Fundmentl Theorem of Clculus As we continue to study the re problem, let s think bck to wht we know bout computing res of regions enclosed by curves. If we wnt to find the re of the region below the

More information

Uninformed Search Lecture 4

Uninformed Search Lecture 4 Lecture 4 Wht re common serch strtegies tht operte given only serch problem? How do they compre? 1 Agend A quick refresher DFS, BFS, ID-DFS, UCS Unifiction! 2 Serch Problem Formlism Defined vi the following

More information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

Worked out examples Finite Automata

Worked out examples Finite Automata Worked out exmples Finite Automt Exmple Design Finite Stte Automton which reds inry string nd ccepts only those tht end with. Since we re in the topic of Non Deterministic Finite Automt (NFA), we will

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

Reasoning and programming. Lecture 5: Invariants and Logic. Boolean expressions. Reasoning. Examples

Reasoning and programming. Lecture 5: Invariants and Logic. Boolean expressions. Reasoning. Examples Chir of Softwre Engineering Resoning nd progrmming Einführung in die Progrmmierung Introduction to Progrmming Prof. Dr. Bertrnd Meyer Octoer 2006 Ferury 2007 Lecture 5: Invrints nd Logic Logic is the sis

More information

Introduction to Group Theory

Introduction to Group Theory Introduction to Group Theory Let G be n rbitrry set of elements, typiclly denoted s, b, c,, tht is, let G = {, b, c, }. A binry opertion in G is rule tht ssocites with ech ordered pir (,b) of elements

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

I. Theory of Automata II. Theory of Formal Languages III. Theory of Turing Machines

I. Theory of Automata II. Theory of Formal Languages III. Theory of Turing Machines CI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 16: Non-Context-Free Lnguges Chpter 16: Non-Context-Free Lnguges I. Theory of utomt II. Theory of Forml Lnguges III. Theory of Turing Mchines

More information

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014 CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA

More information

5.2 Exponent Properties Involving Quotients

5.2 Exponent Properties Involving Quotients 5. Eponent Properties Involving Quotients Lerning Objectives Use the quotient of powers property. Use the power of quotient property. Simplify epressions involving quotient properties of eponents. Use

More information

Linear Inequalities. Work Sheet 1

Linear Inequalities. Work Sheet 1 Work Sheet 1 Liner Inequlities Rent--Hep, cr rentl compny,chrges $ 15 per week plus $ 0.0 per mile to rent one of their crs. Suppose you re limited y how much money you cn spend for the week : You cn spend

More information

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun: CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce

More information

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points:

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points: Eidgenössishe Tehnishe Hohshule Zürih Eole polytehnique fédérle de Zurih Politenio federle di Zurigo Federl Institute of Tehnology t Zurih Deprtement of Computer Siene. Novemer 0 Mrkus Püshel, Dvid Steurer

More information

INF2220: algorithms and data structures Series 1

INF2220: algorithms and data structures Series 1 Universitetet i Oslo Institutt for Informatikk I. Yu, D. Karabeg INF2220: algorithms and data structures Series 1 Topic Function growth & estimation of running time, trees (Exercises with hints for solution)

More information

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v. 1 Exercises Chpter 1 Exercise 1.1. Let Σ e n lphet. Prove wv = w + v for ll strings w nd v. Prove # (wv) = # (w)+# (v) for every symol Σ nd every string w,v Σ. Exercise 1.2. Let w 1,w 2,...,w k e k strings,

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)

More information

Review of Gaussian Quadrature method

Review of Gaussian Quadrature method Review of Gussin Qudrture method Nsser M. Asi Spring 006 compiled on Sundy Decemer 1, 017 t 09:1 PM 1 The prolem To find numericl vlue for the integrl of rel vlued function of rel vrile over specific rnge

More information

a n = 1 58 a n+1 1 = 57a n + 1 a n = 56(a n 1) 57 so 0 a n+1 1, and the required result is true, by induction.

a n = 1 58 a n+1 1 = 57a n + 1 a n = 56(a n 1) 57 so 0 a n+1 1, and the required result is true, by induction. MAS221(216-17) Exm Solutions 1. (i) A is () bounded bove if there exists K R so tht K for ll A ; (b) it is bounded below if there exists L R so tht L for ll A. e.g. the set { n; n N} is bounded bove (by

More information

In Linear Time from Regular Expressions to NFAs

In Linear Time from Regular Expressions to NFAs In Liner Time rom Regulr Expressions to NFAs e = ǫ ǫ ǫ ǫ e = e = ǫ ǫ e = ǫ ǫ e = ǫ ǫ ǫ Thompson s Algorithm Produces O(n) sttes or regulr expressions o length n Ken Thompson 27 / 282 Berry-Sethi Approch

More information

Free groups, Lecture 2, part 1

Free groups, Lecture 2, part 1 Free groups, Lecture 2, prt 1 Olg Khrlmpovich NYC, Sep. 2 1 / 22 Theorem Every sugroup H F of free group F is free. Given finite numer of genertors of H we cn compute its sis. 2 / 22 Schreir s grph The

More information

The Regulated and Riemann Integrals

The Regulated and Riemann Integrals Chpter 1 The Regulted nd Riemnn Integrls 1.1 Introduction We will consider severl different pproches to defining the definite integrl f(x) dx of function f(x). These definitions will ll ssign the sme vlue

More information

Believethatyoucandoitandyouar. Mathematics. ngascannotdoonlynotyetbelieve thatyoucandoitandyouarehalfw. Algebra

Believethatyoucandoitandyouar. Mathematics. ngascannotdoonlynotyetbelieve thatyoucandoitandyouarehalfw. Algebra Believethtoucndoitndour ehlfwtherethereisnosuchthi Mthemtics ngscnnotdoonlnotetbelieve thtoucndoitndourehlfw Alger therethereisnosuchthingsc nnotdoonlnotetbelievethto Stge 6 ucndoitndourehlfwther S Cooper

More information

Alignment of Long Sequences. BMI/CS Spring 2016 Anthony Gitter

Alignment of Long Sequences. BMI/CS Spring 2016 Anthony Gitter Alignment of Long Sequences BMI/CS 776 www.biostt.wisc.edu/bmi776/ Spring 2016 Anthony Gitter gitter@biostt.wisc.edu Gols for Lecture Key concepts how lrge-scle lignment differs from the simple cse the

More information

Connected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs

Connected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs Prm University, Mth. Deprtment Summry of lecture 9 Algorithms nd Dt Structures Disjoint sets Summry of this lecture: (CLR.1-3) Dt Structures for Disjoint sets: Union opertion Find opertion Mrco Pellegrini

More information

Section 4: Integration ECO4112F 2011

Section 4: Integration ECO4112F 2011 Reding: Ching Chpter Section : Integrtion ECOF Note: These notes do not fully cover the mteril in Ching, ut re ment to supplement your reding in Ching. Thus fr the optimistion you hve covered hs een sttic

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L

More information

I do slope intercept form With my shades on Martin-Gay, Developmental Mathematics

I do slope intercept form With my shades on Martin-Gay, Developmental Mathematics AAT-A Dte: 1//1 SWBAT simplify rdicls. Do Now: ACT Prep HW Requests: Pg 49 #17-45 odds Continue Vocb sheet In Clss: Complete Skills Prctice WS HW: Complete Worksheets For Wednesdy stmped pges Bring stmped

More information

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 7

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 7 CS 188 Introduction to Artificil Intelligence Fll 2018 Note 7 These lecture notes re hevily bsed on notes originlly written by Nikhil Shrm. Decision Networks In the third note, we lerned bout gme trees

More information

Data Structures and Algorithms CMPSC 465

Data Structures and Algorithms CMPSC 465 Dt Structures nd Algorithms CMPSC 465 LECTURE 10 Solving recurrences Mster theorem Adm Smith S. Rskhodnikov nd A. Smith; bsed on slides by E. Demine nd C. Leiserson Review questions Guess the solution

More information

CSCI FOUNDATIONS OF COMPUTER SCIENCE

CSCI FOUNDATIONS OF COMPUTER SCIENCE 1 CSCI- 2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2015 My 7, 2015 2 Announcements Homework 9 is due now. Some finl exm review problems will be posted on the web site tody. These re prcqce problems not

More information

DATA Search I 魏忠钰. 复旦大学大数据学院 School of Data Science, Fudan University. March 7 th, 2018

DATA Search I 魏忠钰. 复旦大学大数据学院 School of Data Science, Fudan University. March 7 th, 2018 DATA620006 魏忠钰 Serch I Mrch 7 th, 2018 Outline Serch Problems Uninformed Serch Depth-First Serch Bredth-First Serch Uniform-Cost Serch Rel world tsk - Pc-mn Serch problems A serch problem consists of:

More information

Algebra Readiness PLACEMENT 1 Fraction Basics 2 Percent Basics 3. Algebra Basics 9. CRS Algebra 1

Algebra Readiness PLACEMENT 1 Fraction Basics 2 Percent Basics 3. Algebra Basics 9. CRS Algebra 1 Algebr Rediness PLACEMENT Frction Bsics Percent Bsics Algebr Bsics CRS Algebr CRS - Algebr Comprehensive Pre-Post Assessment CRS - Algebr Comprehensive Midterm Assessment Algebr Bsics CRS - Algebr Quik-Piks

More information

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

19 Optimal behavior: Game theory

19 Optimal behavior: Game theory Intro. to Artificil Intelligence: Dle Schuurmns, Relu Ptrscu 1 19 Optiml behvior: Gme theory Adversril stte dynmics hve to ccount for worst cse Compute policy π : S A tht mximizes minimum rewrd Let S (,

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 2013 Outline 1 Riemnn Sums 2 Riemnn Integrls 3 Properties

More information

E 1 (n) = E 0 (n-1) E 0 (n) = E 0 (n-1)+e 0 (n-2) T(n -1)=2E 0 (n-2) + E 0 (n-3)

E 1 (n) = E 0 (n-1) E 0 (n) = E 0 (n-1)+e 0 (n-2) T(n -1)=2E 0 (n-2) + E 0 (n-3) cs3102: Theory of Computtion Clss 5: Non-Regulr PS1, Prolem 8 Menu Non-regulr lnguges Spring 2010 University of Virgini Dvid Evns PS1 Generl Comments Proofs re for mking convincing rguments, not for ofusction.

More information

Solution for Assignment 1 : Intro to Probability and Statistics, PAC learning

Solution for Assignment 1 : Intro to Probability and Statistics, PAC learning Solution for Assignment 1 : Intro to Probbility nd Sttistics, PAC lerning 10-701/15-781: Mchine Lerning (Fll 004) Due: Sept. 30th 004, Thursdy, Strt of clss Question 1. Bsic Probbility ( 18 pts) 1.1 (

More information

MATH FIELD DAY Contestants Insructions Team Essay. 1. Your team has forty minutes to answer this set of questions.

MATH FIELD DAY Contestants Insructions Team Essay. 1. Your team has forty minutes to answer this set of questions. MATH FIELD DAY 2012 Contestnts Insructions Tem Essy 1. Your tem hs forty minutes to nswer this set of questions. 2. All nswers must be justified with complete explntions. Your nswers should be cler, grmmticlly

More information

The Fundamental Theorem of Calculus. The Total Change Theorem and the Area Under a Curve.

The Fundamental Theorem of Calculus. The Total Change Theorem and the Area Under a Curve. Clculus Li Vs The Fundmentl Theorem of Clculus. The Totl Chnge Theorem nd the Are Under Curve. Recll the following fct from Clculus course. If continuous function f(x) represents the rte of chnge of F

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

Coalgebra, Lecture 15: Equations for Deterministic Automata Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 203 Outline Riemnn Sums Riemnn Integrls Properties Abstrct

More information

Name Ima Sample ASU ID

Name Ima Sample ASU ID Nme Im Smple ASU ID 2468024680 CSE 355 Test 1, Fll 2016 30 Septemer 2016, 8:35-9:25.m., LSA 191 Regrding of Midterms If you elieve tht your grde hs not een dded up correctly, return the entire pper to

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) Anton Setzer (Bsed on book drft by J. V. Tucker nd K. Stephenson)

More information

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh Lnguges nd Automt Finite Automt Informtics 2A: Lecture 3 John Longley School of Informtics University of Edinburgh jrl@inf.ed.c.uk 22 September 2017 1 / 30 Lnguges nd Automt 1 Lnguges nd Automt Wht is

More information

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1 CS4 45- Determinisitic Finite Automt -: Genertors vs. Checkers Regulr expressions re one wy to specify forml lnguge String Genertor Genertes strings in the lnguge Deterministic Finite Automt (DFA) re nother

More information

Finite Automata-cont d

Finite Automata-cont d Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww

More information

INF1383 -Bancos de Dados

INF1383 -Bancos de Dados 3//0 INF383 -ncos de Ddos Prof. Sérgio Lifschitz DI PUC-Rio Eng. Computção, Sistems de Informção e Ciênci d Computção LGER RELCIONL lguns slides sedos ou modificdos dos originis em Elmsri nd Nvthe, Fundmentls

More information

Answers and Solutions to (Some Even Numbered) Suggested Exercises in Chapter 11 of Grimaldi s Discrete and Combinatorial Mathematics

Answers and Solutions to (Some Even Numbered) Suggested Exercises in Chapter 11 of Grimaldi s Discrete and Combinatorial Mathematics Answers n Solutions to (Some Even Numere) Suggeste Exercises in Chpter 11 o Grimli s Discrete n Comintoril Mthemtics Section 11.1 11.1.4. κ(g) = 2. Let V e = {v : v hs even numer o 1 s} n V o = {v : v

More information

Chapter 2 Finite Automata

Chapter 2 Finite Automata Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht

More information

CSC 473 Automata, Grammars & Languages 11/9/10

CSC 473 Automata, Grammars & Languages 11/9/10 CSC 473 utomt, Grmmrs & Lnguges 11/9/10 utomt, Grmmrs nd Lnguges Discourse 06 Decidbility nd Undecidbility Decidble Problems for Regulr Lnguges Theorem 4.1: (embership/cceptnce Prob. for DFs) = {, w is

More information

More on automata. Michael George. March 24 April 7, 2014

More on automata. Michael George. March 24 April 7, 2014 More on utomt Michel George Mrch 24 April 7, 2014 1 Automt constructions Now tht we hve forml model of mchine, it is useful to mke some generl constructions. 1.1 DFA Union / Product construction Suppose

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

1.4 Nonregular Languages

1.4 Nonregular Languages 74 1.4 Nonregulr Lnguges The number of forml lnguges over ny lphbet (= decision/recognition problems) is uncountble On the other hnd, the number of regulr expressions (= strings) is countble Hence, ll

More information

Data Structures and Algorithms Winter Semester

Data Structures and Algorithms Winter Semester Page 0 German University in Cairo December 26, 2015 Media Engineering and Technology Faculty Prof. Dr. Slim Abdennadher Dr. Wael Abouelsadaat Data Structures and Algorithms Winter Semester 2015-2016 Final

More information

1 Error Analysis of Simple Rules for Numerical Integration

1 Error Analysis of Simple Rules for Numerical Integration cs41: introduction to numericl nlysis 11/16/10 Lecture 19: Numericl Integrtion II Instructor: Professor Amos Ron Scries: Mrk Cowlishw, Nthnel Fillmore 1 Error Anlysis of Simple Rules for Numericl Integrtion

More information

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS. THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS RADON ROSBOROUGH https://intuitiveexplntionscom/picrd-lindelof-theorem/ This document is proof of the existence-uniqueness theorem

More information

CS 314 Principles of Programming Languages

CS 314 Principles of Programming Languages C 314 Principles of Progrmming Lnguges Lecture 6: LL(1) Prsing Zheng (Eddy) Zhng Rutgers University Ferury 5, 2018 Clss Informtion Homework 2 due tomorrow. Homework 3 will e posted erly next week. 2 Top

More information

XPath Node Selection over Grammar-Compressed Trees

XPath Node Selection over Grammar-Compressed Trees XPth Node Selection over Grmmr-Compressed Trees Sebstin Mneth University of Edinburgh with Tom Sebstin (INRIA Lille) XPth Node Selection Given: XPth query Q nd tree T Question: wc-time to evlute Q over

More information

Chapter 9 Definite Integrals

Chapter 9 Definite Integrals Chpter 9 Definite Integrls In the previous chpter we found how to tke n ntiderivtive nd investigted the indefinite integrl. In this chpter the connection etween ntiderivtives nd definite integrls is estlished

More information

Symbolic enumeration methods for unlabelled structures

Symbolic enumeration methods for unlabelled structures Go & Šjn, Comintoril Enumertion Notes 4 Symolic enumertion methods for unlelled structures Definition A comintoril clss is finite or denumerle set on which size function is defined, stisfying the following

More information

We partition C into n small arcs by forming a partition of [a, b] by picking s i as follows: a = s 0 < s 1 < < s n = b.

We partition C into n small arcs by forming a partition of [a, b] by picking s i as follows: a = s 0 < s 1 < < s n = b. Mth 255 - Vector lculus II Notes 4.2 Pth nd Line Integrls We begin with discussion of pth integrls (the book clls them sclr line integrls). We will do this for function of two vribles, but these ides cn

More information

Introduction to Electronic Circuits. DC Circuit Analysis: Transient Response of RC Circuits

Introduction to Electronic Circuits. DC Circuit Analysis: Transient Response of RC Circuits Introduction to Electronic ircuits D ircuit Anlysis: Trnsient esponse of ircuits Up until this point, we hve een looking t the Stedy Stte response of D circuits. StedyStte implies tht nothing hs chnged

More information

CS 188: Artificial Intelligence Spring 2007

CS 188: Artificial Intelligence Spring 2007 CS 188: Artificil Intelligence Spring 2007 Lecture 3: Queue-Bsed Serch 1/23/2007 Srini Nrynn UC Berkeley Mny slides over the course dpted from Dn Klein, Sturt Russell or Andrew Moore Announcements Assignment

More information

Lecture 3: Equivalence Relations

Lecture 3: Equivalence Relations Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts

More information

Fast Boolean Algebra

Fast Boolean Algebra Fst Boolen Alger ELEC 267 notes with the overurden removed A fst wy to lern enough to get the prel done honorly Printed; 3//5 Slide Modified; Jnury 3, 25 John Knight Digitl Circuits p. Fst Boolen Alger

More information

Math 4310 Solutions to homework 1 Due 9/1/16

Math 4310 Solutions to homework 1 Due 9/1/16 Mth 4310 Solutions to homework 1 Due 9/1/16 1. Use the Eucliden lgorithm to find the following gretest common divisors. () gcd(252, 180) = 36 (b) gcd(513, 187) = 1 (c) gcd(7684, 4148) = 68 252 = 180 1

More information

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar)

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar) Lecture 3 (5.3.2018) (trnslted nd slightly dpted from lecture notes by Mrtin Klzr) Riemnn integrl Now we define precisely the concept of the re, in prticulr, the re of figure U(, b, f) under the grph of

More information

Lecture 9: LTL and Büchi Automata

Lecture 9: LTL and Büchi Automata Lecture 9: LTL nd Büchi Automt 1 LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled

More information

Results on Planar Near Rings

Results on Planar Near Rings Interntionl Mthemticl Forum, Vol. 9, 2014, no. 23, 1139-1147 HIKARI Ltd, www.m-hikri.com http://dx.doi.org/10.12988/imf.2014.4593 Results on Plnr Ner Rings Edurd Domi Deprtment of Mthemtics, University

More information

Section 3.2: Negative Exponents

Section 3.2: Negative Exponents Section 3.2: Negtive Exponents Objective: Simplify expressions with negtive exponents using the properties of exponents. There re few specil exponent properties tht del with exponents tht re not positive.

More information

Overview of Today s Lecture:

Overview of Today s Lecture: CPS 4 Computer Orgniztion nd Progrmming Lecture : Boolen Alger & gtes. Roert Wgner CPS4 BA. RW Fll 2 Overview of Tody s Lecture: Truth tles, Boolen functions, Gtes nd Circuits Krnugh mps for simplifying

More information

N 0 completions on partial matrices

N 0 completions on partial matrices N 0 completions on prtil mtrices C. Jordán C. Mendes Arújo Jun R. Torregros Instituto de Mtemátic Multidisciplinr / Centro de Mtemátic Universidd Politécnic de Vlenci / Universidde do Minho Cmino de Ver

More information

Module 2. Analysis of Statically Indeterminate Structures by the Matrix Force Method. Version 2 CE IIT, Kharagpur

Module 2. Analysis of Statically Indeterminate Structures by the Matrix Force Method. Version 2 CE IIT, Kharagpur Module Anlysis of Stticlly Indeterminte Structures by the Mtrix Force Method Version CE IIT, Khrgpur esson 8 The Force Method of Anlysis: Bems Version CE IIT, Khrgpur Instructionl Objectives After reding

More information

Numerical Linear Algebra Assignment 008

Numerical Linear Algebra Assignment 008 Numericl Liner Algebr Assignment 008 Nguyen Qun B Hong Students t Fculty of Mth nd Computer Science, Ho Chi Minh University of Science, Vietnm emil. nguyenqunbhong@gmil.com blog. http://hongnguyenqunb.wordpress.com

More information

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010 CS 311 Homework 3 due 16:30, Thursdy, 14 th Octoer 2010 Homework must e sumitted on pper, in clss. Question 1. [15 pts.; 5 pts. ech] Drw stte digrms for NFAs recognizing the following lnguges:. L = {w

More information

Lecture 3 Gaussian Probability Distribution

Lecture 3 Gaussian Probability Distribution Introduction Lecture 3 Gussin Probbility Distribution Gussin probbility distribution is perhps the most used distribution in ll of science. lso clled bell shped curve or norml distribution Unlike the binomil

More information

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd

More information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design nd Anlysis LECTURE 12 Solving Recurrences Mster Theorem Adm Smith Review Question: Exponentition Problem: Compute b, where b N is n bits long. Question: How mny multiplictions? Nive lgorithm:

More information

Preview 11/1/2017. Greedy Algorithms. Coin Change. Coin Change. Coin Change. Coin Change. Greedy algorithms. Greedy Algorithms

Preview 11/1/2017. Greedy Algorithms. Coin Change. Coin Change. Coin Change. Coin Change. Greedy algorithms. Greedy Algorithms Preview Greed Algorithms Greed Algorithms Coin Chnge Huffmn Code Greed lgorithms end to e simple nd strightforwrd. Are often used to solve optimiztion prolems. Alws mke the choice tht looks est t the moment,

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

More information

Recursively Enumerable and Recursive. Languages

Recursively Enumerable and Recursive. Languages Recursively Enumerble nd Recursive nguges 1 Recll Definition (clss 19.pdf) Definition 10.4, inz, 6 th, pge 279 et S be set of strings. An enumertion procedure for Turing Mchine tht genertes ll strings

More information

Chapter 5 Plan-Space Planning

Chapter 5 Plan-Space Planning Lecture slides for Automted Plnning: Theory nd Prctice Chpter 5 Pln-Spce Plnning Dn S. Nu CMSC 722, AI Plnning University of Mrylnd, Spring 2008 1 Stte-Spce Plnning Motivtion g 1 1 g 4 4 s 0 g 5 5 g 2

More information

ENGI 3424 Engineering Mathematics Five Tutorial Examples of Partial Fractions

ENGI 3424 Engineering Mathematics Five Tutorial Examples of Partial Fractions ENGI 44 Engineering Mthemtics Five Tutoril Exmples o Prtil Frctions 1. Express x in prtil rctions: x 4 x 4 x 4 b x x x x Both denomintors re liner non-repeted ctors. The cover-up rule my be used: 4 4 4

More information

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018 CS 301 Lecture 04 Regulr Expressions Stephen Checkowy Jnury 29, 2018 1 / 35 Review from lst time NFA N = (Q, Σ, δ, q 0, F ) where δ Q Σ P (Q) mps stte nd n lphet symol (or ) to set of sttes We run n NFA

More information

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr

More information

Section 6: Area, Volume, and Average Value

Section 6: Area, Volume, and Average Value Chpter The Integrl Applied Clculus Section 6: Are, Volume, nd Averge Vlue Are We hve lredy used integrls to find the re etween the grph of function nd the horizontl xis. Integrls cn lso e used to find

More information

Riemann is the Mann! (But Lebesgue may besgue to differ.)

Riemann is the Mann! (But Lebesgue may besgue to differ.) Riemnn is the Mnn! (But Lebesgue my besgue to differ.) Leo Livshits My 2, 2008 1 For finite intervls in R We hve seen in clss tht every continuous function f : [, b] R hs the property tht for every ɛ >

More information

Faster Regular Expression Matching. Philip Bille Mikkel Thorup

Faster Regular Expression Matching. Philip Bille Mikkel Thorup Fster Regulr Expression Mtching Philip Bille Mikkel Thorup Outline Definition Applictions History tour of regulr expression mtching Thompson s lgorithm Myers lgorithm New lgorithm Results nd extensions

More information

Math& 152 Section Integration by Parts

Math& 152 Section Integration by Parts Mth& 5 Section 7. - Integrtion by Prts Integrtion by prts is rule tht trnsforms the integrl of the product of two functions into other (idelly simpler) integrls. Recll from Clculus I tht given two differentible

More information

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer Divisibility In this note we introduce the notion of divisibility for two integers nd b then we discuss the division lgorithm. First we give forml definition nd note some properties of the division opertion.

More information

Harvard University Computer Science 121 Midterm October 23, 2012

Harvard University Computer Science 121 Midterm October 23, 2012 Hrvrd University Computer Science 121 Midterm Octoer 23, 2012 This is closed-ook exmintion. You my use ny result from lecture, Sipser, prolem sets, or section, s long s you quote it clerly. The lphet is

More information

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014 CS125 Lecture 12 Fll 2014 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

More information

First Midterm Examination

First Midterm Examination Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does

More information

CS 360 Exam 2 Fall 2014 Name

CS 360 Exam 2 Fall 2014 Name CS 360 Exm 2 Fll 2014 Nme 1. The lsses shown elow efine singly-linke list n stk. Write three ifferent O(n)-time versions of the reverse_print metho s speifie elow. Eh version of the metho shoul output

More information

Minnesota State University, Mankato 44 th Annual High School Mathematics Contest April 12, 2017

Minnesota State University, Mankato 44 th Annual High School Mathematics Contest April 12, 2017 Minnesot Stte University, Mnkto 44 th Annul High School Mthemtics Contest April, 07. A 5 ft. ldder is plced ginst verticl wll of uilding. The foot of the ldder rests on the floor nd is 7 ft. from the wll.

More information