Download Let F(x,y)

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Location arithmetic wikipedia , lookup

Infinity wikipedia , lookup

Mathematical proof wikipedia , lookup

Abuse of notation wikipedia , lookup

History of the function concept wikipedia , lookup

Infinitesimal wikipedia , lookup

Georg Cantor's first set theory article wikipedia , lookup

Large numbers wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Function (mathematics) wikipedia , lookup

Principia Mathematica wikipedia , lookup

Hyperreal number wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Non-standard calculus wikipedia , lookup

Real number wikipedia , lookup

Collatz conjecture wikipedia , lookup

Addition wikipedia , lookup

Elementary mathematics wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
CS104 – DISCRETE STRUCTURE
Construct a truth table for each of these compound propositions.
1. (p ∨¬q) → q
2. (p ∨ q) → (p ∧ q)
p
q
T
T
T
F
F
T
F
F
¬q
(p ∨¬q)
(p ∨¬q) → q
(p ∨ q)
(p ∧ q)
(p ∨ q) → (p ∧ q)
Let Q(x) = “x3 <= 27”. What is the value of  x Q(x), if the domain consist of all
integers?
Ans. True – e.g. for x = 3, x3 = 27.
Determine the truth value of the statement xy (x <= y2 ) if the domain for
the variables consists of the positive real numbers
Ans. False as for any particular value of x, say x = 5, y2 < 5 for y < 3 i.e. does not
hold for all y.
Write the converse, contrapositive and inverse of the sentence: "If Yasir is a
math major then Yasir is lucky"
Converse: If Yasir is lucky then Yasir is a math major
Contrapositive: If Yasir is not lucky then Yasir is not a math major
Inverse: If Yasir is not a math major then Yasir is not lucky
Let P(x,y) be the statement “x+y=y”, where the domain consists of all real
numbers. The truth value of the quantification xy P(x,y) is:
a. true
b. false
c. not a valid proposition
d. can be true or false
Let F(x,y) be the statement “x follows y”, where the domain consists of all twitter
users. The statement “there is a user who follows everyone on twitter” can be
expressed as:
a. xy F(x,y)
b. xy F(x,y) c. xy F(x,y)
d. xy F(x,y)
Let C(X) be "x can program in C++ ", J(X) be "x can program in Java", where
the domain consists of all CCIS students. The statement "any student who can
program in C++ can program in java "can be expressed as:
a. x (C(X) →J(X))
b. x (C(X) →J(X))
c. x (C(X) J(X))
d. x (C(X) J(X))
If the domain of x consists of numbers between 1 and 100, then the expression x
P(x) is equivalent to:
a. x P(x)
b. x P(x)
c. P(1)P(2)….P(100)
d. P(1)P(2)…P(100)
Negate the following expressions :
Expression
Negation
x (x4 > x)
 x (x4 <= x)
xy (x < y)
xy (x >= y)
Let P(x) denote the statement “x ≤ 4.” What are these truth values?
a) P(0)
b) P(4)
c) P(6)
a)T b)T c)F
Translate in two ways each of these statements into logical expressions using
predicates, quantifiers, and logical connectives. Let the domain consist of the
students in your class
a) Someone in your class can speak French.
b) Everyone in your class have mobile phone.
c) There is a person in your class who was not born in California.
d) A student in your class has been to Macca.
e) No student in your class has taken a course in programming one.
ANSWER:
Let C(x) be the propositional function “x is in your class.”
a) ∃xF(x) , where F(x) is “x can speak French”
b) ∀xP(x), where P(x) is “x is mobile phone”
c) ∃x¬B(x), where B(x) is “x was born in California”
d) ∃xM(x), where M(x) is “x has been to Macca”
e) ∀x¬L(x), where L(x) is “x has taken a course in programming one”
What kind of proof you will use to prove that the sum of two odd integers is
even. Write the equation for your proof as well.
Direct Proof.
Let n = 2k + 1 and m = 2l + 1 be odd integers. Then n+m=2(k +l +1) is
even.
What kind of proof you will use to prove that the sum of an irrational
number and a rational number is irrational.
Suppose that r is rational and i is irrational and s = r + i is rational. Then by
Example 7, s+(−r) = i is rational, which is a contradiction.
Prove or disprove that the product of two irrational numbers is irrational.
Because√2·√2 = 2 is rational and√2 is irrational, the product of two
irrational numbers is not necessarily irrational.
In how many different ways can the letters of the word
'CORPORATION' be arranged so that the vowels always come
together?
The word 'CORPORATION' has 11 letters. It has the vowels 'O','O','A','I','O' in
it and these 5 vowels should always come together. Hence these 5 vowels
can be grouped and considered as a single letter. that is, CRPRTN(OOAIO).
Hence we can assume total letters as 7. But in these 7 letters, 'R' occurs 2
times and rest of the letters are different.
Number of ways to arrange these letters = 7!/2!=7×6×5×4×3×2×1/2×1=2520
In the 5 vowels (OOAIO), 'O' occurs 3 and rest of the vowels are different.
Number of ways to arrange these vowels among themselves = 5!/3!=5×4×3×2×1/3×2×1=20
Hence, required number of ways = 2520 x 20 = 50400
2.3 Functions 2.3
EXAMPLE 13 Is the function f (x) = x2 from the set of integers to the set of integers onto?
Solution: The function f is not onto because there is no integer x with x2 = −1, for instance.
▲
EXAMPLE 14 Is the function f (x) = x + 1 from the set of integers to the set of integers onto?
Solution: This function is onto, because for every integer y there is an integer x such that
f (x) = y. To see this, note that f (x) = y if and only if x + 1 = y, which holds if and only if x = y − 1.
EXAMPLE 20 Let f be the function from R to R with f (x) = x2. Is f invertible?
Solution: Because f (−2) = f (2) = 4, f is not one-to-one. If an inverse function were defined,
it would have to assign two elements to 4. Hence, f is not invertible. (Note we can also show
that f is not invertible because it is not onto.)
▲
Sometimes we can restrict the domain or the codomain of a function, or both, to obtain an
invertible function, as Example 21 illustrates.
EXAMPLE 21 Show that if we restrict the function f (x) = x2 in Example 20 to a function from the set of all
None negative real numbers to the set of all nonnegative real numbers, then f is invertible.
Solution: The function f (x) = x2 from the set of non-negative real numbers to the set of nonnegative real numbers is
one-to-one. To see this, note that if f (x) = f (y), then x2 = y2, so x2 − y2 = (x + y)(x − y) = 0. This means that x + y =
0 or x − y = 0, so x = −y or x = y. Because both x and y are nonnegative, we must have x = y. So, this function is oneto-one. Furthermore, f (x) = x2 is onto when the codomain is the set of all nonnegative real numbers, because each
nonnegative real number has a square root. That is, if y is a nonnegative real number, there exists a nonnegative real
number x such that x =√y, which means that x2 = y. Because the function f (x) = x2 from the set of nonnegative real
numbers to the set of nonnegative real numbers is one-to-one and onto, it is invertible. Its inverse is given by the rule
f−1(y) =√y.
Chapter 9.1
7. Determine whether the relation R on the set of all integers is reflexive, symmetric, antisymmetric, and/or
transitive, where (x, y) ∈ R if and only if
a) x _= y. b) xy ≥ 1.
c) x = y + 1 or x = y − 1.
d) x ≡ y (mod 7). e) x is a multiple of y.
f ) x and y are both negative or both nonnegative.
g) x = y2. h) x ≥ y2.
7. a) Symmetric b) Symmetric, transitive c) Symmetric d) Reflexive, symmetric, transitive e) Reflexive, transitive f)
Reflexive, symmetric, transitive g) Antisymmetric h) Antisymmetric, transitive
Let R be a relation over the integers defined as follows:
aRb ↔ (a/b is an integer)
Answer and give reasons for the following:
(a) Is R a reflexive relation?
(b) Is R a symmetric relation?
(c) Is R a transitive relation?
(d) Is R a equivalence relation?
Ans:
(a) R is a reflexive relation because a/a = 1 always.
(b) R is not symmetric relation. Counterexample: 2R1 but 1 is not related to 2.
(c) R is a transitive relation, because if aRb and bRc then aRc because a will be a multiple of c.
(d) R not an equivalence relation since it is not symmetric.
Let L(x) = “x is a lion”, F(x) = “x is fierce”, and C(x) = “x drinks coffee”. Show the quantifiers for
the statements.
i. All lions are fierce.
x (L(x)  F(x))
ii. Some lions don’t drink coffee.
x (L(x)  C(x))
iii. Some fierce creatures don’t drink coffee.
x (F(x)  C(x))
Let Q(x, y) be the statement “x + y = 0”. What is the truth values of the quantifications
yxQ(x, y).
yxQ(x, y) = “There is a real number y such that for every real number x, x + y = 0”.
Since there is no real number y such that x + y = 0, for all real numbers x, the proposition
yxQ(x, y) is false.
In other words choosing 3 balls out of 16, or choosing 13 balls out of 16 have
the same number of combinations.
16!
3!(16-3)!
=
16!
13!(16-13)!
=
16!
3!×1
= 560
How many different committees of 5 people can be chosen from 10 people?
In choosing a committee, order doesn't matter; so we need the number of
combinations of 5 people chosen from 10
=C(10,5
= 10!/(5!)(5!)
= (10 × 9 × 8 × 7 × 6)/(5 × 4 × 3 × 2 × 1)
= 30,240/120
= 252
A phone number consists of 7 digits (a digit is a number 0, 1, 2, . . . 9). The first digit of a
phone number cannot be 0 or 1.
How many phone numbers are possible?
Solution: 8 *106 = 8000000 total phone numbers
How many phone numbers start with the digits 9-1-1?
Solution: 1*1*1*104 = 104 phone numbers that start with 9-1-1
How many phone numbers do not start with 9-1-1?
Solution: 8 * 106 - 104 = 7990000 phone numbers
How many 7-digit telephone numbers are possible if only odd digits may be used?
Solution: In this case options are 1,3,5,7,9 thus the choices are 57 = 78125 phone numbers.
How many ways can you choose 3 toppings to go on a pizza if there are 12 toppings to choose
from?
C(12,3)
Suppose you are in a theatre and there are 6 seats in a row.
How many ways can 6 people occupy these seats?
P(6,6)
How many ways can we seat 6 people in these seats if there are 15 people?
P(15,6)
Consider the below graph. Fill the following table:
V
Deg+(v)
Deg-(v)
1
3
0
2
3
3
3
3
4
4
1
3
Draw these graphs:
Draw a K7 on the vertex set V = fa; b; c; d; e; f; gg. Also draw the adjacency
matrix for the K7
a. Find the adjacency matrix of the following graph.
1
1
2
3
4
5
1
0
1
0
1
1
2
0
0
0
1
0
3
0
0
0
0
1
4
0
0
0
0
0
5
1
0
0
0
0
2
5
4
3
b. Find Spanning Tree of the following graph.
State the converse, contrapositive, and inverse of the sentence: “If it snows tonight,
then I will stay at home”.
Answer:
Converse: If I stay home, then it will snow tonight.
Contrapositive: If I do not stay home, then it will not snow tonight.
Inverse: If it does not snow tonight, then I will not stay home.
Let p and q be two propositions, where
p: “You get an A on the final exam”
q: “You do every exercise in the book”
r: “You get an A in the course”
Translate the following statements into logical expression
You get an A in the course but you do not do every exercise in the book
Answer: pq
You get an A on the final, you do every exercise in the book and you get an A
in the course.
Answer: pqr
To get an A in the course, it is necessary for you to get an A on the final
Answer: r  p
The principle of mathematical induction is used to prove that a given proposition
(formula, equality, inequality…) is true for all positive integer numbers greater than or
equal to some integer N.
Let us denote the proposition in question by P (n), where n is a positive integer. The
proof involves two steps:
Step 1: We first establish that the proposition P (n) is true for the lowest possible value
of the positive integer n.
Step 2: We assume that P (k) is true and establish that P (k+1) is also true
Problem 1:
Use mathematical induction to prove that
1 + 2 + 3 + ... + n = n (n + 1) / 2
for all positive integers n.
Solution to Problem 1:

Let the statement P (n) be
1 + 2 + 3 + ... + n = n (n + 1) / 2

STEP 1: Basic step: We first show that p (1) is true. (prove by basis)
Left Side = 1
Right Side = 1 (1 + 1) / 2 = 1

Both sides of the statement are equal hence p (1) is true.

STEP 2: Inductive step: We now assume that p (k) is true (prove by Induction)
1 + 2 + 3 + ... + k = k (k + 1) / 2

and show that p (k + 1) is true by adding k + 1 to both sides of the above
statement
1 + 2 + 3 + ... + k + (k + 1) = k (k + 1) / 2 + (k + 1)
= (k + 1)(k / 2 + 1)
= (k + 1)(k + 2) / 2

The last statement may be written as

1 + 2 + 3 + ... + k + (k + 1) = (k + 1)(k + 2) / 2
(prove by Induction
Which is the statement p(k + 1).
Problem 3:
Use mathematical induction to prove that
1 3 + 2 3 + 3 3 + ... + n 3 = n 2 (n + 1) 2 / 4
for all positive integers n.
Solution to Problem 3:

Statement P (n) is defined by
1 3 + 2 3 + 3 3 + ... + n 3 = n 2 (n + 1) 2 / 4

STEP 1: Basic step: We first show that p (1) is true.
Left Side = 1 3 = 1
Right Side = 1 2 (1 + 1) 2 / 4 = 1

hence p (1) is true.

STEP 2: Inductive step: prove by Induction: We now assume that p (k) is true
1 3 + 2 3 + 3 3 + ... + k 3 = k 2 (k + 1) 2 / 4

add (k + 1) 3 to both sides
1 3 + 2 3 + 3 3 + ... + k 3 + (k + 1) 3 = k 2 (k + 1) 2 / 4 + (k + 1) 3

factor (k + 1) 2 on the right side
= (k + 1) 2 [ k 2 / 4 + (k + 1) ]

set to common denominator and group
= (k + 1) 2 [ k 2 + 4 k + 4 ] / 4
= (k + 1) 2 [ (k + 2) 2 ] / 4

We have started from the statement P(k) and have shown that
1 3 + 2 3 + 3 3 + ... + k 3 + (k + 1) 3 = (k + 1) 2 [ (k + 2) 2 ] / 4
Which is the statement P(k + 1). Inductive step