# CS 2603 Homework 9 — Sets and Karnaugh Maps

## Due Tuesday, Apr 12, 2011

NOTE: This assignment is due by 5:00 pm on Tuesday, April 12, 2011. As I will not be in my office before 5:00 pm that day, please turn in your assignment by giving it to me ahead of time during my office hours on Monday or by sliding it under my office door if I am not in my office when you turn it in. Do not send assignments to me through email or leave them in my departmental mail box.

## 1. Motivation

Sets are important mathematical entities that are widely applicable in computer science and elsewhere. Karnaugh Maps are useful tools for circuit minimization and other logical reductions. To understand these entities, it is import to gain experience with them.

## 2. Goal

The goal of this assignment is to give you experience with sets and Karnaugh maps.

## 3. Assignment

1. Consider the fact that the order in which set intersection operations are performed should have no effect on the set delivered.

1. Formally state the fact that intersection is associative.
2. Prove the Associativity Law of Set Intersection.

2. Consider DeMorgan’s Law for Union, as formally stated and proven in the lecture. We should be able to formally state and prove a similar law for intersection.

1. Formally state DeMorgan’s Law for Intersection.
2. Prove DeMorgan’s Law for Intersection.

3. Consider the fact that A is a subset of B iff the union of A and B is the same as B.

1. Formally state this fact in our set notation.
2. Formally restate the following in our notation: A is a subset of B entails that the union of A and B is the same as B.
3. Prove the statement you have just formalized.
4. Formally restate the following in our notation: The union of A and B is the same as B entails that A is a subset of B.
5. Prove the statement you have just formalized.

Note that once you have proven 3c and 3e, you have proven 3a.

4. Consider the following Boolean function F.

```        a b c d F(a,b,c,d)
0 0 0 0     1
0 0 0 1     1
0 0 1 0     0
0 0 1 1     0
0 1 0 0     1
0 1 0 1     1
0 1 1 0     0
0 1 1 1     0
1 0 0 0     0
1 0 0 1     0
1 0 1 0     1
1 0 1 1     1
1 1 0 0     0
1 1 0 1     0
1 1 1 0     0
1 1 1 1     0
```
1. Write the minterms of F as given by the function definition above.
2. Create a Karnaugh map for F.
3. Use the Karnaugh map to find a minimum sum-of-products representation of F, give that representation, and show how you arrived at the representation from the map.

5. Consider the following Boolean function G.

```        a b c d G(a,b,c,d)
0 0 0 0     0
0 0 0 1     0
0 0 1 0     1
0 0 1 1     0
0 1 0 0     0
0 1 0 1     1
0 1 1 0     0
0 1 1 1     0
1 0 0 0     0
1 0 0 1     0
1 0 1 0     1
1 0 1 1     0
1 1 0 0     0
1 1 0 1     1
1 1 1 0     1
1 1 1 1     1
```
1. Write the minterms of G as given by the function definition above.
2. Create a Karnaugh map for G.
3. Use the Karnaugh map to find a minimum sum-of-products representation of G, give that representation, and show how you arrived at the representation from the map.

6. Consider the following Boolean function H.

```        a b c d H(a,b,c,d)
0 0 0 0     1
0 0 0 1     0
0 0 1 0     1
0 0 1 1     0
0 1 0 0     0
0 1 0 1     0
0 1 1 0     0
0 1 1 1     1
1 0 0 0     1
1 0 0 1     0
1 0 1 0     1
1 0 1 1     0
1 1 0 0     0
1 1 0 1     1
1 1 1 0     0
1 1 1 1     0
```
1. Write the minterms of H as given by the function definition above.
2. Create a Karnaugh map for H.
3. Use the Karnaugh map to find a minimum sum-of-products representation of H, give that representation, and show how you arrived at the representation from the map.

7. Consider the following Boolean function I.

```        a b c d I(a,b,c,d)
0 0 0 0     1
0 0 0 1     1
0 0 1 0     0
0 0 1 1     0
0 1 0 0     x
0 1 0 1     0
0 1 1 0     x
0 1 1 1     1
1 0 0 0     1
1 0 0 1     1
1 0 1 0     0
1 0 1 1     0
1 1 0 0     0
1 1 0 1     0
1 1 1 0     1
1 1 1 1     x
```
1. Write the minterms of I as given by the function definition above.
2. Create a Karnaugh map for I.
3. Use the Karnaugh map to find a minimum sum-of-products representation of I, give that representation, and show how you arrived at the representation from the map.

## 4. Important Notes on this Assignment

1. Warnings and Cautions

The following words of advice come directly from Prof Page who has taught this course many times. Please pay them great heed!

Warning! For almost all people, the most effective way to work on proofs is to distribute the work over several days. Work a couple hours a day, every day, on the problems. When you’ve worked a good while on one of the problems and find yourself stuck, try another problem. Eventually, problem by problem, you will discover a key that leads to a solution. It may seem that key comes to you suddenly, but somehow the hard work invested before the epiphany gradually builds the picture in your mind until the solution pops out. If you start working on this homework assignment the day before it’s due, you probably won’t finish it. That means you will have missed one of your only real opportunities to prepare for the examinations in this course.

Importance of Finding Your Own Keys. Each problem that you fail to invest enough time in to find the key yourself reduces, substantially, your chances of passing the exams in this course. I advise you not to discuss a problem with someone else until you have found the key. If you have questions about the material, ask the instructor or the assistant. Email should work well for this. I don’t regard discussing the problems with others as cheating, as long as can explain to me whatever you turn in, but I want you to know that the more you rely on such discussions, the less likely it is that you will succeed on the exams.

Important Alert! Homework problems provide your only real opportunity to study for exams. Studying the night before the exam will be of almost no use at all. If you have difficulties, come to see the Instructor or Teaching Assistant during office hours.

How Much Time Will This Homework Take? Some of the problems may take hours to complete. Others, only a few minutes. Some problems may seem difficult to you that seem easy to others, and vice versa. There is no way to predict when or how the insights you will need to solve these problems will come to you. Also, expect some frustration in the process of using the proof checker. Just as in programming, you have to get all the required characters in the right order. All the commas, parentheses, case-sensitive names, etc have to be right. It can easily take an hour to get an already correct proof pushed through the proof checker.

2. New Note: In your proof(s) using natural deduction, you may use equations (as they hold true going either direction) as well as the rules of natural deduction. However, in your equational reasoning proofs you may not use the rules of natural deduction (because natural deduction is directional and equations much hold true regardless of direction).

3. Recall that you can use as rules in your proofs equations other than those on your handout sheet, provided that those equations have already been proven (in class or in your homework) and that the proof of the equation does not cite, directly or indirectly, the equation you are proving. An equation is "indirectly cited" if it is cited, directly or indirectly, in the proof an equation you are citing.

4. Don’t forget that a metavariable (such as ‘a’ or ‘b’ in a rule, whether from Natural Deduction, Equational Reasoning, or Induction) can stand for any WFF, not just a single variable. For example, you know that you could use {∧ER} with ∀x.f(x) ∧ ∃y.g(y) to derive ∀x.f(x) by substituting ∀x.f(x) for ‘a’ and ∃y.g(x) for ‘b’ in the rule. However, don’t forget that you could use {∧ER} with ∀x.f(x) ∧ (∃y.g(y) ∧ (¬∃z.h(z) ∧ (¬∀w.i(w) ∨ (j(x) → k(y)) ∨ l(z)) ∧ m(a))) to derive ∀x.f(x) as well, simply by substituting ∀x.f(x) for ‘a’ and ∃y.g(y) ∧ (¬∃z.h(z) ∧ (¬∀w.i(w) ∨ (j(x) → k(y)) ∨ l(z)) ∧ m(a)) for ‘b’ in the rule.

## 5. What to Turn In

You will turn in a typed or neatly written hard copy of your homework that shows all the work specified above. You will not need to submit anything electronic for this homework.