You are on page 1of 6

Discrete math

A. Saad Imran (199699120)


A. Saad Imran (199699120)

1. Use a truth table to determine if the argument given is valid or invalid.

p q p→q r p∨r q∨r


F F T F F F
F T T F F T
T F F F T F
T T T F T T
F F T T T T
F T T T T T
T F F T T T
T T T T T T

The argument is invalid based on the values of this truth table.

2. Use the method of proof by contradiction to prove that log25 is irrational.

Lets start by assuming that the result of log25 is rational.

p
Rational numbers can be expressed as a ratio of two natural numbers in the form where
q
q≠0 .
p
We can now assume that log25 = .
q

We must recall that a logarithm is defined as any function that is an inverse of an exponential
function. Using this information, we can simplify our assumption using a base 2 exponential
function.
p
2 q =5
2 p=5q

We can see that no two natural numbers can never satisfy the equation and this is a
contradiction to our initial assumption.

∴ we can conclude that log25 is irrational.

3. Use the method of Mathematical Induction to prove that


n
n(n+1)
∑ k= 2
k=1

4. Use the Euclidean algorithm to find the greatest common divisor of 432 and 81.

432 = 81 * 5 + 27
81 = 27 * 3 + 0
A. Saad Imran (199699120)

gcd(432, 81) = gcd (81, 27) = 27

5. Find the sum of all the positive integer divisors of 648.


648 / 2 = 324
324 / 2 = 162
162 / 2 = 81
81 / 3 = 27
27 / 3 = 9
9/3=3
3/3=1

648 = 23 * 34
Sum = (20 + 21 + 22 + 23) * (30 + 31 + 32 + 33 + 34)
= (1 + 2 + 4 + 8) * (1 + 3 + 9 + 27 + 81) = (15) (121) = 1815

2 x+3
6. Let f (x)=
5−3 x
(a) What is the domain of f(x)?
5 5
dom(f )={x ∈ℝ /x≠ }=ℝ ∖{ }
3 3

(b) Show that f(x) is 1 – 1 on its domain


Suppose f(a) = f(b).
To show f is 1-1 on its domain, we need to show a=b, ∀ a ,b∈dom ( f )
We have:
2 a+3 2 b+3
=
5−3 a 5−3 b

→(2 a+3)(5−3 b)=(2 b+3)(5−3 a)


→10 a−6 ab +15−9 b=10 b−6 ab+15−9 a
→10 a−10 b−6 ab+6 ab+15−15−9 b=−9 a
→−9 b=−9 a
→b=a
∴ f is 1-1 on its domain

(c) Find f-1(x), the inverse of f(x) and hence find the range of f(x)
Let x = f(y) so that y = f-1(x)
2 y +3
Then x= and is simplified to the following:
5−3 y
−3−5 x
y=
2+3 x
−1 −2 −2
Now, range (f )=dom(f )={x ∈ℝ/ x≠ }=ℝ ∖ { }
3 3

7. Convert the decimal number 2748 to


A. Saad Imran (199699120)

(a) octal
Division Remainder
2748 / 8 = 343 4
343 / 8 = 42 7
42 / 8 = 5 2
5/8=0 5
274810 = 52748

(b) binary

Division Remainder
2748 / 2 = 1374 0
1374 / 2 = 687 0
687 / 2 = 343 1
343 / 2 = 171 1
171 / 2 = 85 1
85 / 2 = 42 1
42 / 2 = 21 0
21 / 2 = 10 1
10 / 2 = 5 0
5/2=2 1
2/2=1 0
1/2=0 1
274810 = 1010101111002

(c) hexadecimal

Division Remainder
2748 / 16 = 171 12 (C)
1374 / 16 = 10 11 (B)
10 / 16 = 0 10 (A)
274810 = ABC16

8. Permutation (order matters):


n!
P(n , r )=
(n−r) !

Combination (order doesn’t matter):


n!
C( n ,r )=
r !(n−r )!

How many bit string of length 11 have


(a) 5 ones?
A. Saad Imran (199699120)

11! 11 ! 7∗8∗9∗10∗11
C(11,5 )= = = =462
5 ! (11−5)! 5! (6)! 5∗4∗3∗2

(b) An even number of ones?

11!
C(11,0 )= =1
0! (11−0)!
11! 11! 10∗11
C(11,2)= = = =55
2 !(11−2)! 2 !( 9)! 2
11! 11! 8∗9∗10∗11
C(11,4 )= = = =330
4 ! (11−4) ! 4 ! (7)! 4∗3∗2
11! 11 ! 6∗7∗8∗9∗10∗11
C(11,6 )= = = =462
6 !(11−6)! 6 ! (5)! 6∗5∗4∗3∗2
11! 11! 4∗5∗6∗7∗8∗9∗10∗11
C(11,8 )= = = =165
8! (11−8)! 8 !(3)! 8∗7∗6∗5∗4∗3∗2
11 ! 11 !
C(11,10 )= = =11
10 ! (11−10)! 10! (1) !
Even number of ones = 1 + 55 + 330 + 462 + 165 + 11 = 1024

(c) Less than 4 ones?

11!
C(11,0 )= =1
0! (11−0)!
11! 11 ! 11!
C(11,1)= = = =11
1 !(11−1)! 1 !(11−1)! 1! (10)!
11! 11! 10∗11
C(11,2)= = = =55
2 !(11−2)! 2 !( 9)! 2
11! 11 ! 9∗10∗11
C(11,3 )= = = =165
3 ! (11−3) ! 3 !(8) ! 3∗2
Answer = 1 + 11 + 55 + 165 = 232

(d) More than 8 zeroes?


11! 11 ! 10∗11
C(11,9 )= = = =55
9! (11−9)! 9 ! (2)! 2
11 ! 11 !
C(11,10 )= = =11
10 ! (11−10)! 10! (1) !
11 ! 11!
C(11,11)= = =1
11 !(11−11)! 11!( 0)!
Bit strings of length 11 which have more than 8 zeroes = 1 + 11 + 55 = 67

(e) The same number of zeroes and ones?


11! 11 ! 7∗8∗9∗10∗11
C(11,5 )= = = =462
5 ! (11−5) ! 5! (6)! 5∗4∗3∗2
11! 11 ! 6∗7∗8∗9∗10∗11
C(11,6 )= = = =462
6 !(11−6)! 6 ! (5)! 6∗5∗4∗3∗2
A. Saad Imran (199699120)

Answer = 462 + 462 = 924

You might also like