I have n + 1 distinct, numbered items which I show you. You choose a number i, with 1 ≤ i ≤ n, and then choose a first and alternate item from among the first i + 1. How many possible choices of i, first item, and alternate item can you make? Find a closed-form formula (without summation).
I have n + 1 distinct, numbered items which I show you. You choose a number...
Problem 1: Let W(n) be the number of times "whatsup" is printed by Algorithm WHATSUP (see below) on input n. Determine the asymptotic value of W(n). Algorithm WHATSUP (n: integer) fori1 to 2n do for j 1 to (i+1)2 do print("whatsup") Your solution must consist of the following steps: (a) First express W(n) using summation notation Σ (b) Next, give a closed-form formula for W(n). (A "closed-form formula" should be a simple arithmetio expression without any summation symbols.) (c) Finally,...
3. An urn contains five white balls numbered from 1 to 5, five red balls numbered from 1 to 5 and five blue balls numbered from 1 to 5. For each of the following questions, please give your answer first in the form that reflects your counting process, and then simplify that to a number. You must include the recipes. No other explanation needed. (a) In how many ways can we choose 4 balls from the urn? (b) in how...
10. (a) By giving a combinatorial argument show that [mk=n-21-1 (Hint: Think of ways of choosing a committee and its chairperson.) (b) Find a closed form formula for į ()k. (That is, a formula that does not involve summation with varying number of terms. For instance, Part (a) gives a closed form formula for
Problem 1: Give the exact and asymptotic formula for the number f(n) of letters “A” printed by Algo- rithm PRINTAs below. Your solution must consist of the following steps: (a) First express f(n) using a summation notation 2 (b) Next, give a closed-form formula for f(n). (c) Finally, give the asymptotic value of the number of A's (using the O-notation.) Include justification for each step. Note: If you need any summation formulas for this problem, you are allowed to look...
Therom 1.8.2 n choose k = (n choose n-k) n choose k = (n-1 choose K) + (n-1 choose K-1) 2n = summation of (n choose i ) please use the induction method (a) (10 pts) Show that the following equality holds: n +1 + 2 Hint: If you proceed by induction, you might want to use Theorem 1.8.2. If you search for a combinatorial proof, consider the set X - (i,j, k): 0 S i,j< k< n) (b) (10...
Textual menus work by showing text items where each item is numbered. The menu would have items 1 to n. The user makes a choice, then that causes a function to run, given the user made a valid choice. If the choice is invalid an error message is shown. Whatever choices was made, after the action of that choice happens, the menu repeats, unless the menu option is to quit. Such kind of menus are displayed from the code under...
Suppose we want to choose 4 letters, without replacement, from 17 distinct letters. (a) How many ways can this be done, if the order of the choices is not taken into consideration? x 6 ? (b) How many ways can this be done, if the order of the choices is taken into consideration? A teacher wanted to fairly choose three students from a class of 24 to raise the school's flag. He assigned each student a two-digit number from 01...
1. In a box there are three numbered tickets. The numbers are 0, 1 and 2. You have to select (blindfolded) two tickets one after the other, without replacement. Define the random variable X as the number on the first ticket and the random variable Y as the sum of the numbers on your selected two tickets. E.g. if you selected first the 2 and second time the 1 , then X = 2 and Y-1 +2 = 3. a./...
Haloo , i have java program , Java Program , dynamic program Given a knapsack with capacity B∈N and -n- objects with profits p0, ..., p n-1 and weights w0, ..., wn-1. It is also necessary to find a subset I ⊆ {0, ..., n-1} such that the profit of the selected objects is maximized without exceeding the capacity. However, we have another limitation: the number of objects must not exceed a given k ∈ N Example: For the items...
1. Consider an array of n distinct values in which the first n − 1 values are sorted, and the last element is not. (It could be smaller than the first element, larger than element n − 1, or anywhere in between.) Give the worst-case number of comparisons that Insertion Sort will perform in this scenario. You can give your answer in terms of big-Theta if you wish to ignore low-order terms and constants.