web viewto append three check digits onto the following messages, creating a seven-digit code word....

25
Discrete II Chapter 17.1 Boolean Logic Notes – Binary Codes Name:_____________________________ Objective: The learner will be able to use the Venn Diagram method to code 4-digit binary messages into 7-digit code words and to determine ho to correct single digit errors in coding. _________________________________________________________________________________________________ ___________________ A. Code Words 1. Using 1 or 0 each circle must be an even amount. 2. Place 0 or 1 in positions 5,6,7 to make each circle add up to an even number. Such as 0, ,2, 4 This is called Even Parity . Use the Venn diagram method to append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. 1) put the digits in order into the Venn diagram 2) the remaining areas (5, 6, 7) are assigned 0 or 1 to make the numer of 1’s in each circle even. 3) The 7-digit code word lists the digits of the seven areas in order. Message Code word Message Code Word 0000 0111 0001 1001 0010 1010 0100 1100

Upload: ngothuy

Post on 30-Jan-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Discrete II Chapter 17.1 Boolean Logic Notes – Binary CodesName:_____________________________

Objective: The learner will be able to use the Venn Diagram method to code 4-digit binary messages into 7-digit code words and to determine ho to correct single digit errors in coding.

____________________________________________________________________________________________________________________

A. Code Words

1. Using 1 or 0 each circle must be an even amount.

2. Place 0 or 1 in positions 5,6,7 to make each circle add up to an even number.

Such as 0, ,2, 4

This is called Even Parity.

Use the Venn diagram method to append three check digits onto the following messages, creating a seven-digit code word. Complete the table below.

1) put the digits in order into the Venn diagram

2) the remaining areas (5, 6, 7) are assigned 0 or 1 to make the numer of 1’s in each circle even.

3) The 7-digit code word lists the digits of the seven areas in order.

Message Code word Message Code Word

0000 0111

0001 1001

0010 1010

0100 1100

1000 1011

0011 1101

0101 1110

0110 1111

Page 2: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Objective: to check and recode a given message.

1) enter the given message into the Venn Diagram and check to see if each circle is even.

2) If all circles are even, the message is coded properly.

3) If one or more circles are odd, change ONE area in the diagram to make them all even.

4) List the recoded message

Code Received Message received Coded properly? (Y/N)

Corrected code Actual message

1. 0001000

2. 0110011

3. 0110000

4. 1100101

5. 1111100

6. 0111100

7. 1101000

8. 0110010

9. 0011100

10. 0111101

11 1111000

12. 0101000

13. 0001010

14. 0111001

15. 0011110

16. 0111000

17. 0001111

- 2 -

Page 3: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

18. 0111010

Discrete II Chapter 17.2 Boolean Logic Notes – Nearest Neighbor Decoding Name:_____________________________Objective(s): The learner will be able to use Nearest Neighbor decoding to decode received code words with two or more possible errors.distance between two strings: number of positions in which two code words differ

Find the distance between each of the following pairs of words. (How many digits are different?)

1. 11011011 and 10100110 2. 110101 and 111110 3. 1011111 and 1101111 4. 1010110 and 1000110

Nearest Neighbor method: 1) find the distance between the received code word and each possible code word 2) decode as the possible code word with the smallest distance from the received code word 3) if 2 code words have the same smallest distance from the received code word, there is no code word

PossibleCode Words 1) for the received code word 0001001, use the nearest neighbor method to find

A 0000000 the best possible code wordB 0001011C 0010110 distances: A = B = C = D = E = F = G = H =D 0100101 I = J = K = L = M = N = O = P = E 1000111F 0011101 best possible code word = G 0101110H 0110011 2) for the received code word 1001001, use the nearest neighbor method to findI 0111000 best possible code wordJ 1001100K 1010001 distances: A = B = C = D = E = F = G = H =L 1100010 I = J = K = L = M = N = O = P = M 1011010N 1101001 best possible code word = O 1110100P 1111111

PossibleCode Words 3) for the received code word 1100111, use the nearest neighbor method to find

A 0000000 the best possible code wordB 0001011C 0010110 distances: A = B = C = D = E = F = G = H =D 0100101 I = J = K = L = M = N = O = P = E 1000111F 0011101 best possible code word = G 0101110H 0110011 4) for the received code word 0011001, use the nearest neighbor method to findI 0111000 best possible code wordJ 1001100K 1010001 distances: A = B = C = D = E = F = G = H =L 1100010 I = J = K = L = M = N = O = P = M 1011010N 1101001 best possible code word =

- 3 -

Page 4: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

O 1110100P 1111111

Name: ________________________________________________________________________________________ Date _____________

Discrete Math 2: 17.2 – Nearest Neighbor Decoding (Page 2)Objective(s): The learner will be able to use Nearest Neighbor decoding to decode received code words with two or more possible errors.

PossibleCode Words 1) for the received code word 1000111, use the nearest neighbor method to find

A 0000000 the best possible code wordB 0001011C 0010110 distances: A = B = C = D = E = F = G = H =D 0100101 I = J = K = L = M = N = O = P = E 1000111F 0011101 best possible code word = G 0101110H 0110011 2) for the received code word 1000001, use the nearest neighbor method to findI 0111000 best possible code wordJ 1001100K 1010001 distances: A = B = C = D = E = F = G = H =L 1100010 I = J = K = L = M = N = O = P = M 1011010N 1101001 best possible code word = O 1110100P 1111111

PossibleCode Words 3) for the received code word 0001000, use the nearest neighbor method to find

A 0000000 the best possible code wordB 0001011C 0010110 distances: A = B = C = D = E = F = G = H =D 0100101 I = J = K = L = M = N = O = P = E 1000111F 0011101 best possible code word = G 0101110H 0110011 4) for the received code word 0111101, use the nearest neighbor method to findI 0111000 best possible code wordJ 1001100K 1010001 distances: A = B = C = D = E = F = G = H =L 1100010 I = J = K = L = M = N = O = P = M 1011010N 1101001 best possible code word = O 1110100P 1111111

5) For each of the codes in 1-4, assume they are 1-digit errors. Check them using Venn diagrams to determine which digit needs to be corrected to make them valid codes.

a) 1000111 b) 1000001 c) 0001000 d) 0111101

- 4 -

Page 5: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Name: ________________________________________________________________________________________ Date _____________

Discrete Math 2: 17.3 – Data Compression (Page 1)Objective(s): The learner will be able to compress data into more efficient codes and read codes from compressed data.

To compress data: 1) determine which characters are used the most and the least2) assign shorter codes to more often used characters & longer to least often used ones3) write the message

all code assignments end in 0 except the last one, which is all 1’sfor 3 characters: most used = 0, then 10, and 11for 4 characters: 0, 10, 110, 111for 8 characters: 0, 10, 110, 1110, 11110, 111110, 1111110, 1111111

What would be a good assignment for 7 characters?

1) original message: ACE DECADE DAD A BAD CAB FAD

a) encode using the standard decoding of: A = 000, B = 001, C = 010, D = 011, E = 111, F = 110

code:

how many characters?:

b) encode by compressing the data

i) how often is each character used: A = ___, B = ___, C = ___, D = ___, E = ___, F = ___

ii) assign a code based on step i): A = ____, B = ____, C = ____, D = ____, E = ____, F = ____

new code:

how many characters?:

2) original message: BDEDA CDBCB ADEED BBDAD CCDDE

a) encode using the standard decoding of: A = 000, B = 001, C = 010, D = 011, E = 111

code:

how many characters?:

b) encode by compressing the data

i) how often is each character used: A = ___, B = ___, C = ___, D = ___, E = ___, F = ___

ii) assign a code based on step i): A = ____, B = ____, C = ____, D = ____, E = ____, F = ____

new code:

- 5 -

Page 6: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

how many characters?:

B. Data Compression: Decode and encode phrases using binary representation.

Given: A = 00 c = 01 T = 10 G = 11

1. Encode AAACAGTAAC

2. Encode AGAACTAATTGACA

3. Decode: 0011010110101000

Given: A = 0 C = 10 T = 110G = 111

4. Encode AAACAGTAAC

5. Encode AGAACTAATT

6. Decode: 0011010110101110

Given: A = 1111 B = 1110 C = 01 D = 110 E = 00 F = 10 (Huffman Code)

7. Encode AABFFCBEFDE

8. Decode: 11101000011010011111010010

- 6 -

Page 7: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Name: ________________________________________________________________________________________ Date _____________

Discrete Math 2: 17.3 – Decoding Compressed Data (Page 2)Objective(s): The learner will be able to decode compressed data.

1) Encode the following sequences using the given encoding schemes:

a) sequence ABCCBA scheme: A 0, B 10, C 11

code:

b) sequence ABACAB scheme: A 0, B 10, C 11

code:

c) sequence AACBCDAB scheme: A 0, B 10, C 110, D 111

code:

d) sequence AAACAGTAAC scheme: A 0, C 10, T 110, G 111

code:

2) Decode the following using the given encoding schemes:

a) code 011001010110 scheme: A 0, B 10, C 11

sequence:

b) code 1101110111100 scheme: A 0, B 10, C 11

sequence:

c) code 0111110011110110010 scheme: A 0, B 10, C 110, D 111

sequence:

d) code 01101111110111111101101010 scheme: A 0, C 10, T 110, G 1110, D 1111

sequence:

e) code 0110110111100110111111 scheme: A 0, B 10, C 110, D 111

sequence:

f) code 1111111111100010011010110 scheme: X 0, Y 10, Z 110, W 1110, V 1111

sequence:

g) code 01101111111010100011101000 scheme: A 0, B 10, C 110, D 1110, E 1111

sequence:

- 7 -

Page 8: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

3) Decode the following using the given encoding schemes:

a) code 101110010110 scheme: A 0, B 10, C 11

sequence:

b) code 001101110110011111100 scheme: A 0, B 10, C 11

sequence:

c) code 1111100001100001110010 scheme: A 0, B 10, C 110, D 111

sequence:

d) code 1100110010011101111011111100 scheme: A 0, C 10, T 110, G 1110, D 1111

sequence:

e) code 0111111101110101110101000111110110000

scheme: A 0, B 10, C 110, D 1110, E 11110, F 111110, G 111111

sequence:

f) code 11111111111011111011010110111101111011111111111110111101110

scheme: X 0, Y 10, Z 110, W 1110, V 11110, Z 111110, W 1111110, V 1111111

sequence:

g) code 001111110101101111011110111111100010110110101110111101111110011000

scheme: A 0, B 10, C 110, D 1110, E 11110, F 111110, G 1111110, H 1111111

sequence:

h) code 001111110101101111011110111111100010110110101110111101111110011000

scheme: A 0, B 10, C 110, D 1110, E 11110, F 111110, G 111111

sequence:

h) code 001111110101101111011110111111100010110110101110111101111110011000

scheme: A 0, B 10, C 110, D 1110, E 11110, F 11111

sequence:

- 8 -

Page 9: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Name: ________________________________________________________________________________________ Date _____________

Discrete Math 2: 17.4 – Cryptology – Caesar CipherObjective(s): The learner will be able to decode quotes using Caesar cipher-like encoding strategies.

Cryptography – the study of methods to make and break secret codes.

Caesar Cipher – one of the first known methods. Used by Julius Caesar to send messages to troops. Every letter is shifted over by 3. A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

1. Encode ATTACK AT DAWN . 2. Decode the message “BRX MXVW VWDEEHG PH.”

3. Encode MEET AT JOES 4. Encode the message “ET TU BRUTUS.”

5. Encode the message “WARNING AMBUSH AHEAD”

6. Decode the message “BRX KDYH FRPSOHWHG SUREOHP WZR”

7. Decode the message “WKLV SUREOHP ZDV KDUG EXW BRX GLG LW”

8. Decode the message “FDHVDU FLSKHUV DUH HDVB”

9. Encode the message “I LOVE DISCRETE MATH”

10. Decode the message “LP JRRG DW WKLV” 11. Encode the message “CODING IS FUN”

12. Decode the message “NDSODQ LV D FUDCB WHDFKHU” 13. Encode the message “GO HOME NOW”

14. Decode the message “PB PLQG LV EORZQ”

15. Encode the message “THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG”

16. Decode the message “RQFH L ILQLVK LP GRQH IRU WKH SHULRG”

- 9 -

Page 10: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Name: ________________________________________________________________________________________ Date _____________

Discrete Math 2: 17.4 – Cryptology – Caesar Cipher - A1. a. Enrypt “keep this secret” with a shift of 3.

b. Encrypt your teacher’s name with a shift of 3.

Decrypt the answers to the following riddles. They were encrypted using a Caesar cipher with a shift of 3.2a. Riddle: What do you call a sleeping bull?

b. Riddle: What’s the difference between a teacher and a train?

Create a Caesar cipher with shift of 4:A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

3. Decrypt the following note Evie wrote to Abby. She used a Caesar cipher with a shift of 4

Decrypt each answer by first figuring out the shift. Let the one-letter words help you.4a. Riddle: What do you call a happy Lassie?

b. Riddle: Knock, knock. Who’s there? Cash. Cash who?

c. Riddle: What’s the noisiest dessert?

- 10 -

Page 11: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Name: ________________________________________________________________________________________ Date _____________

Discrete Math 2: 17.4 – Cryptology – Caesar Cipher - BDecode the following quotes. They use a Caesar cipher but are shifted a different number of spaces than three. Good luck!

A B C D E F G H I J K L M N O P Q R S T U V W X Y Zencrypted code:

1) “QEB BKBJV LC QEB YBPQ FP QEB DLLA BKLRDE.” -- OLDBO YOBFAFKDBO

_______________________________________________________________________________________A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

encrypted code:

2) “RC CF RC BCH. HVSFS WG BC HFM.” -- MCRO

_______________________________________________________________________________________A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

encrypted code:3) “TW CAFV OZWFWNWJ HGKKATDW. AL AK SDOSQK HGKKATDW.” -- VSDSA DSES

_______________________________________________________________________________________A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

encrypted code:4) “TWOBVX BL PATM PX TLD YHK PAXG PX TEKXTWR DGHP MAX TGLPXK UNM PBLA PX WBWG’M.” -- XKBVT CHGZ

_______________________________________________________________________________________A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

encrypted code:5) “JZF XFDE MP ESP NSLYRP JZF HLYE EZ DPP TY ESP HZCWO.” -- RLYOST

_______________________________________________________________________________________A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

encrypted code:6) “MU QHU MXQJ MU HUFUQJUTBO TE. UNSUBBUDSU, JXUD, YI DEJ QD QSJ RKJ Q XQRYJ.” -- QHYIJEJBU

_______________________________________________________________________________________A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

encrypted code:

7) “C BUPY GUXY NBCM FYNNYL FIHAYL NBUH OMOUF VYWUOMY C FUWE NBY NCGY NI GUEY CN MBILNYL.” -- VFUCMY JUMWUF

- 11 -

Page 12: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Name: ________________________________________________________________________________________ Date _____________ Discrete Math 2: 17.4 – Cryptology – Decimation Cipher

Objective(s): The learner will be able to decode quotes using Decimation cipher-like encoding strategies.

Decimation Cipher: start at A, count by the key (k), continue counting by wrapping until all letters are rewritten.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

1. Encode ATTACK AT DAWN with key = 5.

2. Encode MEET AT JOES with k = 3

3, Encode the mesasage “HASTA LA VISTA BABY” with k = 3. .

4. Encode the message “AFFINE CIPHER” using k = 5.

5. Encode the message “DRINK YOUR OVALTINE” using k = 3

6. Decode the message “ZHANYDQ IQ PUAH O PSNR EOBU A PAIN” using k = 5 .

7. Decode the message “VQICFQN OM VALM A TZQDHMK” What key makes sense, 3 or 5?

- 12 -

Page 13: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Name: ________________________________________________________________________________________ Date _____________ Discrete Math 2: 17.4 – Cryptology – Decimation Cipher A

Objective(s): The learner will be able to decode quotes using Decimation cipher-like encoding strategies.

1) a) Complete the table with key = 3.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

b) Decrypt the following message Evie wrote using a key of 3.

JAN, Y ENQO OVAF UQI OZQFM.

c) Riddle: What has one foot on each end and one foot in the middle?

Decrypt the answer

Answer: A UAZJCFYGE

2) a) Complete the table with key = 7.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

b) Decrypt the following quote.

UKP OXAPAODCP EW YXAD YC VU YXCN YC DXENS NU UNC EW ZUUSENQ.

- 13 -

Page 14: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

-H. Jackson Brown, Jr.

3) a) Complete the table with key = 5.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Decrypt the following quotes. FU MWHU QSW XWR QSWH ZUUR ON RJU HOEJR XDAKU, RJUN MRANP

ZOHI.

-Abraham Lincoln

c) RJU OIXSHRANR RJONE OM NSR RS MRSX CWUMROSNONE.

-Albert Einstein

4) a) Complete the table with key = 9.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

b) Decrypt the following quote.

PLK EWGP KZLAYGPUNC PLUNC UN VUTK UG JKUNC UNGUNSKXK.

-Anne Morrow Lindbergh

- 14 -

Page 15: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Name: ________________________________________________________________________________________ Date _____________ Discrete Math 2: 17.5 – Truth Tables

Objective(s): The learner will be able to determine true or false statements using truth tables.

Truth Tables : uses Boolean Logic, which is a statement that is either true or false.

• The expression NOT P is called the negation of P. If P is true then NOT P is false, and if P is false then NOT P is true. Thestandard mathematical notation for this is ¬P or ~P .

Example:Given: Let p represent the sentence "The number 9 is odd."

Problem: What does ~p mean?

Since p is __________, ~p must be _________.

Example:Given: Let p represent, "Baseball is a sport."

Let q represent, "There are 100 cents in a dollar."

Let r represent, "She does her homework."

Let s represent, "A dime is not a coin."

Problem: Write each sentence below using symbols and indicate if it is true, false or neither.

1. A dime is a coin.

2. Baseball is not a sport.

3. She does her homework.

4. There are not 100 cents in a dollar.

5. She does not do her homework.

6. Baseball is a sport.

We can construct a truth table to determine all possible truth values of a statement and its negation.

Definition: A truth table helps us find all possible truth values of a statement.  Each statement is either True (T) or False (F), but not both.

Example: Construct a truth table for the negation of x.

Conjunction (“and” )Example:

Given: p: Ann is on the softball team.

q: Paul is on the football team.

Problem: What does p q represent?

Solution:

- 15 -

Page 16: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Definition: A conjunction is a compound statement formed by joining two statements with the connector ________. The conjunction "p and q" is symbolized by p____q. A conjunction is true when both of its combined parts are true; otherwise it is false.

Now that we have defined a conjunction, we can apply it to the Example. The conjunction p q is true when both "Ann is on the softball team" and "Paul is on the football team" are true statements; otherwise it is false.

• The truth table is as follows.

p qp

q

T T

T F

F T

F F

Example:

Given: a: A square is a quadrilateral.

b: Harrison Ford is an American actor.

Problem: Construct a truth table for the conjunction "a and b." Also write out the sentence the expression creates.

Solution

a

ba

b

T T

T F

F T

F F

Example 4:

Given: p: The number 11 is prime. true

q: The number 17 is composite. false

r: The number 23 is prime. true

Problem: For each conjunction below, write a sentence and indicate if it is true or false.

1.p

q

2.p

r

3.q

r

Example 5: Construct a truth table for each conjunction below:

1. ~x and y

- 16 -

Page 17: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

2. ~y and x

Disjunction (“OR” )

Example:

Given: p: Ann is on the softball team.

q: Paul is on the football team.

Problem: What does p q represent?

In Example, statement p represents, "Ann is on the softball team" and statement q represents, "Paul is on the football team." The symbol _____is a logical connector which means "____." Thus, the compound statement p q represents the sentence, "Ann is on the softball team or Paul is on the football team." The statement p q is a disjunction. . A disjunction is false if and only if both statements are false; otherwise it is true

p qp

q

T T

T F

F T

F F

Example 4:

Given: p: 12 is prime. false

q: 17 is prime. true

r: 19 is composite. false

Problem: Write a sentence for each disjunction below. Then indicate if it is true or false.

1.p

q

2.p

r

3.q

r

Example 5: Complete a truth table for each disjunction

1. a or not b2. not a or b

- 17 -

Page 18: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

3.P Q ⌐Q P ∧ Q (P ∧ Q) ∨ ⌐QT TT FF TF F

4.P Q ⌐Q P ∨ Q (P ∨ Q) ∨ ⌐QT TT FF TF F

Convert the sentence to a logic expression.1) MOVIES AND POPCORN

2) MOVIES AND NOT POPCORN

3) NOT MOVIES AND NOT POPCORN

4) MOVIES AND (POPCORN OR CANDY)

5) MOVIES OR (POPCORN AND NOT CANDY)

Conditional StatementsDefinition: A conditional statement, symbolized by p q, is an _____________ statement in which p is a

hypothesis and q is a conclusion. The logical connector in a conditional statement is denoted by the symbol _________. The conditional is defined to be true unless a true hypothesis leads to a false conclusion. A truth table for p q is shown below.

Example 1: Fill in the truth table and write a sentence.

Given: p: I do my homework.

q: I get my allowance.

p qp

q

T T

T F

F T

F F

In the following examples, we are given the truth values of the hypothesis and the conclusion and asked to determine the truth value of the conditional.Example 4: What is the truth value of  r s?Given: r: 8 is an odd number. false

s: 9 is composite. true

Example 5: Write each conditional below as a sentence. Then indicate its truth value.

- 18 -

Page 19: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

Given: p: 72 = 49. true

q: A rectangle does not have 4 sides. false

r: Harrison Ford is an American actor. true

s: A square is not a quadrilateral. false

1.p

q

2.q

r

3.p

r

4.q

s

5.r

~p

6.~r

p

Compound Statements In this lesson, we will learn how to determine the truth values of a compound statement with the logical connectors ~, , and .

Example 1:

Given: p: 72 = 49 true

q: A rectangle does not have 4 sides. false

r: Harrison Ford is an American actor. true

Problem: Write each sentence below in symbolic form. Then determine its truth value.

1. If 72 = 49, then a rectangle has 4 sides.

2. If 72 49, then a rectangle does not have 4 sides.

3. If a rectangle has 4 sides, then Harrison Ford is not an American actor.

4. If Harrison Ford is an American actor, then 72 49.

5. If 72 = 49 or a rectangle does not have 4 sides, then Harrison Ford is not an American actor.

What are the truth values of the following compound statements?

1) ~p (q p) 5) q (p ~q)

2) (p q) q 6) ~b (a b)

3) (s r) ~r 7) (a b) a

4) (p q) ~q 8) ~p (p q)

- 19 -

Page 20: Web viewto append three check digits onto the following messages, creating a seven-digit code word. Complete the table below. ... HVSFS WG BC HFM.”

EquivalenceWe will use Boolean logic to decide whether 2 statements have the same meaning. Example: Is “football and (not nfl) and (not college)” equivalent to “football and not (nfl or college)” ?

Example 1:  Are the following equivalent?

Given: ~p q If I don't study, then I fail.

p q I study or I fail.

p q ~p ~p q p q

T T F

T F F

F T T

F F T

In the truth table above, the last two columns have the same exact truth values! Therefore, the statement ~p q is logically equivalent to the statement p q.

Definition: When two statements have the same exact truth values, they are said to be logically equivalent.

Construct a truth table for each statement below. Then determine which two are logically equivalent.

1. ~q p2. ~(p q)3. p q

2) Is p ~q or p q or ~(p q) logically equivalent?

3) Show that p → q and ⌐q → ⌐ p are logically equivalent by using a truth table.

- 20 -