SlideShare a Scribd company logo
Discrete Mathematics
Final Homework
Samet Öztoprak
2601140342
May 6, 2015
1) Find the number of vertices, the number of edges, and the degree of each vertex in the given
undirected graphs. Identify all isolated and pendant vertices.
a)
Tips:
An isolated vertex is a vertex with degree zero.
A leaf vertex (also pendant vertex) is a vertex with degree one.
The number of vertices, the number of edges
Numbers
Vertices 6
Edges 6
The degree of each vertex
Node Degree of the vertex
a 2
b 4
c 1
d 0
e 2
f 3
isolated vertices d
pendant vertices c
b)
The number of vertices, the number of edges
Numbers
Vertices 9
Edges 12
The degree of each vertex
Node Degree of the vertex
a 3
b 2
c 4
d 0
e 6
f 0
g 4
h 2
ı 3
isolated vertices d,f
pendant vertices There is no pendant vertices.
2) Which graphs shown in Figure have an Euler path?
Tip:
An Euler path is a path that uses every edge of a graph exactly once.
An Euler path starts and ends at different vertices.
A B
CD
A
B C D
EFG A B
C
DE
F
G
Euler Path : BDABC Euler Path : DEFGABCDFCGB Euler Path : there is no euler path.
3) Which of the simple graphs in have a Hamilton circuit or, if not, a Hamilton path?
Tips:
In Hamilton paths and Hamilton circuits, the game is to find paths and circuits that include every
vertex of the graph once and only once.
 A Hamilton path in a graph is a path that includes each vertex of the graph once and only
once.
 A Hamilton circuit is a circuit that includes each vertex of the graph once and only once. (At
the end, of course, the circuit must return to the starting vertex.)
Note that if a graph has a Hamilton circuit then it also has a Hamilton path.
A B
C
D
E
A B
CD
A B
CD E F
G
Hamilton circuit : BAEDCB Hamilton circuit : No Hamilton circuit : No
Hamilton path : BAEDCB Hamilton path : DCBA Hamilton path : No
4) Draw the given planar graphs without any crossings.
a) b)
Tips:
A graph is planar if it can be drawn in two-dimensional space with no two of its edges
crossing. Such a drawing of a planar graph is called a plane drawing.
A B
5) Determine whether the given graphs are planar. If so, draw it so that no edges cross.
a) b)
a) No,it is not a planar graph.
b) Yes.
F
E
D
A
C
B
6) Answer these questions about the rooted tree illustrated.
Question Answer
Which vertex is the root a
Which vertices are internal a,b,c,d,f,h,j,g,q,t
Which vertices are leaves e,g,i,k,l,m,n,o,p,r,s,u
Which vertices are children of j q,r
Which vertex is the parent of h c
Which vertices are siblings of o p
Which vertices are ancestors of m f,b,a
Which vertices are descendants of b e,f,l,m,n
i)Is it a full m-ary tree for some positive integer m
Definition:
The tree is called a full m -ary tree if every internal vertex has exactly m children.
Example : If m = 2, it is called a binary tree.
Accoring to definition f and d has 3 children therefore we can obviously say that
The tree is not full m-ary tree.
j)What is the level of each vertex of the rooted tree
Levels Vertex
Level 0 a
Level 1 b,c,d
Level 2 e,f,g,h,i,j,k
Level 3 l,m,n,o,p,q,r
Level 4 s,t
Level 5 u
7) Find the output of the given circuit.
Output = (xy)' + (z'+x)
x y z (xy)' + (z'+x)
0 0 0 1
1 0 0 1
0 1 0 1
1 1 0 1
0 0 1 1
1 0 1 1
0 1 1 1
1 1 1 1
8) Let G = (V, T, S, P) be the phrase-structure grammar with V = {0, 1,A,B, S}, T = {0, 1}
and set of productions P consisting of
S → 0A => 𝑆1 → 0A
S → 1A => 𝑆2 → 1A
A → 0B => 𝐴1 → 0B
B → 1A => 𝐵1 → 1A
B → 1. => 𝐵2 → 1.
a) Show that 10101 belongs to the language generated by G.
𝑆2 1A
𝐴1 10B
𝐵1 101A
𝐴1 1010B
𝐵2 10101
10101 belongs to the language.
b) Show that 10110 does not belong to the language generated by G.
𝑆2 1A
𝐴1 10B
𝐵1 101A
There is no production A that will produce 1.
Therefore, 10110 in not in the language of G.
c) What is the language generated by G?
This means that the language is (0+1)01(01)∗.
9) Determine whether the string 01001 is in each of these sets.
a) {0, 1}*
{0,1}* is the set that contains all bit strings
Therefore ,01001 is in {0,1}*,
b) {0}*{10}{1}*
{0}*{10}{1}* is the set that allows consecutive 0s only beginnig of the string.
Therefore ,01001 is not in {0}*{10}{1}*,
c) {010}* {0}* {1}
01001 is equvalent to {010}* {0}* {1}
Therefore ,01001 is in {010}* {0}* {1}
d) {010, 011} {00, 01}
01001 is equvalent to {010}{01}
Therefore ,01001 is in {010, 011} {00, 01}
e) {00} {0}*{01}
{00} {0}*{01} is the set that requires the string to start with 00
Therefore ,01001 is not in {00} {0}*{01}
f ) {01}*{01}*
{01}*{01}* is the set that requires the string two 0s
Therefore ,01001 is not in {01}*{01}*
10) Find the language recognized by the given deterministic finite-state automaton.
We have two final states: s1.
State s1 can be reached using {1} and we stay in s1 as long as we have 0 or 1 as input.
Therefore language recognized by s1 is {1}{0,1}*
State s1 can be reached using {0}{1}*{0}{0,1}*
L(r) = { λ,1(0,1)*,01*0(0,1)*}
11) Describe inwords the strings in each of these regular sets.
a) 001*
b) (01)*
c) 01 ∪ 001*
d) 0(11 ∪ 0)*
e) (101*)*
f ) (0*∪1)11
Tips:
∅ represents the empty set, that is, the set with no strings;
λ represents the set {λ}, which is the set containing the empty string;
x represents the set {x} containing the string with one symbol x;
(AB) represents the concatenation of the sets represented by A and by B;
(A ∪ B) represents the union of the sets represented by A and by B;
A* represents the Kleene closure of the set represented by A.
a) Any number start by 00 followed by any number of 1s (including no ones)
b) Any number of copies of 01 (including the null string)
c) The string is 01 or the number start by 00 followed by any number of 1s
d) Any string start by 0 followed by any number of 11 or 0 (including empty)
e) λ or any number of copies of 10 followed by any number of 1s
f) Any number start by 1 or any number of copies of 0 that ends with 11

More Related Content

What's hot

Top 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must knowTop 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must know
AlexHenderson59
 
Microprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualMicroprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannual
yeshwant gadave
 
Module 4 exponential and logarithmic functions
Module 4   exponential and logarithmic functionsModule 4   exponential and logarithmic functions
Module 4 exponential and logarithmic functions
dionesioable
 
Lecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesLecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular Languages
Marina Santini
 
random variables-descriptive and contincuous
random variables-descriptive and contincuousrandom variables-descriptive and contincuous
random variables-descriptive and contincuous
ar9530
 
Logic gates
Logic gatesLogic gates
Logic gates
dawood0317
 
1.1 mean, variance and standard deviation
1.1 mean, variance and standard deviation1.1 mean, variance and standard deviation
1.1 mean, variance and standard deviation
ONE Virtual Services
 
Transformations of functions
Transformations of functionsTransformations of functions
Transformations of functions
Victoria Ball
 
KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)
mihir jain
 
DAA AND DAS
DAA AND DASDAA AND DAS
DAA AND DAS
Basavaraj Shetty
 
Worksheet
WorksheetWorksheet
Worksheet
JemycaComia
 
Finite State Machine.ppt.pptx
Finite State Machine.ppt.pptxFinite State Machine.ppt.pptx
Finite State Machine.ppt.pptx
SKUP1
 
Relations and functions worksheet
Relations and functions worksheetRelations and functions worksheet
Relations and functions worksheet
geet bajaj
 
Lesson 09
Lesson 09Lesson 09
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
SSE_AndyLi
 
Number Systems Basic Concepts
Number Systems Basic ConceptsNumber Systems Basic Concepts
Number Systems Basic Concepts
Laguna State Polytechnic University
 
Proposition
PropositionProposition
Proposition
rey castro
 
Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system CT Sabariah Salihin
 
Types of flip flops ppt
Types of flip flops pptTypes of flip flops ppt
Types of flip flops ppt
Viraj Shah
 

What's hot (20)

Top 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must knowTop 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must know
 
Microprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualMicroprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannual
 
Module 4 exponential and logarithmic functions
Module 4   exponential and logarithmic functionsModule 4   exponential and logarithmic functions
Module 4 exponential and logarithmic functions
 
Lecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesLecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular Languages
 
random variables-descriptive and contincuous
random variables-descriptive and contincuousrandom variables-descriptive and contincuous
random variables-descriptive and contincuous
 
Logic gates
Logic gatesLogic gates
Logic gates
 
1.1 mean, variance and standard deviation
1.1 mean, variance and standard deviation1.1 mean, variance and standard deviation
1.1 mean, variance and standard deviation
 
Transformations of functions
Transformations of functionsTransformations of functions
Transformations of functions
 
KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)
 
Relations and functions
Relations and functionsRelations and functions
Relations and functions
 
DAA AND DAS
DAA AND DASDAA AND DAS
DAA AND DAS
 
Worksheet
WorksheetWorksheet
Worksheet
 
Finite State Machine.ppt.pptx
Finite State Machine.ppt.pptxFinite State Machine.ppt.pptx
Finite State Machine.ppt.pptx
 
Relations and functions worksheet
Relations and functions worksheetRelations and functions worksheet
Relations and functions worksheet
 
Lesson 09
Lesson 09Lesson 09
Lesson 09
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
 
Number Systems Basic Concepts
Number Systems Basic ConceptsNumber Systems Basic Concepts
Number Systems Basic Concepts
 
Proposition
PropositionProposition
Proposition
 
Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system
 
Types of flip flops ppt
Types of flip flops pptTypes of flip flops ppt
Types of flip flops ppt
 

Viewers also liked

BBMP1103 - Sept 2011 exam workshop - part 4
BBMP1103 - Sept 2011 exam workshop - part 4BBMP1103 - Sept 2011 exam workshop - part 4
BBMP1103 - Sept 2011 exam workshop - part 4
Richard Ng
 
BBMP1103 - Sept 2011 exam workshop - part 5
BBMP1103 - Sept 2011 exam workshop - part 5BBMP1103 - Sept 2011 exam workshop - part 5
BBMP1103 - Sept 2011 exam workshop - part 5
Richard Ng
 
BBMP1103 - Sept 2011 exam workshop - part 9
BBMP1103 - Sept 2011 exam workshop - part 9BBMP1103 - Sept 2011 exam workshop - part 9
BBMP1103 - Sept 2011 exam workshop - part 9
Richard Ng
 
BBMP1103 - Sept 2011 exam workshop - part 8
BBMP1103 - Sept 2011 exam workshop - part 8BBMP1103 - Sept 2011 exam workshop - part 8
BBMP1103 - Sept 2011 exam workshop - part 8
Richard Ng
 
Discrete mathematic question answers
Discrete mathematic question answersDiscrete mathematic question answers
Discrete mathematic question answers
Samet öztoprak
 
MCQ Bank for Computer Fundamantals from mcqSets.com
MCQ Bank for Computer Fundamantals from mcqSets.comMCQ Bank for Computer Fundamantals from mcqSets.com
MCQ Bank for Computer Fundamantals from mcqSets.com
Suresh Khanal
 
Computer hardware concepts mcq paper
Computer hardware concepts mcq paperComputer hardware concepts mcq paper
Computer hardware concepts mcq paper
Suresh Khanal
 

Viewers also liked (7)

BBMP1103 - Sept 2011 exam workshop - part 4
BBMP1103 - Sept 2011 exam workshop - part 4BBMP1103 - Sept 2011 exam workshop - part 4
BBMP1103 - Sept 2011 exam workshop - part 4
 
BBMP1103 - Sept 2011 exam workshop - part 5
BBMP1103 - Sept 2011 exam workshop - part 5BBMP1103 - Sept 2011 exam workshop - part 5
BBMP1103 - Sept 2011 exam workshop - part 5
 
BBMP1103 - Sept 2011 exam workshop - part 9
BBMP1103 - Sept 2011 exam workshop - part 9BBMP1103 - Sept 2011 exam workshop - part 9
BBMP1103 - Sept 2011 exam workshop - part 9
 
BBMP1103 - Sept 2011 exam workshop - part 8
BBMP1103 - Sept 2011 exam workshop - part 8BBMP1103 - Sept 2011 exam workshop - part 8
BBMP1103 - Sept 2011 exam workshop - part 8
 
Discrete mathematic question answers
Discrete mathematic question answersDiscrete mathematic question answers
Discrete mathematic question answers
 
MCQ Bank for Computer Fundamantals from mcqSets.com
MCQ Bank for Computer Fundamantals from mcqSets.comMCQ Bank for Computer Fundamantals from mcqSets.com
MCQ Bank for Computer Fundamantals from mcqSets.com
 
Computer hardware concepts mcq paper
Computer hardware concepts mcq paperComputer hardware concepts mcq paper
Computer hardware concepts mcq paper
 

Similar to Discrete mathematic answers of questions

Nbhm m. a. and m.sc. scholarship test 2008
Nbhm m. a. and m.sc. scholarship test 2008Nbhm m. a. and m.sc. scholarship test 2008
Nbhm m. a. and m.sc. scholarship test 2008
MD Kutubuddin Sardar
 
Nbhm m. a. and m.sc. scholarship test 2005
Nbhm m. a. and m.sc. scholarship test 2005Nbhm m. a. and m.sc. scholarship test 2005
Nbhm m. a. and m.sc. scholarship test 2005
MD Kutubuddin Sardar
 
Imo2012 sl
Imo2012 slImo2012 sl
Imo2012 sl
Christos Loizos
 
Nbhm m. a. and m.sc. scholarship test 2006
Nbhm m. a. and m.sc. scholarship test 2006Nbhm m. a. and m.sc. scholarship test 2006
Nbhm m. a. and m.sc. scholarship test 2006
MD Kutubuddin Sardar
 
topologicalsort-using c++ as development language.pptx
topologicalsort-using c++ as development language.pptxtopologicalsort-using c++ as development language.pptx
topologicalsort-using c++ as development language.pptx
janafridi251
 
graph.pptx
graph.pptxgraph.pptx
graph.pptx
hijigaf
 
Nbhm m. a. and m.sc. scholarship test 2011
Nbhm m. a. and m.sc. scholarship test 2011Nbhm m. a. and m.sc. scholarship test 2011
Nbhm m. a. and m.sc. scholarship test 2011
MD Kutubuddin Sardar
 
Linear Algebra Assignment help
Linear Algebra Assignment helpLinear Algebra Assignment help
Linear Algebra Assignment help
Maths Assignment Help
 
Cs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer keyCs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer key
appasami
 
Cs6702 graph theory and applications Anna University question paper apr may 2...
Cs6702 graph theory and applications Anna University question paper apr may 2...Cs6702 graph theory and applications Anna University question paper apr may 2...
Cs6702 graph theory and applications Anna University question paper apr may 2...
appasami
 
Topological sort
Topological sortTopological sort
Topological sort
jabishah
 
Stochastic Processes Homework Help
Stochastic Processes Homework Help Stochastic Processes Homework Help
Stochastic Processes Homework Help
Statistics Assignment Help
 
Nbhm m. a. and m.sc. scholarship test 2012 with answer key
Nbhm m. a. and m.sc. scholarship test 2012 with answer keyNbhm m. a. and m.sc. scholarship test 2012 with answer key
Nbhm m. a. and m.sc. scholarship test 2012 with answer key
MD Kutubuddin Sardar
 
Nbhm m. a. and m.sc. scholarship test 2007
Nbhm m. a. and m.sc. scholarship test 2007 Nbhm m. a. and m.sc. scholarship test 2007
Nbhm m. a. and m.sc. scholarship test 2007
MD Kutubuddin Sardar
 
Nbhm m. a. and m.sc. scholarship test 2009
Nbhm m. a. and m.sc. scholarship test 2009Nbhm m. a. and m.sc. scholarship test 2009
Nbhm m. a. and m.sc. scholarship test 2009
MD Kutubuddin Sardar
 
GATE Mathematics Paper-2000
GATE Mathematics Paper-2000GATE Mathematics Paper-2000
GATE Mathematics Paper-2000
Dips Academy
 
Imo2009 sl
Imo2009 slImo2009 sl
Imo2009 sl
Christos Loizos
 

Similar to Discrete mathematic answers of questions (20)

Nbhm m. a. and m.sc. scholarship test 2008
Nbhm m. a. and m.sc. scholarship test 2008Nbhm m. a. and m.sc. scholarship test 2008
Nbhm m. a. and m.sc. scholarship test 2008
 
Nbhm m. a. and m.sc. scholarship test 2005
Nbhm m. a. and m.sc. scholarship test 2005Nbhm m. a. and m.sc. scholarship test 2005
Nbhm m. a. and m.sc. scholarship test 2005
 
Imo2012 sl
Imo2012 slImo2012 sl
Imo2012 sl
 
Imo 2012
Imo 2012 Imo 2012
Imo 2012
 
Nbhm m. a. and m.sc. scholarship test 2006
Nbhm m. a. and m.sc. scholarship test 2006Nbhm m. a. and m.sc. scholarship test 2006
Nbhm m. a. and m.sc. scholarship test 2006
 
topologicalsort-using c++ as development language.pptx
topologicalsort-using c++ as development language.pptxtopologicalsort-using c++ as development language.pptx
topologicalsort-using c++ as development language.pptx
 
graph.pptx
graph.pptxgraph.pptx
graph.pptx
 
Nbhm m. a. and m.sc. scholarship test 2011
Nbhm m. a. and m.sc. scholarship test 2011Nbhm m. a. and m.sc. scholarship test 2011
Nbhm m. a. and m.sc. scholarship test 2011
 
Linear Algebra Assignment help
Linear Algebra Assignment helpLinear Algebra Assignment help
Linear Algebra Assignment help
 
Cs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer keyCs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer key
 
Cs6702 graph theory and applications Anna University question paper apr may 2...
Cs6702 graph theory and applications Anna University question paper apr may 2...Cs6702 graph theory and applications Anna University question paper apr may 2...
Cs6702 graph theory and applications Anna University question paper apr may 2...
 
Topological sort
Topological sortTopological sort
Topological sort
 
Stochastic Processes Homework Help
Stochastic Processes Homework Help Stochastic Processes Homework Help
Stochastic Processes Homework Help
 
Nbhm m. a. and m.sc. scholarship test 2012 with answer key
Nbhm m. a. and m.sc. scholarship test 2012 with answer keyNbhm m. a. and m.sc. scholarship test 2012 with answer key
Nbhm m. a. and m.sc. scholarship test 2012 with answer key
 
Nbhm m. a. and m.sc. scholarship test 2007
Nbhm m. a. and m.sc. scholarship test 2007 Nbhm m. a. and m.sc. scholarship test 2007
Nbhm m. a. and m.sc. scholarship test 2007
 
Imo 2016
Imo 2016 Imo 2016
Imo 2016
 
Nbhm m. a. and m.sc. scholarship test 2009
Nbhm m. a. and m.sc. scholarship test 2009Nbhm m. a. and m.sc. scholarship test 2009
Nbhm m. a. and m.sc. scholarship test 2009
 
GATE Mathematics Paper-2000
GATE Mathematics Paper-2000GATE Mathematics Paper-2000
GATE Mathematics Paper-2000
 
Imo2009 sl
Imo2009 slImo2009 sl
Imo2009 sl
 
Imo2009
Imo2009 Imo2009
Imo2009
 

Discrete mathematic answers of questions

  • 1. Discrete Mathematics Final Homework Samet Öztoprak 2601140342 May 6, 2015 1) Find the number of vertices, the number of edges, and the degree of each vertex in the given undirected graphs. Identify all isolated and pendant vertices. a) Tips: An isolated vertex is a vertex with degree zero. A leaf vertex (also pendant vertex) is a vertex with degree one. The number of vertices, the number of edges Numbers Vertices 6 Edges 6 The degree of each vertex Node Degree of the vertex a 2 b 4 c 1 d 0 e 2 f 3 isolated vertices d pendant vertices c
  • 2. b) The number of vertices, the number of edges Numbers Vertices 9 Edges 12 The degree of each vertex Node Degree of the vertex a 3 b 2 c 4 d 0 e 6 f 0 g 4 h 2 ı 3 isolated vertices d,f pendant vertices There is no pendant vertices. 2) Which graphs shown in Figure have an Euler path? Tip: An Euler path is a path that uses every edge of a graph exactly once. An Euler path starts and ends at different vertices. A B CD A B C D EFG A B C DE F G Euler Path : BDABC Euler Path : DEFGABCDFCGB Euler Path : there is no euler path.
  • 3. 3) Which of the simple graphs in have a Hamilton circuit or, if not, a Hamilton path? Tips: In Hamilton paths and Hamilton circuits, the game is to find paths and circuits that include every vertex of the graph once and only once.  A Hamilton path in a graph is a path that includes each vertex of the graph once and only once.  A Hamilton circuit is a circuit that includes each vertex of the graph once and only once. (At the end, of course, the circuit must return to the starting vertex.) Note that if a graph has a Hamilton circuit then it also has a Hamilton path. A B C D E A B CD A B CD E F G Hamilton circuit : BAEDCB Hamilton circuit : No Hamilton circuit : No Hamilton path : BAEDCB Hamilton path : DCBA Hamilton path : No
  • 4. 4) Draw the given planar graphs without any crossings. a) b) Tips: A graph is planar if it can be drawn in two-dimensional space with no two of its edges crossing. Such a drawing of a planar graph is called a plane drawing. A B 5) Determine whether the given graphs are planar. If so, draw it so that no edges cross. a) b) a) No,it is not a planar graph. b) Yes. F E D A C B
  • 5. 6) Answer these questions about the rooted tree illustrated. Question Answer Which vertex is the root a Which vertices are internal a,b,c,d,f,h,j,g,q,t Which vertices are leaves e,g,i,k,l,m,n,o,p,r,s,u Which vertices are children of j q,r Which vertex is the parent of h c Which vertices are siblings of o p Which vertices are ancestors of m f,b,a Which vertices are descendants of b e,f,l,m,n i)Is it a full m-ary tree for some positive integer m Definition: The tree is called a full m -ary tree if every internal vertex has exactly m children. Example : If m = 2, it is called a binary tree. Accoring to definition f and d has 3 children therefore we can obviously say that The tree is not full m-ary tree. j)What is the level of each vertex of the rooted tree Levels Vertex Level 0 a Level 1 b,c,d Level 2 e,f,g,h,i,j,k Level 3 l,m,n,o,p,q,r Level 4 s,t Level 5 u
  • 6. 7) Find the output of the given circuit. Output = (xy)' + (z'+x) x y z (xy)' + (z'+x) 0 0 0 1 1 0 0 1 0 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 0 1 1 1 1 1 1 1 8) Let G = (V, T, S, P) be the phrase-structure grammar with V = {0, 1,A,B, S}, T = {0, 1} and set of productions P consisting of S → 0A => 𝑆1 → 0A S → 1A => 𝑆2 → 1A A → 0B => 𝐴1 → 0B B → 1A => 𝐵1 → 1A B → 1. => 𝐵2 → 1. a) Show that 10101 belongs to the language generated by G. 𝑆2 1A 𝐴1 10B 𝐵1 101A 𝐴1 1010B 𝐵2 10101 10101 belongs to the language. b) Show that 10110 does not belong to the language generated by G. 𝑆2 1A 𝐴1 10B 𝐵1 101A There is no production A that will produce 1. Therefore, 10110 in not in the language of G. c) What is the language generated by G? This means that the language is (0+1)01(01)∗.
  • 7. 9) Determine whether the string 01001 is in each of these sets. a) {0, 1}* {0,1}* is the set that contains all bit strings Therefore ,01001 is in {0,1}*, b) {0}*{10}{1}* {0}*{10}{1}* is the set that allows consecutive 0s only beginnig of the string. Therefore ,01001 is not in {0}*{10}{1}*, c) {010}* {0}* {1} 01001 is equvalent to {010}* {0}* {1} Therefore ,01001 is in {010}* {0}* {1} d) {010, 011} {00, 01} 01001 is equvalent to {010}{01} Therefore ,01001 is in {010, 011} {00, 01} e) {00} {0}*{01} {00} {0}*{01} is the set that requires the string to start with 00 Therefore ,01001 is not in {00} {0}*{01} f ) {01}*{01}* {01}*{01}* is the set that requires the string two 0s Therefore ,01001 is not in {01}*{01}* 10) Find the language recognized by the given deterministic finite-state automaton. We have two final states: s1. State s1 can be reached using {1} and we stay in s1 as long as we have 0 or 1 as input. Therefore language recognized by s1 is {1}{0,1}* State s1 can be reached using {0}{1}*{0}{0,1}* L(r) = { λ,1(0,1)*,01*0(0,1)*}
  • 8. 11) Describe inwords the strings in each of these regular sets. a) 001* b) (01)* c) 01 ∪ 001* d) 0(11 ∪ 0)* e) (101*)* f ) (0*∪1)11 Tips: ∅ represents the empty set, that is, the set with no strings; λ represents the set {λ}, which is the set containing the empty string; x represents the set {x} containing the string with one symbol x; (AB) represents the concatenation of the sets represented by A and by B; (A ∪ B) represents the union of the sets represented by A and by B; A* represents the Kleene closure of the set represented by A. a) Any number start by 00 followed by any number of 1s (including no ones) b) Any number of copies of 01 (including the null string) c) The string is 01 or the number start by 00 followed by any number of 1s d) Any string start by 0 followed by any number of 11 or 0 (including empty) e) λ or any number of copies of 10 followed by any number of 1s f) Any number start by 1 or any number of copies of 0 that ends with 11