Assignment 1 (Cse173.5)
Assignment 1 (Cse173.5)
ASSIGNMENT 1
RUKAIA MINHAZ MITHI
ID: 2421569642
Section: 5
Chapter 1.1
13.
a. ㄱP
b. P Λ ㄱQ
c. P → Q
d. ㄱP → ㄱQ
e. P → Q
f. Q Λ ㄱP
g. Q → P
15.
a. R Λ ㄱP
b. ㄱP Λ Q Λ R
c. R → (Q ↔ ㄱP)
d. ㄱQ Λ ㄱP Λ R
e. Q → (ㄱR Λ ㄱP)
f. (P Λ R) → ㄱQ
16.
a. True.
b. False.
c. True.
d. False.
21.
a. Inclusive OR.
b. Exclusive OR.
c. Exclusive OR.
d. Inclusive OR.
25.
a. It is hot outside if and only if you buy an ice cream
cone.
b. You win the contest if and only if you have the only
winning ticket.
a.
P P⊕P
T F
F F
b. P ㄱP P ⊕ ㄱP
T F T
F T T
c.
P Q ㄱQ P ⊕ ㄱQ
T T F T
T F T F
F T F F
F F T T
d.
P Q ㄱP ㄱQ ㄱP ⊕ ㄱQ
T T F F F
T F F T T
F T T F T
F F T T F
e.
P Q ㄱQ P⊕Q P ⊕ ㄱQ (P ⊕ Q) V (P ⊕ㄱQ)
T T F F T T
T F T T F T
F T F T F T
F F T F T T
f.
P Q ㄱQ P⊕Q P ⊕ ㄱQ (P ⊕ Q) Λ (P ⊕ ㄱQ)
T T F F T F
T F T T F F
F T F T F F
F F T F T F
CHAPTER 1.2
3.
Here,
G = You can graduate.
M = You owe money to the university.
R = You have completed the requirements of your major.
B = You have an overdue library book.
So, the statement will be translated into the following
propositional logic:
G → (R Λ ㄱM Λ ㄱB)
4.
Here,
W = You can use the wireless network in the airport.
D = You pay the daily fee.
S = You are a subscriber to the service.
So, the statement will be translated into the following
propositional logic:
W → (D Λ S)
19.
Case 1:
Case 2:
20.
Case 1:
Case 2:
21.
Case 1:
Case 2:
22.
Case 1:
23.
Case 1:
Case 2:
23.
a.
Given set is P({a, b, {a, b}})
Let’s say, M = {a, b, {a, b}}
So the cardinality of M is, |M| = 3
Now,
=> |P(M)| = 2|M|
=> |P(M)| = 23
=> |P(M)| = 8
So, the number of elements in P({a, b, {a, b}}) is 8.
b.
Given set is P({∅, a, {a}, {{a}}})
Let’s say, M = {∅, a, {a}, {{a}}}
So the cardinality of M is, |M| = 4
Now,
=> |P(M)| = 2|M|
=> |P(M)| = 24
=> |P(M)| = 16
So, the number of elements in P({∅, a, {a}, {{a}}}) is 16.
c.
Given set is P(P(∅))
Let’s say, M = P(∅)
So the cardinality of M is, |M| = 1
Now,
=> |P(M)| = 2|M|
=> |P(M)| = 21
=> |P(M)| = 2
So, the number of elements in P(P(∅)) is 2.
24.
a.
Given set is ∅.
It’s an empty set.
To be a power set, a set must include at least the empty
set ∅. But ∅ has no element. So it’s not a power set.
b.
Given set is {∅, {a}}.
If this were a power set, it would correspond to a set with
n=1 element (since 21=2).
The original set would be {a}, and its power set is {∅,{a}}.
So, It’s a power set.
c.
Given set is {∅, {a}, {∅, a}}.
This set has 3 elements: ∅, {a} and {∅,a}.
A power set must have 2n elements, where n is an integer.
Since 3 is not a power of 2, this cannot be a power set.
So, It’s not a power set.
d.
Given set is {∅,{a},{b},{a,b}}
This set has 4 elements: ∅, {a}, {b}, and {a,b}.
If this were a power set, it would correspond to a set with
n=2 elements (since 22 = 4).
The original set would be {a,b}, and its power set is
{∅,{a},{b},{a,b}}.
So, It’s a power set.
32.
a.
Given A = {a, b, c}, B = {x, y} and C = {0, 1}
So, A × B × C = {
(a, x, 0), (a, x, 1), (a, y, 0), (a, y, 1),
(b, x, 0), (b, x, 1), (b, y, 0), (b, y, 1),
(c, x, 0), (c, x, 1), (c, y, 0), (c, y, 1)
}
b.
Given A = {a, b, c}, B = {x, y} and C = {0, 1}
So, C × B × A = {
(0, x, a), (0, x, b), (0, x, c),
(0, y, a), (0, y, b), (0, y, c),
(1, x, a), (1, x, b), (1, x, c),
(1, y, a), (1, y, b), (1, y, c)
}
c.
Given A = {a, b, c}, B = {x, y} and C = {0, 1}
So, C × A × B = {
(0, a, x), (0, a, y),
(0, b, x), (0, b, y),
(0, c, x), (0, c, y),
(1, a, x), (1, a, y),
(1, b, x), (1, b, y),
(1, c, x), (1, c, y)
}
d.
Given B = {x, y}
So, B × B × B = {
(x, x, x), (x, x, y), (x, y, x), (x, y, y),
(y, x, x), (y, x, y), (y, y, x), (y, y, y)
}
34.
a.
Given A = {a}
So, A3 = A × A × A = {(a, a, a)}
b.
Given A = {0, a}
So, A3 = A × A × A = {
(0, 0, 0), (0, 0, a), (0, a, 0), (0, a, a),
(a, 0, 0), (a, 0, a), (a, a, 0), (a, a, a)
}
Chapter 2.3
6.
a.
Domain:
The set of all ordered pairs of positive integers. We
can represent this as {(x, y) | x ∈ ℤ⁺, y ∈ ℤ⁺}, where ℤ⁺
denotes the set of positive integers.
Range:
The set of all positive integers, ℤ⁺. Since the first
integer of the pair can be any positive integer.
b.
Domain:
The set of all positive integers, ℤ⁺.
Range:
The set of integers {1, 2, 3, 4, 5, 6, 7, 8, 9}. These are
the possible largest decimal digits.
c.
Domain:
The set of all bit strings. This includes the empty
string (often denoted by ε or λ).
Range:
The set of all integers, ℤ. The difference between the
number of ones and zeros can be any integer
(positive, negative, or zero).
d.
Domain:
The set of all positive integers, ℤ⁺.
Range:
The set of all non-negative integers, {0, 1, 2, 3, ...}. As
n increases, the largest integer not exceeding √n
will also increase, taking on all non-negative
integer values.
e.
Domain:
The set of all bit strings. This includes the empty
string.
Range:
The set of all non-negative integers, {0, 1, 2, 3, ...}. A
bit string can have no ones (longest string of ones
has length 0), or a string of ones of any positive
integer length.
12.
a.
Given, f(n) = n−1
If f(a) = f(b), then:
a−1=b−1
a=b
Since no two different inputs produce the same output,
This function is one-to-one.
b.
Given, f(n) = n2 + 1
If f(a) = f(b), then:
a2 + 1 = b2 + 1
a2 = b2
a = ±b
This means that different inputs (e.g., 2 and −2) can
produce the same output:
f(2) = 22 + 1 = 5
f(−2) = (−2)2 + 1= 5
Since different inputs can produce the same output, this
function is not one-to-one.
c.
Given, f(n) = n3
If f(a) = f(b), then:
a3 = b3
a=b
No two different numbers have the same cube, so this
function is one-to-one.
d.
Given, (n)=「n/2]
If f(a) = f(b), then:
「 a/2] =「b/2]
This means that multiple values of n can give the same
output.
f(2) =「4/2] =「2] = 2
f(3) =「3/2] =「1.5] = 2
Since f(2) = f(3) but 2 ≠ 3, the function is not one-to-one.
15.
a.f(m,n)=m+n isn’t an onto function as for every output
there are at least one inputs i.e
f(-1,2)=1
f(-1,-3)=-4
f(2,3)=5
So, f(m,n)=m+n is not an onto function.
f(1,2)=2
f(-1,-2)=2
f(1,2)=-1
f(-4,5)=-9
69.
f(x)=x3+1
=> y=x3+1
=>x3=y-1
=>x=∛(y-1)
=>y=∛(x-1)
So, f-1(x)=∛(y-1)
22.
a. f(x)=3x+4
For, x=0,f(x)=4
x=1,f(x)=1
x=2,f(x)=2
bijection.
b. f(x)=-3x+7
For x=1,f(1)=-3+7=4
x=-1,f(-1)=4
bijection.
c.f(x)=(x+1)(x+2)
For, x=-1,f(-1)=0
x=-2,f(-2)=undefined
bijection.
d. f(x)=x5+1
For ,x=1,f(1)=2
For, x=-1,f(-1)=0
23.
a. d. f(x)=2x+1
For ,x=1,f(1)=3
For, x=2,f(2)=5
b. f(x)=x2+1
For ,x=-1,f(-1)=2
For, x=1,f(1)=2
Here for every output there are two different input. So it is not
bijection.
d. f(x)=x3
For ,x=1,f(1)=1
For, x=-1,f(-1)=1
e. f(x)=(x2+1)/(x2+2)
For ,x=-1,f(-1)=2/3
For, x=1,f(1)=2/3
Here for every output there are two different input. So it is not
bijection.
34.
be one to one.
=>x1=x2
fo g =f(g(x))
f(g(x1))=f(g(x2))
( fo g)(x1)=(fo g)(x2)
So, x1=x2
Meaning g(x1)=g(x2)
35.
Let, for f: A->B and g:B->C and fo g: A->C. Here f and fog are
corresponding to C.