0% found this document useful (0 votes)
11 views27 pages

Assignment 1 (Cse173.5)

The document contains various assignments and exercises related to propositional logic, set theory, and functions. It includes logical statements, truth tables, power sets, and the analysis of functions regarding their one-to-one and onto properties. The content is structured in chapters with specific problems and solutions presented clearly.

Uploaded by

namelessghost610
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views27 pages

Assignment 1 (Cse173.5)

The document contains various assignments and exercises related to propositional logic, set theory, and functions. It includes logical statements, truth tables, power sets, and the analysis of functions regarding their one-to-one and onto properties. The content is structured in chapters with specific problems and solutions presented clearly.

Uploaded by

namelessghost610
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

CSE173

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.

c. You get promoted if and only if you have connections.

d. Your mind will decay if and only if you watch television.

e. The trains run late if and only if I take them.


34.

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:

Let’s assume A is a knight.


So, whatever A says is true.
As A said, At least one of us is a knave, then it’s really
true. That means B is a knave.
So, A is a knight and B is a knave.

Case 2:

Let’s assume A is a knave.


So, whatever A says is false.
As A said, At least one of us is a knave, then it’s wrong.
Meaning there is no knave.
But we assumed that A is a knave. So it gives us a
contradictory result.
So, we can say case 1 is correct and A is a knight and B is
a knave.

20.
Case 1:

Let’s assume A is a knight.


So, whatever A says is true.
As A said, The two of us are both knights, then it’s really
true.
Therefore, A and B both should be knights. But, B said, A
is a knave. As B is a knight, then this statement should be
also true.
But we assumed that A is a knight. So, this gives us a
contradictory result.

Case 2:

Let’s assume A is a knave.


So, whatever A says is false.
As A said, The two of us are both knights, then it’s really
wrong. Meaning, there is only one knight or no knights.
Again B is saying that, A is a knave. As we have already
assumed A is a knave and B is also saying the same, that
means B is truthful. So B is a knight. So, A is a knave and
B is a knight.
So, we can say case 2 is correct and A is a knave and B is
a knight.

21.
Case 1:

Let’s assume A is a knight.


So, whatever A says is true.
As A said, I am a knave or B is a knight, then it’s really
true. To make this statement true, either A has to be a
knave or B has to be a knight. Or both parts have to be
true. But we assumed that A is a knight. So the first part of
A’s statement is false.
Now the only option left to make A’s statement true is B
has to be a knight. So, A is a knight and B is also a knight.

Case 2:

Let’s assume A is a knave.


So, whatever A says is false.
As A said, I am a knave or B is a knight, then it’s false. To
make this statement false, A can’t be a knave and B can’t
be a knight. But we already assumed that A is a knave.
Which makes A’s statement true. So it gives us a
contradictory result.
So, we can say case 1 is correct and A is a knight and B is
a Knight.

22.
Case 1:

Let’s say A and B are knights.


So, whatever they say is true.
As they are claiming that they are knights, then they are
truly knights.
So A and B are knights.
Case 2:

Let’s say A and B are knaves.


So, whatever they say is false.
As they are claiming that they are knights, then it’s wrong
and they are both knaves. So A and B are knaves.

So, we can see that both cases can be correct. So it’s


impossible to come up with any definite solution to who is
knave or who is knight. So It can’t be determined.

23.
Case 1:

Let’s assume A is a knight.


So, whatever A says is true.
As A said, We are both knaves, then it’s really true. But we
assumed that A is a knight. So it gives us a contradictory
result.

Case 2:

Let’s assume A is a knave.


So, whatever A says is false.
As A said, We are both knaves, then it’s wrong. Meaning
either one of them is knave or there is no knave.
As we assumed that A is a knave, then B must be a knight
to make A’s statement false.
So, A is a knave and B is a knight.
So, we can say case 2 is correct and A is a knave and B is
a knight.
Chapter 2.1

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.

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.

b.f(m,n)=m2+n2 isn’t an onto function as the output will


only be positive.
f(1,2)=5
f(-1,-3)=10

So, f(m,n)=m2+n2 is not an onto function.


c.f(m,n)=m is an onto function as m is ℤ then output
is also ℤ.
f(1,2)=1
f(-3,-1)=-3

So, f(m,n)=m is an onto function.

d.f(m,n)=|n| isn’t an onto function as the output will


only be positive.

f(1,2)=2
f(-1,-2)=2

So, f(m,n)=m is not an onto function.

e.f(m,n)=m-n is an onto function as the output will be


ℤ.

f(1,2)=-1
f(-4,5)=-9

So, f(m,n)=m-n is an onto function.


16.
a.​Every student has only one mobile number and
every student uses their own mobile number then
the function is an one to one function.
b.​Every student has only one unique identification
number then it is an one to one function.
c.​If all the students gets only one different unique
grades then the final grade at the class is an one
to one function.
d.​Every one has only one unique home town then
home will be an one to one function.

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

Here for input ℝ the output belongs to ℝ and one

output corresponds to one input ,so the function is

bijection.

b. f(x)=-3x+7

For x=1,f(1)=-3+7=4

x=-1,f(-1)=4

For one input there are two different inputs. So the

function is not one to one function . thus not a

bijection.

c.f(x)=(x+1)(x+2)

For, x=-1,f(-1)=0

x=-2,f(-2)=undefined

In domain -2 doesn’t exist. So the function is not onto . thus not

bijection.

d. f(x)=x5+1

For ,x=1,f(1)=2
For, x=-1,f(-1)=0

Here for every output in R there is exactly one input in r. So the

function is both onto and one to one. Thus it is bijection.

23.

a. d. f(x)=2x+1

For ,x=1,f(1)=3

For, x=2,f(2)=5

Here for every output in R there is exactly one input in R. So

the function is both onto and one to one. Thus it is bijection.

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

Here for every output in R there is exactly one input in r. So the

function is both onto and one to one. Thus it is bijection.

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.

In one to one function if f(x1)=f(x2) then, x1=x2 must be true to

be one to one.

As f(x) is one to one then


f(x1)=f(x2)

=>x1=x2

fo g =f(g(x))

fo g is one to one then

f(g(x1))=f(g(x2))

( fo g)(x1)=(fo g)(x2)

So, x1=x2

Meaning g(x1)=g(x2)

So, g is an one to one function.

35.

Let, for f: A->B and g:B->C and fo g: A->C. Here f and fog are

onto function. This implies that A corresponds to all the

elements of B and C. But it says nothing about B

corresponding to C.

If A={a1,a2} , B={b}, C={c}


f(a1)=b and (fog)(a2)=c

So, f and fog onto function but nothing is said about g. So it is

not certainly an onto function.

You might also like