Answers
Reference answers and worked solutions.
Lecture 01 - Sets & Venn Diagram
Important Concept Summary
- Union (): Elements in or
- Intersection (): Elements common to both
- Difference (): Elements in but not in
- Venn diagrams help visualize overlaps
- At least one = union, only = specific region, neither = outside all sets
Practice 01 - Questions
Out of 80 students: 60 pass Bangla, 40 pass English, 25 pass both.
-
Tasks:
- a) How many pass Bangla?
- b) How many pass English?
- c) How many pass both?
- d) How many pass only Bangla?
- e) How many pass only English?
- f) How many pass at least one subject?
- g) How many fail in both?
- h) How many fail only one subject?
- i) How many fail at least one subject?
- j) How many fail at least two subjects?
-
Answers:
- a) 60
- b) 40
- c) 25
- d) 35
- e) 15
- f) 75
- g) 5
- h) Fail only Bangla = 15, fail only English = 35 -> total 50
- i) 55
- j) 5
Practice 02 - Questions
800 surveyed.
Car only = 280, Bicycle only = 220, Both = 140.
-
Tasks:
- a) Car only?
- b) Bicycle only?
- c) Neither?
- d) At least one?
- e) Only one?
-
Answers:
- a) 280
- b) 220
- c) 160
- d) 640
- e) 500
Practice 03 - Questions
80 like Java, 60 like C++, 40 like Python.
Overlaps: JC++ = 20, C++P = 25, JP = 20, All = 12.
-
Tasks:
-
- Total students?
-
- Only Java?
-
- Only C++?
-
- Only Python?
-
-
Answers:
-
- 127
-
- 47
-
- 27
-
- 12
-
Lecture 02 - Mathematical Induction
Important Concept Summary
Mathematical Induction requires:
- Base Step: Show formula holds for
- Inductive Step: Assume true for , prove true for
If both hold, formula is true for all natural numbers.
-
Tasks:
-
- Prove:
-
- Prove:
-
- Prove:
-
-
Answers:
- All three statements are true by induction.
Lecture 03 - Propositional Logic (Part 1)
Important Concept Summary
- Proposition: A declarative statement with TRUE or FALSE
- Not a proposition: Questions, commands, exclamations, variable statements
- : Negation = "It is not the case that "
- : Both must be true
- : At least one is true
-
Tasks:
- Identify whether each is a proposition and state truth value.
-
Answers:
- Kolkata is in Bangladesh -> Proposition (False)
- Do your homework? -> Not a proposition
- Bangladesh wins by 3 wickets -> Proposition (True)
- 23 is an even number -> Proposition (False)
- X is an odd number -> Not a proposition
- -> Proposition (False)
- May Allah bless you -> Not a proposition
- Do it -> Not a proposition
- Do you know me? -> Not a proposition
- What is your good name? -> Not a proposition
- Hurrah! We won -> Not a proposition
AND Practice - Questions
-
Tasks:
-
- Express in English (swimming + sharks).
-
- Express in English (election + counting).
-
-
Answers:
-
- "Swimming at the NJ shore is allowed, and sharks have been spotted."
-
- "The election is decided, and the votes have been counted."
-
Negation Practice - Questions
-
Tasks:
- Given: = "The election is decided", = "Votes counted".
- 1a)
- 1b)
- 2a) (sharks)
- 2b) (duplicate)
-
Answers:
- 1a) The election is not decided.
- 1b) The votes have not been counted.
- 2a) Sharks have not been spotted near the shore.
- 2b) Same: Sharks have not been spotted near the shore.
Lecture 04 - Propositional Logic (Part 2)
Important Concept Summary
- Truth tables evaluate all possible input cases.
- Expression trees show operator hierarchy.
- Combinational circuits translate logic into gates.
- Logical equivalence means both expressions yield identical truth tables.
Truth Table Questions
- Tasks:
- I.
- II.
- III.
- IV.
Final Column Answers Only
-
Answers:
- I. T, F, F, F, F, F, T, F
- II. T, T, T, T, F, F, F, F
- III. T, T, T, F, F, T, T, F
- IV. F, F, F, F, F, F, F, F
-
(All copied in order: TTT, TTF, TFT, TFF, FTT, FTF, FFT, FFF)
Expression Tree Questions
- Tasks:
- a)
- b)
- c)
- d)
Key Explanation
Expression tree simply follows operator precedence.
- Answers:
- a) AND at root -> left: , right:
- b) OR at root -> left: , right:
- c) Implication at root -> left: , right:
- d) AND at root -> left: , right:
Circuit -> Expression Questions
Page 15 diagram
Page 16 diagram
- Answers:
-
Expression -> Circuit Question
- Answers:
- Circuit contains:
- Two OR gates
- Two NOT gates
- One AND gate
- Direct translation of expression.
- Circuit contains:
Word Problem -> Logic Questions
1) Rakib/Rahim/Rain
Statement, circuit, tree.
- Answers:
- Logical expression:
- Logical expression:
2) Overtime & Trump
Statement, circuit, tree.
- Answers:
- Logical expression:
- Logical expression:
Logical Equivalence Questions
-
Tasks:
-
- and
-
- and
-
-
Answers:
-
- Both pairs are logically equivalent.
-
- Both pairs are logically equivalent.
-
Lecture 05 - Tautology, Contradiction, Contingency
Important Concept Summary
- Tautology: Always true
- Contradiction: Always false
- Contingency: Sometimes true, sometimes false
Tautology Questions
-
Check if following are tautologies:
-
-
-
- and
-
- and
-
-
-
Answers:
- All 5 are tautologies.
Contradiction Questions
-
Tasks:
- Same set of statements.
-
Answers:
- None of them are contradictions.
Lecture 07 & 08
- Tasks:
- Read Lecture 7 and 8 from the PDF.
- The PDFs do not contain any additional practice problems (only theory).
- Please read Lecture 7 and 8 from the PDF as they are not included here.
Suggestions Answer
QUESTION 1 - CIRCUIT
Kindly practice circuit questions from the PDF.
QUESTION 2 - PIGEONHOLE PRINCIPLE
2(a)
A box contains 8 yellow, 12 green, and 15 purple balls. What is the minimum number of balls you must draw to guarantee having 5 balls of the same color?
Answer 2(a):
We want to force 5 of one color. Using generalized pigeonhole: to guarantee items in one of boxes you need draws where and colors.
Minimum draws.
2(b)
A drawer has 20 black, 20 white, and 20 brown socks. Minimum to ensure 4 socks of the same color?
Answer 2(b):
, colors, so minimum socks.
2(c)
A bag has 6 red, 9 blue, 11 orange marbles. Minimum to guarantee selecting 3 marbles of same color?
Answer 2(c):
, , so minimum marbles.
QUESTION 3 - RELATIONS
For each relation on determine Reflexive, Symmetric, Transitive.
Set 1 (first block on page 2)
- Reflexive? No - missing .
- Symmetric? No - e.g. present but not.
- Transitive? No - and present but not present.
- Reflexive? No - missing.
- Symmetric? No - and are symmetric, but exists without .
- Transitive? Yes - every valid chain closes inside relation.
- Reflexive? No - missing.
- Symmetric? No - present, absent.
- Transitive? Yes - only needed closure is with giving , which is present.
- Reflexive? Yes - all present.
- Symmetric? No - is present but is not.
- Transitive? No - and would require , which is missing.
- Reflexive? No - and missing.
- Symmetric? Yes - and are both present.
- Transitive? No - and would require , which is missing.
Set 2 (second block on page 3)
- Reflexive? No - no diagonal pairs.
- Symmetric? No - e.g. present but not.
- Transitive? No - and would require , which is missing.
- Reflexive? No - and missing.
- Symmetric? No - lacks .
- Transitive? Yes - every nontrivial chain closes.
- Reflexive? Yes - all diagonal pairs present.
- Symmetric? No - present but not.
- Transitive? No - and would require , which is missing.
- Reflexive? No - and missing.
- Symmetric? Yes - only diagonal pairs.
- Transitive? Yes - no failing chain.
- Reflexive? No - no diagonal pairs.
- Symmetric? Yes - all pairs come with reverse.
- Transitive? No - and would require , which is missing.
Set 3 (third block)
- Reflexive? No
- Symmetric? No - e.g. present but absent.
- Transitive? No - and would require , which is absent.
- Reflexive? No - missing.
- Symmetric? Yes - and are present.
- Transitive? No - and would require , which is missing.
- Reflexive? No
- Symmetric? No
- Transitive? No - and would require , which is missing.
- Reflexive? No
- Symmetric? Yes
- Transitive? Yes
- Reflexive? No - missing.
- Symmetric? No - present but absent.
- Transitive? No - and would require , which is missing.
QUESTION 4 - INDUCTION
Please practice PDF content; most reliable source.
QUESTION 5 - LOGICAL PROPOSITION (three sentences)
Problem 1
Sentence: "Either X or Y is true, but they cannot both be true."
(a) Logical expression
Equivalent to exclusive OR: .
(b) Expression tree
Root =
- Left child = with leaves ,
- Right child = whose child is with leaves ,
(c) Truth table and classification
| X | Y | ||||
|---|---|---|---|---|---|
| T | T | T | T | F | F |
| T | F | T | F | T | T |
| F | T | T | F | T | T |
| F | F | F | F | T | F |
Classification: Contingency
(d) Logic circuit diagram (textual)
- OR gate combining and -> output to AND gate.
- AND gate combining and -> feed to NOT -> feed into second input of final AND.
- Final gate is AND: OR-output AND NOT(AND()).
(e) If new sentence: "X or Y, and both may be true"
New expression: .
Problem 2
Sentence: "If X is true then Y must be false, and at least one of them must be true."
(a) Logical expression
1st part:
2nd part:
Combined:
(b) Expression tree
Root =
- Left child = with left and right
- Right child = with leaves ,
(c) Truth table and classification
| X | Y | ||||
|---|---|---|---|---|---|
| T | T | F | F | T | F |
| T | F | T | T | T | T |
| F | T | F | T | T | T |
| F | F | T | T | F | F |
Expression is Contingency.
(d) Logic circuit
- Left part: , realizable as
- Right part:
- Final: AND of both parts
(e) Replace implication with iff
New expression:
You can expand as .
Problem 3
Sentence: "X is true only if Y is false, and at least one of X or Y is false."
(a) Logical expression
"X only if Y is false" means .
"At least one of X or Y is false" is or .
Combined:
(b) Expression tree
Root =
- Left child = ()
- Right child = ()
(c) Truth table and classification
| X | Y | Combined | ||||
|---|---|---|---|---|---|---|
| T | T | F | F | F | F | F |
| T | F | F | T | T | T | T |
| F | T | T | F | T | T | T |
| F | F | T | T | T | T | T |
Combined is true for three rows and false for one: Contingency.
(d) Logic circuit
- Build as
- Build
- AND them
Since both conjuncts are same, whole formula simplifies to .
(e) Replace "only if" with "if and only if"
Now left part becomes . Combined expression:
QUESTION 6 - TSP (Travelling Salesman Problem)
Graph edges:
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
We must start and end at .
Candidate optimal cycle (intermediate attempts)
Invalid because repeats.
Invalid because is not an edge.
Invalid because vertices repeat.
Final verified tour
Cost calculation
Final Answer
QUESTION 7 - SETS
Problem 1
Given:
- , ,
- , ,
(a) Total number of people who like at least one sport
Use inclusion-exclusion:
Compute:
Subtract pairwise overlaps:
Add triple overlap:
Answer 7.1(a): 93
(b) People who like only Football
Compute pair-only values first:
- only
- only
Only Football:
Answer 7.1(b): 30
(c) People who like exactly two sports
Exactly two:
So:
Answer 7.1(c): 22
(d) Venn diagram counts
- Triple region = 5
- only = 10
- only = 7
- only = 5
- Only
- Only
- Only
Problem 2 (Tea/Coffee)
Given 300 students: , , .
(a) Tea only
(b) Coffee only
(c) Neither
IUS Preps - Your Academic Success Partner