Discrete Math Assignment Help
PRACTICE PROBLEMS FOR THE FINAL EXAM
Here are some sample problems for the Final Exam. These do not necessarily reflect
the difficulty, length, format, or sum total of all material for the exam.
(1) Are the following logical propositions equivalent: ¬((P ∧Q) ⇒ R) and P ∧Q∧(¬R).
(2) Prove the following statements or demonstrate that they are false:
(a) There is one and only one minimal spanning tree in every weighted graph.
(b) Every prime number p > 2 is odd.
(c) For m and n any two negative integers, gcd(m, n) > m, n.
(3) The game of (one pile) NIM proceeds as follows: a pile of 20 objects (rocks, sticks,
whatever) is formed. Two players take turns grabbing objects from the pile. On
their turn, a player must grab either 1, 2, or 3 objects. The player who grabs the
last objects from the pile wins.
For the purposes of this algorithm, we need the following additional algorithm
language: we will use the function PlayerInput to indicate we are requesting input
from a human player and so p ←PlayerInput will assign the requested player input
to the variable p.
Consider the following algorithm which simulates playing NIM against a human
player:
Algorithm NIM winner
n ← 20
repeat until n = 0
p ←PlayerInput
n ← n − p and take p objects from the pile [human turn]
if p = 1 then n ← n − 3 and take 3 objects from the pile [algorithm’s turn]
if p = 2 then n ← n − 2 and take 2 objects from the pile
if p = 3 then n ← n − 1 and take 1 object from the pile
endrepeat
(a) Write the trace where you play the part of the human playing against the algorithm (as part of this trace, you may pick any number of objects you want each
time).
(b) Prove, using the language of loop invariants, that the algorithm will always win
NIM against any human player.
(c) Draw a game tree for two players starting with 4 objects to prove that, with
optimal play, the second player always wins.
Date: May 2, 2021.
(4) Prove the following identity two ways
Xn
k=0
(2k − 1) = n
2 − 1
once directly via induction and once using the language of sequences and unique
determination.
(5) For
A =
1 2 1 0
0 0 0 1
0 0 0 0
1 1 1 0
(a) Draw a graph with A as adjacency matrix.
(b) Find the number of length 3 paths from v1 to v2.
(c) Perform all iterations of Warshall’s algorithm to find the path matrix P for the
given graph.
(6) Find the general solution to the difference equation with characteristic equation (r −
3)3
(r − 2)(r 1) = 0.
(7) In the game Blackjack, the 52 cards in a standard deck of cards are valued as follows:
for the numbered cards 2 through 10, the value matches the value on the card. The
face cards (Jacks, Queens, and Kings) are valued 10. Aces are valued 11 (technically,
they can take a value of 11 or 1 at the choice of the player, but ignore this wrinkle
for the purpose of this problem).
(a) Find the expected value of a single card dealt to you from a full deck of cards
with respect to the above point values.
(b) During play, a player will receive a hand of two cards without replacement. A
“Blackjack” is a hand with an ace and another card with value 10. Find the
probability of receiving a Blackjack, given your first card was an ace.
(c) Find the overall probability of receiving a Blackjack overall.
(8) You watch the weather forecast daily for 100 days and record the outcome of rain
versus no rain, both in terms of what was forecast and what actually occurred that
day. You found that, when rain is forecast, it actually rains 95% of the time and
when no rain is forecast, rains 3% of the time.
(a) Assuming that rain is forecast on 40% of days, what proportion of days did it
actually rain?
(b) Assuming you pick a day out of the 100 days you recorded weather forecasts
and outcomes at random and that day it rained, what was the probability the
forecast that day called for rain?
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more