Chapter 1 Discrete Structures Notes
Additional hints on solving logic problems. Truth tables may be used on their own or to show that statements are logically equivalent. They are also used to show tautologies, contradictions and contingencies.
If you are asked to produce a truth table, you need only show what the truth value of the statement is given for each of the combinations of values for the variables. (See Table 2 in section 1.2)
To show that two statements are
logically equivalent, you need to show the columns giving their truth values
agree. (See Table 4 in section 1.2. Column 5 agrees with column 8) One way to do this is
to do a truth table for the left hand side and then do one for the right hand side. If
they agree, the statements are logically equivalent. (Logically equivalent
statements are those with <=>.) The double allow indicated that the
statements are logically equivalent. In addition to doing a truth table, you need to state
that since the statement on the left hand side produces the same truth values as the
statement of the right hand side, the two statements are logically equivalent.
You can also show that statements are logically equivalent using the rules
below to show that the right and left sides reduce to the same thing. (See example 5
in section 2.)
To show that an implication is a
tautology, you need to show that the the truth value for every combination of input values is TRUE. (p^q)->p is a tautology since the truth value for the expression is true for all combinations of input values. In addition to the truth table, you need to state since the value of the statement is true for all combinations of values for the input variables, the statement is a tautology.
| p | q | p^q | (p^q)->p |
| T | T | T | T |
| T | F | F | T |
| F | T | F | T |
| F | F | F | T |
contradiction, you need to show that the truth value for every combination of input values is FALSE.
contingency, you need to show that the truth value for the combination of input values has at least on TRUE and one FALSE
Variables are letters such as p,q and r. Values are TRUE and FALSE.
The Relationship of Logic, Sets and Boolean Algebra. As you can see from the table below, there is a correspondence among the symbols of logic, sets and Boolean Algebra. All the laws that apply to one, generally apply to the other two. For Logic and Boolean Algebra, there is a one to one relationship. Sets are a bit more complicated since they can take more than two values; however, they generally have similar laws. Click here for truth tables.
| Logic | Sets | Boolean | Comments |
| ^ | Intersection | * | AND |
| V | Union | + | OR |
| - | Ä | ` | NOT |
| T | U | 1 | TRUE |
| F | Ø | 0 |
| Basic Laws | |||
| Name | Logical Equivalencies | Boolean Identities | Set Identities |
| Identity laws | p ^ T <-> p p V F <-> p |
x*1=1 x+0=x |
A U Ø = A A ^ U = A |
| Domination | p V T <-> T p ^ F <-> F |
x+1=1 x*0=0 |
A U U = U A ^ Ø = Ø |
| Idempotent | p V P <-> p p ^ p <-> p |
x+x = x x*x = x |
A U A = A A ^ A = A |
| Double negation | ~p(~p) <-> p | ~(~x) = x | ~(~A)=A |
| Commutative | p V q <-> q V p p ^ q <-> q ^ p |
x+y = y+x x*y = y*x |
A U B = B U A A ^ B = B ^ A |
| Associative | (pVq)Vr<->pV(qVr) (p^q)^r<->p^(q^r) |
(x+y)+z = x+(y+z) (x*y)*z = x*(Y*z) |
(AUB)UC=AU(BUC) (A^B)^C=A^(B^C) |
| Distributive | pV(q^r)<->(pVq)^(pVr) p^(qVr)<->(p^q)V(p^r) |
x+yz = (x+y)(x+z) x(y+z) = xy+xz |
A U (B^C) = (A^B) U (A^C) A ^ (BUC) = (A U B) ^ (A U C) |
| DeMorgan | ~(p^q)<->~pV~q ~(pVq)<->~p^~q |
~(xy) = ~x+~y ~(x+y) = ~(xy) |
~(A U B) = ~A ^ ~B ~(A ^ B) = ~A U ~ B |
| + | 0 | 1 | * | 0 | 1 | ` | |||
| 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | ||
| 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 |
Functions:
Summmations and Sequences
| write out | 1 2 3 4 5 6 7 |
| reverse | 7 6 5 4 3 2 1 |
| add | 8 8 8 8 8 8 8 (7 8's) |
| this suggests the formula | (7*8)/2 = the SUM |
| or, more generally | [n(n+1)]/2 |
| Computer Versions of Sequences and Summations | ||
| Problem | Program | Results |
| The sequence from 1 to 100 of {bn} where bn = (-1)n (Ex. 2) | DO I = 1 TO 100 PRINT(B(I)**N) END |
{-1,1,-1,1...} |
| Summation of 1/j where j= 1 to 100 (Ex 8) | SUM=0 DO J=1 TO 100 SUM=SUM + 1 / (A(J) END |
SUM=1+1/2,+1/3+1/4+1/5.....+1/100 |
| Summation of i from 1 to 4 of the summation of j from 1 to 3 of i*j (ex. 13) [Double Summation] | SUM=0 DO I=1 TO 4 DO J=1 TO 3 SUM + SUM + I * J END END |
SUM=1*1 + 1*2 + 1*3 + 2*1 + 2*2 + 2*3... = 60
|
Complexity of Algorithms:
You are the visitor to this site.