SlideShare a Scribd company logo
1 of 2
Algorithmic Foundations
1
.Usingthe laws of logical equivalence show:
(a) ¬ (p∨ (q∨¬r)) ∧q≡ ((¬p ∧ q) ∧ R)
solution…………………………………………………………………………………………………………………
………………………………………………………………
Hence the proof that ¬ (p∨ (q∨¬r)) ∧q is equivalent to ((¬p ∧ q) ∧ R)
(b)(p→r)∨ (q→r) ≡ (p∧q) →r
p q r ((p → r) ∨ (q → r)) p q r ((p ∧ q) → r)
0 0 0 1 0 0 0 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
0 1 1
Call +25479
Call +254791410785
for the
Call
+254791410785
for the solution
for the solution
1
0 1 1 1
1 0 0 1 1 0 0 1
1 0 1 1 1 0 1 1
1 1 0 0 1 1 0 0
1 1 1 1 1 1 1 1
Hence the proof that (p→r) ∨ (q→r) ∧q is equivalent to (p∧q) →r
(c) (∀×∈⋃ (P(x) →¬Q(x)) ≡ ¬∃×∈⋃. (P(x) ∧Q(x))
P(x) P(x)
0 0
Call/WhatsApp
+254791410785
1
P(x) =
Q(x) =
(P(x) ∧Q(x) =……………………………………………………………………………………………....
Now looking at the truth table P(x) is equivalent Q(x) and (∀×∈⋃ (P(x) →¬Q(x)) is equivalent to ¬∃×∈⋃.
(P(x) ∧Q(x)) hence the proof.
2. Assuming thefollowing predicates:
•L(x, y):x is strictly less than y (x<y);
•E(x):x is even;
•P(x): x is a prime number;
•EQ(x, y):x equals y (x=y);
•G(x):x isgreater than zero (x>O);
•D(x, y): x divides y exactly;
Determine which of the followingformulae are true (in your answer include an expression of
the formula inconcise (good) English without variables).
(a) ∀×∈N. (D(2, x) →E(x))
Given that x/2= is an integer____________________hence x is even hence the proof.
(b) ∃y ∈N. ∀×∈N.L(x, y)
(c) ∃×∈Z+.∀y ∈Z+.(G(x) →(P(y) ∧L(x, y)))
Next,usingtheabove predicates and quantifiers were necessary, express the followingEnglish
statements inlogic.
(d) "Any non-zero integer divides itself"
(e) "Aprime number's only positive factors are 1and itself."
3. Provethat (BA) ⋃ (CA) =(B ⋃C)A using:
(a) A containment proof.
(b) Using set builder notation and logical equivalences.
4. For each of the following functions find the inverse or explain why no inverse exists.
a. f :N→ Nwhere f(x) =4·x2
+ 1
b. g : Z→ Z where g(x) = x + 7
Call/WhatsApp
+254791410785 for customized
the
for customized
the1

More Related Content

Similar to Algorithmic foundations.docx

Probability Formula sheet
Probability Formula sheetProbability Formula sheet
Probability Formula sheetHaris Hassan
 
Approximate Nearest Neighbour in Higher Dimensions
Approximate Nearest Neighbour in Higher DimensionsApproximate Nearest Neighbour in Higher Dimensions
Approximate Nearest Neighbour in Higher DimensionsShrey Verma
 
Unit 1-logic
Unit 1-logicUnit 1-logic
Unit 1-logicraksharao
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicManjula V
 
Talk at CIRM on Poisson equation and debiasing techniques
Talk at CIRM on Poisson equation and debiasing techniquesTalk at CIRM on Poisson equation and debiasing techniques
Talk at CIRM on Poisson equation and debiasing techniquesPierre Jacob
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Omnia A. Abdullah
 
Truth, deduction, computation lecture c
Truth, deduction, computation   lecture cTruth, deduction, computation   lecture c
Truth, deduction, computation lecture cVlad Patryshev
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematicsM.Saber
 
1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.pptTejasAditya2
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introductionyashirraza123
 
Truth, deduction, computation lecture a
Truth, deduction, computation   lecture aTruth, deduction, computation   lecture a
Truth, deduction, computation lecture aVlad Patryshev
 
Resolution method in AI.pptx
Resolution method in AI.pptxResolution method in AI.pptx
Resolution method in AI.pptxAbdullah251975
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 
Some properties of two-fuzzy Nor med spaces
Some properties of two-fuzzy Nor med spacesSome properties of two-fuzzy Nor med spaces
Some properties of two-fuzzy Nor med spacesIOSR Journals
 

Similar to Algorithmic foundations.docx (20)

C2.0 propositional logic
C2.0 propositional logicC2.0 propositional logic
C2.0 propositional logic
 
Probability Formula sheet
Probability Formula sheetProbability Formula sheet
Probability Formula sheet
 
Approximate Nearest Neighbour in Higher Dimensions
Approximate Nearest Neighbour in Higher DimensionsApproximate Nearest Neighbour in Higher Dimensions
Approximate Nearest Neighbour in Higher Dimensions
 
Unit 1-logic
Unit 1-logicUnit 1-logic
Unit 1-logic
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
 
Kumera2.docx
Kumera2.docxKumera2.docx
Kumera2.docx
 
Talk at CIRM on Poisson equation and debiasing techniques
Talk at CIRM on Poisson equation and debiasing techniquesTalk at CIRM on Poisson equation and debiasing techniques
Talk at CIRM on Poisson equation and debiasing techniques
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters
 
Truth, deduction, computation lecture c
Truth, deduction, computation   lecture cTruth, deduction, computation   lecture c
Truth, deduction, computation lecture c
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematics
 
Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
 
1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introduction
 
chapter9.ppt
chapter9.pptchapter9.ppt
chapter9.ppt
 
Truth, deduction, computation lecture a
Truth, deduction, computation   lecture aTruth, deduction, computation   lecture a
Truth, deduction, computation lecture a
 
Resolution method in AI.pptx
Resolution method in AI.pptxResolution method in AI.pptx
Resolution method in AI.pptx
 
Predicates
PredicatesPredicates
Predicates
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
Some properties of two-fuzzy Nor med spaces
Some properties of two-fuzzy Nor med spacesSome properties of two-fuzzy Nor med spaces
Some properties of two-fuzzy Nor med spaces
 
dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
 

Recently uploaded

Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 

Algorithmic foundations.docx

  • 1. Algorithmic Foundations 1 .Usingthe laws of logical equivalence show: (a) ¬ (p∨ (q∨¬r)) ∧q≡ ((¬p ∧ q) ∧ R) solution………………………………………………………………………………………………………………… ……………………………………………………………… Hence the proof that ¬ (p∨ (q∨¬r)) ∧q is equivalent to ((¬p ∧ q) ∧ R) (b)(p→r)∨ (q→r) ≡ (p∧q) →r p q r ((p → r) ∨ (q → r)) p q r ((p ∧ q) → r) 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 Call +25479 Call +254791410785 for the Call +254791410785 for the solution for the solution 1 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 1 1 1 Hence the proof that (p→r) ∨ (q→r) ∧q is equivalent to (p∧q) →r (c) (∀×∈⋃ (P(x) →¬Q(x)) ≡ ¬∃×∈⋃. (P(x) ∧Q(x)) P(x) P(x) 0 0 Call/WhatsApp +254791410785 1
  • 2. P(x) = Q(x) = (P(x) ∧Q(x) =…………………………………………………………………………………………….... Now looking at the truth table P(x) is equivalent Q(x) and (∀×∈⋃ (P(x) →¬Q(x)) is equivalent to ¬∃×∈⋃. (P(x) ∧Q(x)) hence the proof. 2. Assuming thefollowing predicates: •L(x, y):x is strictly less than y (x<y); •E(x):x is even; •P(x): x is a prime number; •EQ(x, y):x equals y (x=y); •G(x):x isgreater than zero (x>O); •D(x, y): x divides y exactly; Determine which of the followingformulae are true (in your answer include an expression of the formula inconcise (good) English without variables). (a) ∀×∈N. (D(2, x) →E(x)) Given that x/2= is an integer____________________hence x is even hence the proof. (b) ∃y ∈N. ∀×∈N.L(x, y) (c) ∃×∈Z+.∀y ∈Z+.(G(x) →(P(y) ∧L(x, y))) Next,usingtheabove predicates and quantifiers were necessary, express the followingEnglish statements inlogic. (d) "Any non-zero integer divides itself" (e) "Aprime number's only positive factors are 1and itself." 3. Provethat (BA) ⋃ (CA) =(B ⋃C)A using: (a) A containment proof. (b) Using set builder notation and logical equivalences. 4. For each of the following functions find the inverse or explain why no inverse exists. a. f :N→ Nwhere f(x) =4·x2 + 1 b. g : Z→ Z where g(x) = x + 7 Call/WhatsApp +254791410785 for customized the for customized the1