SlideShare a Scribd company logo
1 of 19
MATH203-1403A-02
Applications of Discrete
Mathematics
Phase-5 / IP 5
Mark L. Simon II
Instructor: Doris Schantz
August 08, 2014
Set Theory Revisited
• Look up a roulette wheel diagram. The following sets are definedA = the set of red numbers D = the set of even numbers
B = the set of black numbers E = the set of odd numbers
C = the set of green numbers F = {1,2,3,4,5,6,7,8,9,10,11,12}
For the purposes of this presentation, we will be using the American
Roulette Wheel as we are in America.
• The table of numbers to the right are for the American Roulette.
We will take from here to develop our sets.
• Red #’s “A” = {1, 3, 5, 7, 9, 12, 14, 16, 18, 21, 23, 25, 27, 28, 30, 32,
34, 36}
• Black #’s “B” = {2, 4, 6, 8, 10, 11, 13, 15, 17, 19, 20, 22, 24, 26, 29,
31, 33, 35}
• Green #’s “C” = {0, 00}
• Even #’s “D” = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30,
32, 34, 36}
• Odd #’s “E” = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 39, 31,
33, 35}
• Set “F” = {1,2,3,4,5,6,7,8,9,10,11,12}
Now that we a have assessed the determinant sets, we will
start assessing each of the below “U” – Unions and “∩” –
Intersections for each required configuration.
They are as follows :
• (A∪B) (A∩D) (B∩C) (C∪E) (B∩F) (E∩F)
{1, 3, 5, 7, 9, 12,
14, 16, 18, 21,
23, 25, 27, 28,
30, 32, 34, 36}
{2, 4, 6, 8, 10,
11, 13, 15, 17,
19, 20, 22, 24,
26, 29, 31, 33,
35
{1, 3, 5,
7, 9, 21,
23, 25, 27,}
{ 2, 4, 6, 8,
10, 20, 22,
24, 26, }
(A∩D) = {12, 14,16, 18, 28, 30, 32, 34,
36}
(A U B) = {1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24 25,26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36}
U U
A B
A D
Null
12, 14,16,
18,28,30,
32,34,36
2, 4, 6, 8, 10,
11, 13, 15, 17,
19, 20, 22, 24,
26, 29, 31, 33,
35
0, 00 0, 00
1, 3, 5, 7, 9,
11, 13, 15, 17,
19, 21, 23, 25,
27, 39, 31, 33,
35
(B∩C) = {Φ} (C ∪ E) = {0, 00, 1, 3, 5, 7, 9, 11,
13, 15, 17,
19, 21, 23, 25, 27, 39, 31, 33,
35}
U U
B C C E
NullNull
13, 15, 17,
19, 20, 22, 24,
26, 29, 31, 33,
35
1,3,5,
7,9,12
13, 15, 17,
19, 21, 23,
25, 27, 39,
31, 33, 35
2,4,6,
8,10,12
(B ∩ F) = {2, 4, 6, 8, 10, 11} (E∩F) = {1, 3, 5, 7, 9, 11}
U U
B F E F
1, 3, 5, 7,
9, 11,
2, 4, 6,
8, 10, 11
Part II: Relations, Functions, and Sequences
The implementation of the program that runs the game involves testing. One of the necessary
tests is to see if the simulated spins are random. Create an n-ary relation, in table form, that
depicts possible results of 10 trials of the game. Include the following results of the game:
Number
Color
Odd or even (note: 0 and 00 are considered neither even nor odd.)
Trial # (P/K] Number Color Odd or Even
1 6 Black Even
2 33 Black Odd
3 12 Red Even
4 16 Black Even
5 10 Red Even
6 25 Red Odd
7 4 Black Even
8 36 Red Even
9 11 Black Odd
10 27 Red Odd
11 32 Red Even
Part 4: Automata Theory, Grammars and Languages
INSTRUCTIONS
• A gate with three rotating arms at waist height is used to control access to a
subway in New York city. Initially, the arms of the gate are locked preventing
customers from passing through. Unlocking the arms requires depositing a token
in a slot, which allows the arms to rotate to a complete turn which allows one
customer to push through and enter. Once the customer passes through the arms
are then locked again until another customer deposits another token in the slot.
• The gate has two states: LOCKED and UNLOCKED. It also has two inputs: TOKEN
and PUSH. When the gate is locked, pushing the arm of the gate has no effect
regardless of how many times it is pushed. The input TOKEN changes the state
from LOCKED to UNLOCKED. When the gate is in the UNLOCKED state, inserting
additional tokens has no effect on the state. But when in the UNLOCKED state, a
PUSH input changes the state to LOCKED.
• (i). Provide a transition table showing each state, the inputs, and the resulting
new states for each input
• (ii). Represent your transition table into a digraph (transition diagram)
Part - 4: Automata Theory,
Grammars and Languages
START
STATE
INPUT NEXT STATE OUTPUT
LOCKED
TOKEN INSERTED UNLOCK Turn Stile OPEN
PUSH BAR LOCKED Turn Stile LOCKED
UNLOCK
TOKEN INSERTED UNLOCK Turn Stile LOCKED
PUSH LOCKED After Turn Stile
Pushed / Locked
• Provided is a transition table showing each state, the inputs, and the resulting
new states and output for each input
• Below is a representation of a transition table into a digraph (transition diagram)
LOCKED UN
LOCKEDPush Coin
Push
Coin
Part - 4: Automata Theory,
Grammars and Languages
• Here is a context-free grammar that can be used to generate algebraic
expressions via the arithmetic operators (addition, subtraction, multiplication,
and division), in the variables p, q, and r. The letter E stands for expression:
• Rule 1: E —› p
• Rule 2: E —› q
• Rule 3: E —› r
• Rule 4: E —› E + E
• Rule 5: E —› E – E
• Rule 6: E —› E X E
• Rule 7: E —› E/E
• Rule 8: E —›(E)
Use the above grammar to derive the string given by the mathematical expression E
= (p + q) X p – r X p/(q + q)
Grammars and Languages - Continued
E = (p + q) X p – r X p/(q + q)
 E ( the start symbol)
 E – E ( by rule 5, applied to the middle)
 E – E * E (by rule 6, applied to the rightmost E)
 (E) * E – E * E (by rule 6, applied to the leftmost E)
 (E) * E – E * E/(E) (By Rule 8, applied to the rightmost E)
 (E + E) * E – E * E/(E) (By Rule 4 of the leftmost E)
 (E + E) * E – E * E/(E + E) (By Rule 4 applied to the rightmost E)
 (p + E) * E – E * E/(E + E) ( by rule 1 , by the leftmost E )
 (p + q) * E – E * E/(E + E) ( by rule 2 , by the leftmost E )
 (p + q) * p – E * E/(E + E) ( by rule 1 , by the leftmost E )
 (p + q) * p – E * E/(E + q) ( by rule 2 , by the rightmost E )
 (p + q) * p – E * E/(q + q) ( by rule 2 , by the rightmost E )
 (p + q) * p – E * p/(q + q) ( by rule 1 , by the rightmost E )
 (p + q) * p – r * p/(q + q) ( by rule 3 , by the rightmost E )
Part - 4: Continued
Automata Theory, Grammars and Languages
E
/ | 
E - E
/ |  / | 
E * E E * E
/| | | /|
( E ) p r E / E
/| | /|
E + E p ( E )
| | /|
p q E + E
| |
q q
(E + E) * E – E * E/(E + E)
to
(p + q) * p – r * p/(q + q)
To the right is my attempt
to accomplish the sparse
tree configuration. As is
seen, the initial inner
variables break down
pretty easily, but the
outer configurations take
a little more break down
to accomplish the sparse
tree.
Part -V Algorithm (Sequential) Search
This algorithm finds an object “x” (number, string) from a
given set A where |A| = n.
Input: x, A, n
Output: index // location of x in set A
(array A)
seq_search(x, A, n)
{ i = 1
while (i <= n and x ~= A(i)) i = i + 1
if (i <= n) then index = i
else index = 0
return index
}
Algorithmic Sequential (Linear)
Search
Input: x = 19, A = {22, 21, 9, 4, 16, 2, 10, 14, 20, 31, 26, 19, 17, 28, 8, 13}, n = 16
It took 13 steps (same as n). It could have been as much as 16 and as little as 2. The
worst case seems to be n + 1 steps to find x.
Step 1: test: 1 < 16 and 19 ~= 22 true i = 2 Step 9: test:9 < 16 and 19 ~= 20 true I =10
Step 2: test: 2 < 16 and 19 ~= 21 true i = 3 Step 10: test: 10 < 16 and 19 ~= 31 true i = 11
Step 3: test: 3 < 16 and 19 ~= 9 true i = 4 Step 11: test: 11 < 16 and 19 ~= 26 true i = 12
Step 4: test: 4 < 16 and 19 ~= 4 true i = 5 Step 12: test: 12 < 16 and 19 ~= 19 false i = 13
Step 5: test: 5 < 16 and 19 ~= 16 true i = 6 Step 13: test: 12 < 16 true index = 19
Step 6: test: 6 < 16 and 19 ~= 2 true i = 7
Step 7: test: 7 < 16 and 19 ~= 10 true i = 8
Step 8: test: 8 < 16 and 19 ~= 14 true i = 9
This algorithm performs a binary search to find “x” in a
set – (A). The algorithm determines the location of “x”.
Using the same set in the sequential search we will run
the binary algorithm.
Input: x, A, n
Output: index // location of x in A
Binary search (x, A, n)
{ i = 1, j = n
while ( i < j)
m =int[(i + j)/2]
if (x > A(m)) then i = m + 1
else j = m
if x = A(i) then index = i
else index = 0
}
Search for 19 in the set A = {2,4,8, 9, 10, 13, 14, 16, 17, 19, 20, 21, 22, 26, 28, 31}
Sorted list = {2, 4, 8, 9, 10, 13, 14, 16, 17, 19, 20, 21, 22, 26, 28, 31}, n = 16
2 4 8 9 10 13 14 16 17 19 20 21 22 26 28 31
Int[(15 + 1)/2] = 8th cell ↑ 16 < 19  1st set
2 4 8 9 10 13 14 16 17 19 20 21 22 26 28 31
Int[( 7 + 1)/2] = 4th cell ↑ 21 > 19  2nd set
2 4 8 9 10 13 14 16 17 19 20 21 22 26 28 31
Int[(3 + 1)/2] = 2nd cell ↑ 19 = 19  index found
It took 3 steps for index found (same as n). It could have been as much as 4 and as
little as 3. The worst case seems to be int(n+1/2) steps to find x. Therefore, a
binary search is quicker in loop search then a sequential search.
INSTRUCTIONS
• Suppose an algorithm that processes a data set of size 8 has a runtime of 72.
The same algorithm has a runtime of 110 when applied to a data set of size 10;
and when applied to a data set of size 20, it has a runtime of 420. Using big-O
notation, state the runtime for this algorithm for the general case of a data set
of size n.
• Suppose you develop an algorithm that processes the first element of an array
(length of n), then processes the first 2 elements, then the first 3 elements, and
so on, until the last iteration of a loop, when it processes all elements. Thus, if n
= 4, the runtime would be 1 + 2 + 3 + 4 = 10.
– Create a table that depicts the runtime for arrays of length 1 to 10. Would
you expect the general runtime to be O(n), O(n2), O(n3), or some other
function of n? Explain
For size 8 the run time is 72 which is for one element. It results in 72/8 = 9.
(9) is the element runtime.
8 = (8 * 8) + 8 = 72
For size 10, the run time is 110 which is for one element it is 110/10 = 11 ,
which has incremented by 2 for an increment of 2 numbers of elements.
In this case the element runtime is (11).
10 = (10 * 10) + 10 = 110
For size 20, the run time is 420, is applied to one element it will be 420/20 = 21,
which is incremented by 10 again for an increment of 10 additional elements.
In this case the element runtime is (21)
20 = (20 * 20) + 20 = 420
Now following this trend the value is supposed to be as follows:
Element Formula Value O = int(n2) + n = r.
The runtime of the above computation in Big-Order Notation will be O = int(n2) + n
• Suppose you develop an algorithm that processes the first element of an array (length
of n), then processes the first 2 elements, then the first 3 elements, and so on, until the
last iteration of a loop, when it processes all elements. Thus, if n = 4, the runtime would
be 1 + 2 + 3 + 4 = 10.
• SOLUTION: The binary search formula would be Big Oh notation = 𝑂(𝑛 ∗
𝑛+1
2
)
• The table below shows the progression of the algorithm to get the solution.
• N/value = runtime value
The “N” runtime value would be = 55 at 10
1 = 1 = 1
2 = 1+2 = 3
3 = 1+2+3 = 6
4 = 1+2+3+4 = 10
5 = 1+2+3+4+5 = 15
6 = 1+2+3+4+5+6 = 21
7 = 1+2+3+4+5+6+7 = 28
8 = 1+2+3+4+5+6+7+8 = 36
9 = 1+2+3+4+5+6+7+8+9 = 45
10 = 1+2+3+4+5+6+7+8+9+10 = 55
By utilizing the above equation 𝑶(𝒏 ∗
𝒏+𝟏
𝟐
) the value may be plugged in to represent the 10 tables
and outcomes. Therefore, it would NOT just fall into O(n), O(n2) or O(n3) but as modification of
O(n).

More Related Content

What's hot

Complex function
Complex functionComplex function
Complex functionShrey Patel
 
1.6 sign charts and inequalities t
1.6 sign charts and inequalities t1.6 sign charts and inequalities t
1.6 sign charts and inequalities tmath260
 
1.2 algebraic expressions
1.2 algebraic expressions1.2 algebraic expressions
1.2 algebraic expressionsmath260
 
SSC STUDY MATERIAL
SSC STUDY MATERIALSSC STUDY MATERIAL
SSC STUDY MATERIALAvula Yadav
 
Integers powers and_roots
Integers powers and_rootsIntegers powers and_roots
Integers powers and_rootslilyhwa1
 
Form 5 Additional Maths Note
Form 5 Additional Maths NoteForm 5 Additional Maths Note
Form 5 Additional Maths NoteChek Wei Tan
 
Pure Mathematics 1- Functions
Pure Mathematics 1- FunctionsPure Mathematics 1- Functions
Pure Mathematics 1- FunctionsSuraj Motee
 
Assignment chapters 3 to 7
Assignment chapters 3 to 7Assignment chapters 3 to 7
Assignment chapters 3 to 7KarunaGupta1982
 
1.2 review on algebra 2-sign charts and inequalities
1.2 review on algebra 2-sign charts and inequalities1.2 review on algebra 2-sign charts and inequalities
1.2 review on algebra 2-sign charts and inequalitiesmath265
 
Module 4 quadratic functions
Module 4 quadratic functionsModule 4 quadratic functions
Module 4 quadratic functionsdionesioable
 
6.5 determinant x
6.5 determinant x6.5 determinant x
6.5 determinant xmath260
 

What's hot (19)

Mathematics xii paper 13 with answer with value vased questions
Mathematics xii paper 13 with answer with value vased questionsMathematics xii paper 13 with answer with value vased questions
Mathematics xii paper 13 with answer with value vased questions
 
Complex function
Complex functionComplex function
Complex function
 
1.6 sign charts and inequalities t
1.6 sign charts and inequalities t1.6 sign charts and inequalities t
1.6 sign charts and inequalities t
 
1.2 algebraic expressions
1.2 algebraic expressions1.2 algebraic expressions
1.2 algebraic expressions
 
Skills In Add Maths
Skills In Add MathsSkills In Add Maths
Skills In Add Maths
 
SSC STUDY MATERIAL
SSC STUDY MATERIALSSC STUDY MATERIAL
SSC STUDY MATERIAL
 
Integers powers and_roots
Integers powers and_rootsIntegers powers and_roots
Integers powers and_roots
 
G05834551
G05834551G05834551
G05834551
 
Set 1 mawar
Set 1 mawarSet 1 mawar
Set 1 mawar
 
Form 5 Additional Maths Note
Form 5 Additional Maths NoteForm 5 Additional Maths Note
Form 5 Additional Maths Note
 
Pure Mathematics 1- Functions
Pure Mathematics 1- FunctionsPure Mathematics 1- Functions
Pure Mathematics 1- Functions
 
Assignment chapters 3 to 7
Assignment chapters 3 to 7Assignment chapters 3 to 7
Assignment chapters 3 to 7
 
1.2 review on algebra 2-sign charts and inequalities
1.2 review on algebra 2-sign charts and inequalities1.2 review on algebra 2-sign charts and inequalities
1.2 review on algebra 2-sign charts and inequalities
 
CBSE Sample Paper Mathematics Class XII - 2015
CBSE Sample Paper  Mathematics Class XII  - 2015CBSE Sample Paper  Mathematics Class XII  - 2015
CBSE Sample Paper Mathematics Class XII - 2015
 
Quadratic functions
Quadratic functionsQuadratic functions
Quadratic functions
 
Module 4 quadratic functions
Module 4 quadratic functionsModule 4 quadratic functions
Module 4 quadratic functions
 
6.5 determinant x
6.5 determinant x6.5 determinant x
6.5 determinant x
 
Graph functions
Graph functionsGraph functions
Graph functions
 
Algebreviewer
AlgebreviewerAlgebreviewer
Algebreviewer
 

Similar to Ip 5 discrete mathematics

Similar to Ip 5 discrete mathematics (20)

algorithm Unit 3
algorithm Unit 3algorithm Unit 3
algorithm Unit 3
 
Deret aritmatika
Deret aritmatikaDeret aritmatika
Deret aritmatika
 
Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Ee693 sept2014quizgt2
Ee693 sept2014quizgt2
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
 
Project2
Project2Project2
Project2
 
Greek logic and mathematics
Greek logic and mathematicsGreek logic and mathematics
Greek logic and mathematics
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
 
Order-Picking-Policies.ppt
Order-Picking-Policies.pptOrder-Picking-Policies.ppt
Order-Picking-Policies.ppt
 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programming
 
Mathematics
MathematicsMathematics
Mathematics
 
Algebreviewer
AlgebreviewerAlgebreviewer
Algebreviewer
 
Ee693 sept2014quiz1
Ee693 sept2014quiz1Ee693 sept2014quiz1
Ee693 sept2014quiz1
 
Mit6 006 f11_quiz1
Mit6 006 f11_quiz1Mit6 006 f11_quiz1
Mit6 006 f11_quiz1
 
Extended network and algorithm finding maximal flows
Extended network and algorithm finding maximal flows Extended network and algorithm finding maximal flows
Extended network and algorithm finding maximal flows
 
Lecture#9
Lecture#9Lecture#9
Lecture#9
 
tutorial5.ppt
tutorial5.ppttutorial5.ppt
tutorial5.ppt
 
Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
 
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
 
C1 - Insertion Sort
C1 - Insertion SortC1 - Insertion Sort
C1 - Insertion Sort
 
01 FUNCTIONS.pptx
01 FUNCTIONS.pptx01 FUNCTIONS.pptx
01 FUNCTIONS.pptx
 

More from Mark Simon

Introduction To Programming IP5
Introduction To Programming IP5Introduction To Programming IP5
Introduction To Programming IP5Mark Simon
 
CSS-454 information Security Assurance CAPSTONE
CSS-454 information Security Assurance CAPSTONECSS-454 information Security Assurance CAPSTONE
CSS-454 information Security Assurance CAPSTONEMark Simon
 
City Hall Network Project
City Hall Network ProjectCity Hall Network Project
City Hall Network ProjectMark Simon
 
IT-106 Pseudo-Coding Wk 5
IT-106 Pseudo-Coding Wk 5IT-106 Pseudo-Coding Wk 5
IT-106 Pseudo-Coding Wk 5Mark Simon
 
Phase 3 IP Discrete Mathematics - Vertexes & Hierarchical Trees
Phase 3 IP Discrete Mathematics - Vertexes & Hierarchical TreesPhase 3 IP Discrete Mathematics - Vertexes & Hierarchical Trees
Phase 3 IP Discrete Mathematics - Vertexes & Hierarchical TreesMark Simon
 
Discrete Mathematics - Matrices & Matrix IP2
Discrete Mathematics - Matrices & Matrix IP2Discrete Mathematics - Matrices & Matrix IP2
Discrete Mathematics - Matrices & Matrix IP2Mark Simon
 
ENG101- Week 5 Individual Project
ENG101- Week 5 Individual ProjectENG101- Week 5 Individual Project
ENG101- Week 5 Individual ProjectMark Simon
 
Mark Simon IT 245 Introduction to Network Management
Mark Simon IT 245 Introduction to Network ManagementMark Simon IT 245 Introduction to Network Management
Mark Simon IT 245 Introduction to Network ManagementMark Simon
 
Greenhouse Effect IP3
Greenhouse Effect IP3Greenhouse Effect IP3
Greenhouse Effect IP3Mark Simon
 
Materials, Semi-conductors and Micro-Chips
Materials, Semi-conductors and Micro-ChipsMaterials, Semi-conductors and Micro-Chips
Materials, Semi-conductors and Micro-ChipsMark Simon
 
What you eat phase 1
What you eat   phase 1What you eat   phase 1
What you eat phase 1Mark Simon
 

More from Mark Simon (12)

Introduction To Programming IP5
Introduction To Programming IP5Introduction To Programming IP5
Introduction To Programming IP5
 
CSS-454 information Security Assurance CAPSTONE
CSS-454 information Security Assurance CAPSTONECSS-454 information Security Assurance CAPSTONE
CSS-454 information Security Assurance CAPSTONE
 
City Hall Network Project
City Hall Network ProjectCity Hall Network Project
City Hall Network Project
 
IT-106 Pseudo-Coding Wk 5
IT-106 Pseudo-Coding Wk 5IT-106 Pseudo-Coding Wk 5
IT-106 Pseudo-Coding Wk 5
 
Phase 3 IP Discrete Mathematics - Vertexes & Hierarchical Trees
Phase 3 IP Discrete Mathematics - Vertexes & Hierarchical TreesPhase 3 IP Discrete Mathematics - Vertexes & Hierarchical Trees
Phase 3 IP Discrete Mathematics - Vertexes & Hierarchical Trees
 
Discrete Mathematics - Matrices & Matrix IP2
Discrete Mathematics - Matrices & Matrix IP2Discrete Mathematics - Matrices & Matrix IP2
Discrete Mathematics - Matrices & Matrix IP2
 
Phase 1 ip
Phase 1 ipPhase 1 ip
Phase 1 ip
 
ENG101- Week 5 Individual Project
ENG101- Week 5 Individual ProjectENG101- Week 5 Individual Project
ENG101- Week 5 Individual Project
 
Mark Simon IT 245 Introduction to Network Management
Mark Simon IT 245 Introduction to Network ManagementMark Simon IT 245 Introduction to Network Management
Mark Simon IT 245 Introduction to Network Management
 
Greenhouse Effect IP3
Greenhouse Effect IP3Greenhouse Effect IP3
Greenhouse Effect IP3
 
Materials, Semi-conductors and Micro-Chips
Materials, Semi-conductors and Micro-ChipsMaterials, Semi-conductors and Micro-Chips
Materials, Semi-conductors and Micro-Chips
 
What you eat phase 1
What you eat   phase 1What you eat   phase 1
What you eat phase 1
 

Recently uploaded

FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service LucknowAminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknowmakika9823
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxTanveerAhmed817946
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 

Recently uploaded (20)

FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
Decoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in ActionDecoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in Action
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service LucknowAminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptx
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 

Ip 5 discrete mathematics

  • 1. MATH203-1403A-02 Applications of Discrete Mathematics Phase-5 / IP 5 Mark L. Simon II Instructor: Doris Schantz August 08, 2014
  • 2. Set Theory Revisited • Look up a roulette wheel diagram. The following sets are definedA = the set of red numbers D = the set of even numbers B = the set of black numbers E = the set of odd numbers C = the set of green numbers F = {1,2,3,4,5,6,7,8,9,10,11,12} For the purposes of this presentation, we will be using the American Roulette Wheel as we are in America.
  • 3. • The table of numbers to the right are for the American Roulette. We will take from here to develop our sets. • Red #’s “A” = {1, 3, 5, 7, 9, 12, 14, 16, 18, 21, 23, 25, 27, 28, 30, 32, 34, 36} • Black #’s “B” = {2, 4, 6, 8, 10, 11, 13, 15, 17, 19, 20, 22, 24, 26, 29, 31, 33, 35} • Green #’s “C” = {0, 00} • Even #’s “D” = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36} • Odd #’s “E” = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 39, 31, 33, 35} • Set “F” = {1,2,3,4,5,6,7,8,9,10,11,12} Now that we a have assessed the determinant sets, we will start assessing each of the below “U” – Unions and “∩” – Intersections for each required configuration. They are as follows : • (A∪B) (A∩D) (B∩C) (C∪E) (B∩F) (E∩F)
  • 4. {1, 3, 5, 7, 9, 12, 14, 16, 18, 21, 23, 25, 27, 28, 30, 32, 34, 36} {2, 4, 6, 8, 10, 11, 13, 15, 17, 19, 20, 22, 24, 26, 29, 31, 33, 35 {1, 3, 5, 7, 9, 21, 23, 25, 27,} { 2, 4, 6, 8, 10, 20, 22, 24, 26, } (A∩D) = {12, 14,16, 18, 28, 30, 32, 34, 36} (A U B) = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 25,26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36} U U A B A D Null 12, 14,16, 18,28,30, 32,34,36
  • 5. 2, 4, 6, 8, 10, 11, 13, 15, 17, 19, 20, 22, 24, 26, 29, 31, 33, 35 0, 00 0, 00 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 39, 31, 33, 35 (B∩C) = {Φ} (C ∪ E) = {0, 00, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 39, 31, 33, 35} U U B C C E NullNull
  • 6. 13, 15, 17, 19, 20, 22, 24, 26, 29, 31, 33, 35 1,3,5, 7,9,12 13, 15, 17, 19, 21, 23, 25, 27, 39, 31, 33, 35 2,4,6, 8,10,12 (B ∩ F) = {2, 4, 6, 8, 10, 11} (E∩F) = {1, 3, 5, 7, 9, 11} U U B F E F 1, 3, 5, 7, 9, 11, 2, 4, 6, 8, 10, 11
  • 7. Part II: Relations, Functions, and Sequences The implementation of the program that runs the game involves testing. One of the necessary tests is to see if the simulated spins are random. Create an n-ary relation, in table form, that depicts possible results of 10 trials of the game. Include the following results of the game: Number Color Odd or even (note: 0 and 00 are considered neither even nor odd.) Trial # (P/K] Number Color Odd or Even 1 6 Black Even 2 33 Black Odd 3 12 Red Even 4 16 Black Even 5 10 Red Even 6 25 Red Odd 7 4 Black Even 8 36 Red Even 9 11 Black Odd 10 27 Red Odd 11 32 Red Even
  • 8. Part 4: Automata Theory, Grammars and Languages INSTRUCTIONS • A gate with three rotating arms at waist height is used to control access to a subway in New York city. Initially, the arms of the gate are locked preventing customers from passing through. Unlocking the arms requires depositing a token in a slot, which allows the arms to rotate to a complete turn which allows one customer to push through and enter. Once the customer passes through the arms are then locked again until another customer deposits another token in the slot. • The gate has two states: LOCKED and UNLOCKED. It also has two inputs: TOKEN and PUSH. When the gate is locked, pushing the arm of the gate has no effect regardless of how many times it is pushed. The input TOKEN changes the state from LOCKED to UNLOCKED. When the gate is in the UNLOCKED state, inserting additional tokens has no effect on the state. But when in the UNLOCKED state, a PUSH input changes the state to LOCKED. • (i). Provide a transition table showing each state, the inputs, and the resulting new states for each input • (ii). Represent your transition table into a digraph (transition diagram)
  • 9. Part - 4: Automata Theory, Grammars and Languages START STATE INPUT NEXT STATE OUTPUT LOCKED TOKEN INSERTED UNLOCK Turn Stile OPEN PUSH BAR LOCKED Turn Stile LOCKED UNLOCK TOKEN INSERTED UNLOCK Turn Stile LOCKED PUSH LOCKED After Turn Stile Pushed / Locked • Provided is a transition table showing each state, the inputs, and the resulting new states and output for each input • Below is a representation of a transition table into a digraph (transition diagram) LOCKED UN LOCKEDPush Coin Push Coin
  • 10. Part - 4: Automata Theory, Grammars and Languages • Here is a context-free grammar that can be used to generate algebraic expressions via the arithmetic operators (addition, subtraction, multiplication, and division), in the variables p, q, and r. The letter E stands for expression: • Rule 1: E —› p • Rule 2: E —› q • Rule 3: E —› r • Rule 4: E —› E + E • Rule 5: E —› E – E • Rule 6: E —› E X E • Rule 7: E —› E/E • Rule 8: E —›(E) Use the above grammar to derive the string given by the mathematical expression E = (p + q) X p – r X p/(q + q)
  • 11. Grammars and Languages - Continued E = (p + q) X p – r X p/(q + q)  E ( the start symbol)  E – E ( by rule 5, applied to the middle)  E – E * E (by rule 6, applied to the rightmost E)  (E) * E – E * E (by rule 6, applied to the leftmost E)  (E) * E – E * E/(E) (By Rule 8, applied to the rightmost E)  (E + E) * E – E * E/(E) (By Rule 4 of the leftmost E)  (E + E) * E – E * E/(E + E) (By Rule 4 applied to the rightmost E)  (p + E) * E – E * E/(E + E) ( by rule 1 , by the leftmost E )  (p + q) * E – E * E/(E + E) ( by rule 2 , by the leftmost E )  (p + q) * p – E * E/(E + E) ( by rule 1 , by the leftmost E )  (p + q) * p – E * E/(E + q) ( by rule 2 , by the rightmost E )  (p + q) * p – E * E/(q + q) ( by rule 2 , by the rightmost E )  (p + q) * p – E * p/(q + q) ( by rule 1 , by the rightmost E )  (p + q) * p – r * p/(q + q) ( by rule 3 , by the rightmost E )
  • 12. Part - 4: Continued Automata Theory, Grammars and Languages E / | E - E / | / | E * E E * E /| | | /| ( E ) p r E / E /| | /| E + E p ( E ) | | /| p q E + E | | q q (E + E) * E – E * E/(E + E) to (p + q) * p – r * p/(q + q) To the right is my attempt to accomplish the sparse tree configuration. As is seen, the initial inner variables break down pretty easily, but the outer configurations take a little more break down to accomplish the sparse tree.
  • 13. Part -V Algorithm (Sequential) Search This algorithm finds an object “x” (number, string) from a given set A where |A| = n. Input: x, A, n Output: index // location of x in set A (array A) seq_search(x, A, n) { i = 1 while (i <= n and x ~= A(i)) i = i + 1 if (i <= n) then index = i else index = 0 return index }
  • 14. Algorithmic Sequential (Linear) Search Input: x = 19, A = {22, 21, 9, 4, 16, 2, 10, 14, 20, 31, 26, 19, 17, 28, 8, 13}, n = 16 It took 13 steps (same as n). It could have been as much as 16 and as little as 2. The worst case seems to be n + 1 steps to find x. Step 1: test: 1 < 16 and 19 ~= 22 true i = 2 Step 9: test:9 < 16 and 19 ~= 20 true I =10 Step 2: test: 2 < 16 and 19 ~= 21 true i = 3 Step 10: test: 10 < 16 and 19 ~= 31 true i = 11 Step 3: test: 3 < 16 and 19 ~= 9 true i = 4 Step 11: test: 11 < 16 and 19 ~= 26 true i = 12 Step 4: test: 4 < 16 and 19 ~= 4 true i = 5 Step 12: test: 12 < 16 and 19 ~= 19 false i = 13 Step 5: test: 5 < 16 and 19 ~= 16 true i = 6 Step 13: test: 12 < 16 true index = 19 Step 6: test: 6 < 16 and 19 ~= 2 true i = 7 Step 7: test: 7 < 16 and 19 ~= 10 true i = 8 Step 8: test: 8 < 16 and 19 ~= 14 true i = 9
  • 15. This algorithm performs a binary search to find “x” in a set – (A). The algorithm determines the location of “x”. Using the same set in the sequential search we will run the binary algorithm. Input: x, A, n Output: index // location of x in A Binary search (x, A, n) { i = 1, j = n while ( i < j) m =int[(i + j)/2] if (x > A(m)) then i = m + 1 else j = m if x = A(i) then index = i else index = 0 }
  • 16. Search for 19 in the set A = {2,4,8, 9, 10, 13, 14, 16, 17, 19, 20, 21, 22, 26, 28, 31} Sorted list = {2, 4, 8, 9, 10, 13, 14, 16, 17, 19, 20, 21, 22, 26, 28, 31}, n = 16 2 4 8 9 10 13 14 16 17 19 20 21 22 26 28 31 Int[(15 + 1)/2] = 8th cell ↑ 16 < 19  1st set 2 4 8 9 10 13 14 16 17 19 20 21 22 26 28 31 Int[( 7 + 1)/2] = 4th cell ↑ 21 > 19  2nd set 2 4 8 9 10 13 14 16 17 19 20 21 22 26 28 31 Int[(3 + 1)/2] = 2nd cell ↑ 19 = 19  index found It took 3 steps for index found (same as n). It could have been as much as 4 and as little as 3. The worst case seems to be int(n+1/2) steps to find x. Therefore, a binary search is quicker in loop search then a sequential search.
  • 17. INSTRUCTIONS • Suppose an algorithm that processes a data set of size 8 has a runtime of 72. The same algorithm has a runtime of 110 when applied to a data set of size 10; and when applied to a data set of size 20, it has a runtime of 420. Using big-O notation, state the runtime for this algorithm for the general case of a data set of size n. • Suppose you develop an algorithm that processes the first element of an array (length of n), then processes the first 2 elements, then the first 3 elements, and so on, until the last iteration of a loop, when it processes all elements. Thus, if n = 4, the runtime would be 1 + 2 + 3 + 4 = 10. – Create a table that depicts the runtime for arrays of length 1 to 10. Would you expect the general runtime to be O(n), O(n2), O(n3), or some other function of n? Explain
  • 18. For size 8 the run time is 72 which is for one element. It results in 72/8 = 9. (9) is the element runtime. 8 = (8 * 8) + 8 = 72 For size 10, the run time is 110 which is for one element it is 110/10 = 11 , which has incremented by 2 for an increment of 2 numbers of elements. In this case the element runtime is (11). 10 = (10 * 10) + 10 = 110 For size 20, the run time is 420, is applied to one element it will be 420/20 = 21, which is incremented by 10 again for an increment of 10 additional elements. In this case the element runtime is (21) 20 = (20 * 20) + 20 = 420 Now following this trend the value is supposed to be as follows: Element Formula Value O = int(n2) + n = r. The runtime of the above computation in Big-Order Notation will be O = int(n2) + n
  • 19. • Suppose you develop an algorithm that processes the first element of an array (length of n), then processes the first 2 elements, then the first 3 elements, and so on, until the last iteration of a loop, when it processes all elements. Thus, if n = 4, the runtime would be 1 + 2 + 3 + 4 = 10. • SOLUTION: The binary search formula would be Big Oh notation = 𝑂(𝑛 ∗ 𝑛+1 2 ) • The table below shows the progression of the algorithm to get the solution. • N/value = runtime value The “N” runtime value would be = 55 at 10 1 = 1 = 1 2 = 1+2 = 3 3 = 1+2+3 = 6 4 = 1+2+3+4 = 10 5 = 1+2+3+4+5 = 15 6 = 1+2+3+4+5+6 = 21 7 = 1+2+3+4+5+6+7 = 28 8 = 1+2+3+4+5+6+7+8 = 36 9 = 1+2+3+4+5+6+7+8+9 = 45 10 = 1+2+3+4+5+6+7+8+9+10 = 55 By utilizing the above equation 𝑶(𝒏 ∗ 𝒏+𝟏 𝟐 ) the value may be plugged in to represent the 10 tables and outcomes. Therefore, it would NOT just fall into O(n), O(n2) or O(n3) but as modification of O(n).