Show that among 5 arbitrarily chosen integers a, a2,a3M4,a5, there must exist two integers ai ,aj,...
Prove the following: Show that for any given 92 integers there exist two of them whose sum, or else whose difference, is divisible by 180.
Prove the following: Show that for any given 107 integers there exist two of them whose sum, or else whose difference, is divisible by 210.
pigeonhole
1. Show that in every sequence (ai,a2, a100) of the letters A,B,C,D, there are two indices 1i< j < 98 such that (ai, ai+1,aj+2) = (aj, aj+1, aj+2).
Problem 13. (1 point) [3 Marks] Prove the following: Show that for any given 42 integers there exist two of them whose sum, or else whose difference, is divisible by 80.
Discrete math question
2. Consider to the following two algorithms procedure SortA(a1,a2, ..., an: a list of real numbers with n 2 2) 1, for j := 2 to n 2. i:= 1 3. while aj > ai 4. 5. m: 6. or k 0toj -i-1 7. i:-i+1 aj-k:aj-k-1 ai := m
#3 and 5 only
3. Prove that if six natural numbers are chosen at random, then the sum or difference of two of them is divisible by 9. 4. Consider a square whose side-length is one unit. Select any five points from inside this square. Prove that at least two of these points are within 2 units of each other. 5. Prove that any set of seven distinct natural numbers contains a pair of numbers whose sum or difference is...
Someone help please Let A be an array of 5 integers, whose contents are as follows: 3, 2, 1, 5, 4 We will apply quick sort to sort this array. Show all of the element-wise comparisons made by the algorithm in the correct order. Here an element-wise comparison means the comparison of one element of the array with another element of the array or the key set in a particular step of the algorithm. Since the algorithm may move the...
Please show work clearly. Thanks
4. Suppose you had n matrices with dimensions: ai xbi ,a2 x b2. . . . ,a,, X bn. Your goal is to determine, given two integers s and t, whether it is possible to multiply a sequence from the list of given matrices together, in any order and possibly not using all of the matrices, to end up with a matrix with dimensions s × t. For example, if the list of matrix dimensions...
The input consists of n numbers a1, a2, . . . , an and a target value t. The goal is to determine in how many possible ways can we add up two of these numbers to get t. Formally, your program needs to find the number of pairs of indices i, j, i < j such that ai+aj = t. For example, for 2, 7, 3, 1, 5, 6 and t = 7, we can get t in two...
Roy must elect 3 courses from among 5 courses in group I and 4 courses in group II. If he must take at least 1 of his 3 electives from each group, how many choices does he have? (Hint: First find how many choices he has if he elects only 1 course from group I. Then find how many choices he has if he elects 2 courses from group I. Since he must do one or the other of these,...