You are on page 1of 12

Math 170: Project #11 Part 2

Math Project #11 Part 2


Ben Filippo, Tyler Nicholson, & Joseph Martineau
Math 170-01
T/Th 10:00am - 11:50am
Professor Stanica
December 7, 2014

Math 170: Project #11 Part 2

Section 1: Boolean Functions


Part (A):
Boolean algebra (Developed by George Boole in the 1800s) is a type of math
that, rather than the answer being a numerical value, the answer is a truth value. True is
denoted with a 1, and false is denoted with a 0. This shares immense similarities with
circuits and logic gates in computers, which heavily rely on Boolean algebra. Boolean
logic gives computers the ability to perform countless operations that previously only
humans were capable of doing. Examples of these include complex calculations, ATM
transactions, word processing, and more (Brain).
To begin with, Boolean algebra has its basis in propositional logic. Much like
algebra learned in grade school with operations like multiplication and addition, Boolean
algebra has its own operations. These operations are familiar for those who know a bit
of discrete math; there is conjunction (and, denoted with ), disjunction (or, denoted
with ), and negation (not, denoted with ~ or ). One application of these operators is
truth tables, which determine the truth value (0 or 1) of a Boolean function based on the
truth values of the variables. For example, a truth table for a certain Boolean function
F(x,y) = (x ~y) would look like this:
x

~y

x ~y

Math 170: Project #11 Part 2


There are a handful of other operations and a number of laws when it comes to
simplifying Boolean functions, which are incredibly useful in math for proving
statements. However, for computer science, and/or are the most used operators in
programming. Virtually all mid- or high-level languages have and/or operators. These
operators are vital for controlling the flow of a program. To go back to an earlier
example, the ATM transaction, Boolean logic is heavily at work there. If one wants to
withdraw money, the program inside the machine might have a number of flags that
determine if the user can do that. The first flag could be whether the account has
enough money, which can be denoted by the variable x. The second flag could be
whether the account is under investigation (Such as if there might be expected fraud or
identity theft), which can be denoted by the variable y. If someone goes up to an ATM
and attempts to withdraw money from the account, the machine will only dispense the
money if there is money in the account and the account is not under investigation, which
would be denoted by x ~y.
This is the exact function that the above truth table has. As one can see from that
table, the money is only dispensed under one set of conditions. Boolean algebra is
indispensable in everything that depends on a program. For another example, assume
that a computer controls an airplanes pressure. When the cabin of an airplane is
pressurized, Boolean functions are at work; if the pressure is not adequate (~x), then
increase or decrease the pressure based on whether the pressure is lower or higher
than what it should be. With Boolean algebra, complex decisions with multiple paths can
be decided by a truth value.
Part (B): Simplify the following Boolean function using Laws of Logic.

Math 170: Project #11 Part 2


F(x,y,z) = [~(~x y)] [~(x y)] v [y (y ~z)]
(x ~y) (~x ~y) v [y (y ~z)] by De Morgans Law
(~y x) (~y ~x) v [y (y ~z)] by Commutative Law
[~y (x ~x)] v [y (y ~z)] by Distributive Law
(~y t) v [y (y ~z)] by Negation Law
~y v [y (y ~z)] by Identity Law
(~y v y) (~y v (y ~z) by Distributive Law
t (~y v (y ~z) by Negation Law
~y v (y ~z) by Identity Law
(~y v y) ~z by Associative Law
t ~z by Negation Law
t by Universal Bound Law
F(x,y,z) is a Tautology.

Math 170: Project #11 Part 2

Section 2: Problems
Section 4.6: #7
Carefully formulate the negation of the statement. Then prove the statement by
contradiction.

Problem:
7.

There is no least positive rational integer.

Solution:
We come to the statement, There is a least positive rational integer. for the
negation of the provided statement, by stating, It is not the case that there is no least
positive rational integer. Now, given the negated form of our original statement we must
prove the contradiction which is, It is the case that there is no least positive rational
integer. This will bring us back to the original statement, There is no least positive
rational integer.
Assuming we have a least positive rational integer, r, and r = m / n , where m and
n are both positive integers. However, m / (2n) < r ,which means there is a rational
integer less than our least, which is a contradiction; therefore, the original statement is
true.

Section 9.1: #32


Problem:

Math 170: Project #11 Part 2


32.

A certain non-leap year has 365 days, and January 1 occurs on a Monday.

a.

How many Sundays are in the year?

b.

How many Mondays are in the year?

Solution:
We have been given the following information:
January 1 occurs on a Monday. (7 days a week, starting on the first of the year)
The year has 365 days in it.
Find:
A.

How many Sundays there are in this year?

B.

How many Mondays there are in this year?

We can approach these problems by first listing off the highest divisible value per week
with the following formula:
List: m(= m + 0)
Count:

m+1

m+2 ...
2

n (= m + (n m))
. . . (n m) + 1

Part A. requests to check how many Sundays there are in a week. Assuming that we
start on a Monday during January 1st, we can assume the value to check for each
Sunday would be 7. With this, we check for the highest divisible value in 365/7:

List: 356

357

358

Count: X

7*51 X

359

360

361

362

363

364

365

7*52 X

Math 170: Project #11 Part 2


From this, we see that out of 365 days, 7 days divide evenly into it 52 times. From this,
we can safely assume that 52 Sundays will occur in this years time.
Our answer for part a) = 52.

Part B. Taking the knowledge that we now have from part A, we will apply what we now
know to solve how many Mondays are in this year. While checking for the amount of
Sundays available, we came to the conclusion that there are exactly 52 weeks in this
given years example, with a remainder of 1 day out of 365 days. Given the fact that we
started on a Monday, it is safe to assume that the last day of the year will also be a
Monday. To further support this, we know the following:

Number of weeks in a year: 365/7 = 52.14285714285714


Percentage of a day compared to a week: 1/7 = 0.14285714285714

This comparison reassures the fact that there is exactly one day left in the year, which
will be a Monday. Therefore, we know that exactly 53 Mondays will occur in this
timeframe.
Our answer for part b) = 53.

Section 9.4: #34


Problem:
34.

Let S be a set of ten integers chosen from 1 through 50. Show that the set

contains at least two different (but not necessarily disjoint) subsets of four integers that
add up to the same number. (For instance, if the ten numbers are {3, 8, 9, 18, 24, 34,

Math 170: Project #11 Part 2


35, 41, 44, 50}, the subsets can be taken to be {8, 24, 34, 35} and {9, 18, 24, 50}. The
numbers in both of these add up to 101.)

Solution:
Given a set S that consists of ten integers that has two subsets with the same
sum, we can apply the Pigeonhole Principle, which states, If k is a positive integer and
k+1 objects are placed in k boxes then at least one box contains two or more objects.
This means that given the set S that contains ten integers chosen from 1 through 50, we
have (2^10) - 1 possibilities, excluding the empty set, for two subsets of ten integers.
However, there are only 455 possible sums, based on adding 41 through 50. This
means that with more subsets than sums at least two subsets have the same sum,
using 1023 / 455 = 2, which is the floor when rounded down.

Section 10.1: #13


Problem:
13.

Solve the vegetarians-and-cannibals puzzle for the case where there are three

vegetarians and three cannibals to be transported from one side of a river to the other.

Solution:
We are given the following example in our text:

Math 170: Project #11 Part 2


The following is a variation of a famous puzzle often used as an example in the study of
artificial intelligence. It concerns an island on which all the people are of one of two types, either
vegetarians or cannibals. Initially, two vegetarians and two cannibals are on the left bank of a
river. With them is a boat that can hold a maximum of two people. The aim of the puzzle is to find
a way to transport all the vegetarians and cannibals to the right bank of the river. What makes this
difficult is that at no time can the number of cannibals on either bank outnumber the number of
vegetarians. Otherwise, disaster befalls the vegetarians!

However, along with this, we are given an extra cannibal and an extra vegetarian to
make things a little trickier than the original.

With these parameters, we know the following:

-No one side of the river can have cannibals outnumbering vegetarians.
-Vegetarians can outnumber cannibals with no issues.
-The boat can only carry two members of the group at any given time.
-C= Cannibal
-V= Vegetarian

Here is how this problem is solved: (via one-way trips)


Shore 1

Boat

Shore 2

Start:

CCCVVV

Trip 1:

CVVV

CC

Trip 2:

CVVV

Trip 3:

VVV

CC

Math 170: Project #11 Part 2


Trip 4:

VVV

CC

Trip 5:

VC

VV

CC

Trip 6:

VC

VC

VC

Trip 7:

CC

VV

VC

Trip 8:

CC

VVV

Trip 9:

CC

VVV

Trip 10:

VVVC

Trip 11:

CC

VVVC

Finish:

VVVCCC

Through this graph, we can see that after 6 round trips, all members of the group
are able to cross while staying in the parameters given to us. We start by sending 2
cannibals alone, as leaving one vegetarian would have failed, and sending one of each
on the first trip would fail during the second trip attempt, as one shore would be
guaranteed to have more cannibals compared to vegetarians. We then send the
cannibal back to retrieve the remaining cannibal, leaving one cannibal on the boat, and
two on Shore 2. We then leave the remaining cannibal on Shore 1, and send the two
vegetarians to the second shore. On arrival, instead of leaving one vegetarian with the
two cannibals, we take one cannibal back to shore one with one vegetarian. From here,
we trade the cannibal for our remaining vegetarian, and bring both in the boat to Shore
2. Now that all vegetarians have made it across, we use the cannibal on the far shore to
make 2 final trips, retrieving the other 2 cannibals. With that, the problem is solved.

10

Math 170: Project #11 Part 2

11

Math 170: Project #11 Part 2

Works Cited
Brain, Marshall. "How Boolean Logic Works - HowStuffWorks." HowStuffWorks.
1 Apr. 2000. Web. 1 Dec. 2014.

12

You might also like