Let S{a, b, c, d} be a set of four positive integers. If pairs
of distinct...
Let S{a, b, c, d} be a set of four positive integers. If pairs
of distinct elements of S are added, the following six sums are
obtained:5,10, 11,13,14,19. Determine the values of a, b, c, and d.
(There are two possibilities. )
8.Let a and b be integers and d a positive
integer.
(a) Prove that if d divides a and d divides b, then d divides both
a + b and a − b.
(b) Is the converse of the above true? If so, prove it. If not,
give a specific example of a, b, d showing
that the converse is false.
9. Let a, b, c, m, n be integers. Prove that if a divides each of b
and c,...
Let a and b be positive integers, and let d be their greatest
common divisor. Prove that there are infinitely many integers x and
y such that ax+by = d. Next, given one particular solution x0 and
y0 of this equation, show how to find all the solutions.
Let A[1..n] be an array of distinct positive integers, and let t
be a positive integer.
(a) Assuming that A is sorted, show that in O(n) time it can be
decided if A contains two distinct elements x and y such that x + y
= t.
(b) Use part (a) to show that the following problem, re- ferred to
as the 3-Sum problem, can be solved in O(n2) time:
3-Sum
Given an array A[1..n] of distinct positive integers, and...
Let S = {a, b, c, d} and P(S) its power set. Define the minus
binary operation by A − B = {x ∈ S | x ∈ A but x /∈ B}. Show that
(by counter-examples) this binary operation is not associative, and
it does not have identity
Let us choose seven arbitrary distinct positive integers, not
exceeding 24. Show that there will be at least two subsets chosen
from these seven numbers with equal total sums. (Keep in mind that
sets, and hence subsets, have no repeated elements.) Hint: How many
subsets can you form altogether? What is the largest total sum of
such a subset?
Let An = {ai} n i=1 denote a list of n distinct positive
integers. The median mA of An is a value in An such that half the
elements in An are less than m (and so, the other half are greater
than or equal m). In fact, the median element is said to have a
middle rank. (a) Develop an algorithm that uses Sorting to return
mA given An. (6%) (b) Now assume that one is given another list...
Let S = {a, b, c}. Draw a graph whose vertex set is P(S) and for
which the subsets A and B of S are adjacent if and only if A ⊂ B
and |A| = |B| − 1.
(a) How many vertices and edges does this graph have?
(b) Can you name this graph?
(c) Is this graph connected?
(d) Does it have a perfect matching? If yes, draw a sketch of
the matching.
(e) Does it have a...