Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more.
Course Hero has millions of course specific materials providing students with the best way to expand
their education.
Below is a small sample set of documents:
Uni. Worcester - CS - 504
CS504: Analysis of Computations and Systems Spring 1999Homework VIDue: March 8 or 10, 1999One more recurrence1. Solve the second-order linear recurrence xn 1 xn 312 xn 32nn2x0a x1bGenerating Functions2. Here is a different w
Uni. Worcester - CS - 99
CS504: Analysis of Computations and Systems Spring 1999Homework VIDue: March 8 or 10, 1999One more recurrence1. Solve the second-order linear recurrence xn 1 xn 312 xn 32nn2x0a x1bGenerating Functions2. Here is a different w
Uni. Worcester - CS - 9906
CS504: Analysis of Computations and Systems Spring 1999Homework VIDue: March 8 or 10, 1999One more recurrence1. Solve the second-order linear recurrence xn 1 xn 312 xn 32nn2x0a x1bGenerating Functions2. Here is a different w
Uni. Worcester - CS - 504
C.S.504 H.W. #7Due: November 5, 1991 1. (3 points) Use the method of characteristic roots to solve the tn = tn -2 + 4n , n 2 recurrence: t 0 = 1, t 1 = 4 2. (3 points) Use the method of characteristic roots to solve the recurrence: tn = 2*tn -1 + (n
Uni. Worcester - CS - 91
C.S.504 H.W. #7Due: November 5, 1991 1. (3 points) Use the method of characteristic roots to solve the tn = tn -2 + 4n , n 2 recurrence: t 0 = 1, t 1 = 4 2. (3 points) Use the method of characteristic roots to solve the recurrence: tn = 2*tn -1 + (n
Uni. Worcester - CS - 504
C.S.504 H.W. #4Due: October 8, 19921. (1 point) Evaluate1 2 n2 +10n2 5 2. (1 point) Evaluate0m kn 3. (4 points) Assume that you're sequentially seeking a card in a perfectly shuffled deck of 106 distinct cards. The card is in the deck. A)W
Uni. Worcester - CS - 92
C.S.504 H.W. #4Due: October 8, 19921. (1 point) Evaluate1 2 n2 +10n2 5 2. (1 point) Evaluate0m kn 3. (4 points) Assume that you're sequentially seeking a card in a perfectly shuffled deck of 106 distinct cards. The card is in the deck. A)W
Uni. Worcester - CS - 504
C.S.504 H.W. #1Due: September 23, 19931. (2 points) What does the following algorithm compute? function f(n,m : integer) : integer; X m; K 0; while Xn do X X*m; K K+1; return(K); 2. (9 points) We want to find the maximum and the minimum element
Uni. Worcester - CS - 93
C.S.504 H.W. #1Due: September 23, 19931. (2 points) What does the following algorithm compute? function f(n,m : integer) : integer; X m; K 0; while Xn do X X*m; K K+1; return(K); 2. (9 points) We want to find the maximum and the minimum element
Uni. Worcester - CS - 504
C.S.504 H.W. #5Due: October 15, 1991 1.(5 points) Prove the equality on page 72 of our text that for direct chaining hashing,s 2 ( A n' ) =2. (3 points) Given two sorted lists,n ( m -1) m2a 1 ,., a n a b 1,.,b nbshow that any algorithm whi
Uni. Worcester - CS - 91
C.S.504 H.W. #5Due: October 15, 1991 1.(5 points) Prove the equality on page 72 of our text that for direct chaining hashing,s 2 ( A n' ) =2. (3 points) Given two sorted lists,n ( m -1) m2a 1 ,., a n a b 1,.,b nbshow that any algorithm whi
Uni. Worcester - CS - 504
C.S.504H.W. #4Due: March 25/26, 1998Read SECTIONS 5.1, 5.2, 5.3 (Trick 1) Do EXERCISEs 5.1, 5.2, 5.4, 5.15 from GKP. Do not submit your solutions, but check them with the answers from the back of the text. 1. (3 points) Find a closed form for coe
Uni. Worcester - CS - 98
C.S.504H.W. #4Due: March 25/26, 1998Read SECTIONS 5.1, 5.2, 5.3 (Trick 1) Do EXERCISEs 5.1, 5.2, 5.4, 5.15 from GKP. Do not submit your solutions, but check them with the answers from the back of the text. 1. (3 points) Find a closed form for coe
Uni. Worcester - CS - 504
C.S.504 H.W. #1Due: September 17, 1991 Assume that you're sequentially seeking a card in a perfectly shuffled deck of 106 distinct cards. Use Chebyshev's inequality to give a bound on the probability that you'll have to examine at least 900,000 card
Uni. Worcester - CS - 91
C.S.504 H.W. #1Due: September 17, 1991 Assume that you're sequentially seeking a card in a perfectly shuffled deck of 106 distinct cards. Use Chebyshev's inequality to give a bound on the probability that you'll have to examine at least 900,000 card
Uni. Worcester - CS - 504
C.S.504SOLUTION FOR H.W. #1k n n n n( n +1) n( n - 1) n 1 - 1 = ( n - k) = n - k = n 2 = 1. 1 = 2 2 k =1 j =k+ 1 k =1 j =1 j =1 k =1 k =1 k =1 n n n2. In fact, Gn = (-1)n+1Fn.0, if n = 0 Gn = if n = 1 1, G - G , if n >1 n -2 n -13.
Uni. Worcester - CS - 98
C.S.504SOLUTION FOR H.W. #1k n n n n( n +1) n( n - 1) n 1 - 1 = ( n - k) = n - k = n 2 = 1. 1 = 2 2 k =1 j =k+ 1 k =1 j =1 j =1 k =1 k =1 k =1 n n n2. In fact, Gn = (-1)n+1Fn.0, if n = 0 Gn = if n = 1 1, G - G , if n >1 n -2 n -13.
Uni. Worcester - CS - 504
C.S.504 H.W. #2Due: September 24, 1992(6 points) Consider the following procedure void InsertionSort(int A, int n) {int i, j,temp; for (i=1; i<n; i+) { /* A[0.i-1] already sorted */ temp=A[i]; for (j=i-1; j>=0 & temp<A[j]; j-) A[j+1]=A[j]; /*<-*/ A
Uni. Worcester - CS - 92
C.S.504 H.W. #2Due: September 24, 1992(6 points) Consider the following procedure void InsertionSort(int A, int n) {int i, j,temp; for (i=1; i<n; i+) { /* A[0.i-1] already sorted */ temp=A[i]; for (j=i-1; j>=0 & temp<A[j]; j-) A[j+1]=A[j]; /*<-*/ A
Uni. Worcester - CS - 504
C.S.504 H.W. #3Due: October 21, 1993 1. (5 points) We define an Isaac tree In recursively by: -I0 consists of a single node, -the Isaac tree In, n1, consists of two Isaac trees In-1 such that the root of one is the rightmost child of the root of the
Uni. Worcester - CS - 93
C.S.504 H.W. #3Due: October 21, 1993 1. (5 points) We define an Isaac tree In recursively by: -I0 consists of a single node, -the Isaac tree In, n1, consists of two Isaac trees In-1 such that the root of one is the rightmost child of the root of the
Uni. Worcester - CS - 504
C.S.504 H.W. #10Due: Tuesday, December 15, 1992 1. (8 points) One way to estimate the size of a set X ={ x 1 ,., x n } is to sample the elements of X from a uniform distribution with replacement until an element is sampled twice. The number of eleme
Uni. Worcester - CS - 92
C.S.504 H.W. #10Due: Tuesday, December 15, 1992 1. (8 points) One way to estimate the size of a set X ={ x 1 ,., x n } is to sample the elements of X from a uniform distribution with replacement until an element is sampled twice. The number of eleme
Uni. Worcester - CS - 504
C.S.504SOLUTION FOR H.W. #5 1. (A) If we restrict the composition to have one part (k=1), then the GF is z + + z r . For 1 an arbitrary number of parts (no restrictions on k), the GF is . 1- z - - z r 1 (B) fn ,2 = z n F2 ( z) = z n . Recognizing, y
Uni. Worcester - CS - 98
C.S.504SOLUTION FOR H.W. #5 1. (A) If we restrict the composition to have one part (k=1), then the GF is z + + z r . For 1 an arbitrary number of parts (no restrictions on k), the GF is . 1- z - - z r 1 (B) fn ,2 = z n F2 ( z) = z n . Recognizing, y
Uni. Worcester - CS - 504
C.S.504H.W. #2Due: February 11/12, 19981. (6 points) Find a closed form solution for the linear first-order nonhomogeneous recurrence with nonconstant coefficients 0,if n = 0 xn = n + 3 x + n + 3,if n > 0 n +1 n -1 2 The first three terms are
Uni. Worcester - CS - 98
C.S.504H.W. #2Due: February 11/12, 19981. (6 points) Find a closed form solution for the linear first-order nonhomogeneous recurrence with nonconstant coefficients 0,if n = 0 xn = n + 3 x + n + 3,if n > 0 n +1 n -1 2 The first three terms are
Uni. Worcester - CS - 504
C.S.504 H.W. #3Due: October 1,1991 1.(2 points) In Section 3.1.1 of our text, what is E[An ] when Pr{An =i } = if 1i n -1 then (1/2)i else if i =n then (1/2)n -1. 2. (3 points) Prove that0 k <n 0k <n for n 0. 3. (2 points) Suppose a program has
Uni. Worcester - CS - 91
C.S.504 H.W. #3Due: October 1,1991 1.(2 points) In Section 3.1.1 of our text, what is E[An ] when Pr{An =i } = if 1i n -1 then (1/2)i else if i =n then (1/2)n -1. 2. (3 points) Prove that0 k <n 0k <n for n 0. 3. (2 points) Suppose a program has
Uni. Worcester - CS - 504
C.S.504H.W. #5Due: April 8/9, 1998Read SECTIONS 7.1, 7.2, 7.3, 7.5 Do EXERCISEs 7.1, 7.2, 7.3, 7.4, 5.15 from GKP. Do not submit your solutions, but check them with the answers from the back of the text. 1. (4 points) Define an r-composition of n
Uni. Worcester - CS - 98
C.S.504H.W. #5Due: April 8/9, 1998Read SECTIONS 7.1, 7.2, 7.3, 7.5 Do EXERCISEs 7.1, 7.2, 7.3, 7.4, 5.15 from GKP. Do not submit your solutions, but check them with the answers from the back of the text. 1. (4 points) Define an r-composition of n
Uni. Worcester - CS - 504
C.S.504 H.W. #3Due: October 1, 19921. (6 points) You should compare three techniques for evaluating the 1 integral 4 1- x 2 d x . For each of the techniques, you should test the 0 rate of convergence by comparing the influence of n upon the accu
Uni. Worcester - CS - 92
C.S.504 H.W. #3Due: October 1, 19921. (6 points) You should compare three techniques for evaluating the 1 integral 4 1- x 2 d x . For each of the techniques, you should test the 0 rate of convergence by comparing the influence of n upon the accu
Uni. Worcester - CS - 504
Due: December 16, 1993C.S.504 H.W. #71. (5 points) Solve the recurrence kfn k , if > 0 n 0k fn = 1, n if = 0 0, if < 0 n ( Hints : -One solution could parallel the text's solution to its recurrence (7.41). -The summation is a convolution. )
Uni. Worcester - CS - 93
Due: December 16, 1993C.S.504 H.W. #71. (5 points) Solve the recurrence kfn k , if > 0 n 0k fn = 1, n if = 0 0, if < 0 n ( Hints : -One solution could parallel the text's solution to its recurrence (7.41). -The summation is a convolution. )
Uni. Worcester - CS - 504
C.S.504 H.W. #5Due: October 15, 1992 1. (3 points) Find simple forms for 1k n( 2k - 1 )and0k(k- 1 ) . 2k2. (2 points) Show that1k 3. (5 points) Robin hood hashing is used to reduce the variance of the expected successful search time for
Uni. Worcester - CS - 92
C.S.504 H.W. #5Due: October 15, 1992 1. (3 points) Find simple forms for 1k n( 2k - 1 )and0k(k- 1 ) . 2k2. (2 points) Show that1k 3. (5 points) Robin hood hashing is used to reduce the variance of the expected successful search time for
Uni. Worcester - CS - 504
C.S.504 H.W. #1Due: September 17, 1992 1. (1 point) What is (0.125)-2/3? 2. (4 points) Given array A[1.n] of integers such that |A[k+1]-A[k]|1 for 1k<n and given integer x such that A[1]xA[n], we seek a j, 1jn, such that A[j]=x. Describe an algorith
Uni. Worcester - CS - 92
C.S.504 H.W. #1Due: September 17, 1992 1. (1 point) What is (0.125)-2/3? 2. (4 points) Given array A[1.n] of integers such that |A[k+1]-A[k]|1 for 1k<n and given integer x such that A[1]xA[n], we seek a j, 1jn, such that A[j]=x. Describe an algorith
Uni. Worcester - CS - 504
C.S.504 H.W. #9Due: December 3, 1992 1. (3 points) A) Give a generating function, F m ( z ), for the number of ways to put indistinguishable balls into m distinguishable boxes, such that each box contains at least one ball. [z n ] F m ( z ) is the n
Uni. Worcester - CS - 92
C.S.504 H.W. #9Due: December 3, 1992 1. (3 points) A) Give a generating function, F m ( z ), for the number of ways to put indistinguishable balls into m distinguishable boxes, such that each box contains at least one ball. [z n ] F m ( z ) is the n
Uni. Worcester - CS - 99
CS504: Analysis of Computations and Systems Spring 1999Homework II with Solution Probability Problems1. Two true dice are rolled. One is known to show an even number. What is the probability that the sum of both is 8? That it is 9? Solution: Sinc
Uni. Worcester - CS - 9902
CS504: Analysis of Computations and Systems Spring 1999Homework II with Solution Probability Problems1. Two true dice are rolled. One is known to show an even number. What is the probability that the sum of both is 8? That it is 9? Solution: Sinc
Uni. Worcester - CS - 99
CS504: Analysis of Computations and Systems Spring 1999Homework IIDue: February 8 or 10, 1999Probability Problems1. Two true dice are rolled. One is known to show an even number. What is the probability that the sum of both is 8? That it is 9?
Uni. Worcester - CS - 9902
CS504: Analysis of Computations and Systems Spring 1999Homework IIDue: February 8 or 10, 1999Probability Problems1. Two true dice are rolled. One is known to show an even number. What is the probability that the sum of both is 8? That it is 9?
Uni. Worcester - CS - 99
CS504: Analysis of Computations and Systems - Spring 1999Homework VIII - with solution1. Let an be the number of ways to obtain the score n by throwing a die. For example, a3 4. This corresponds to the possible throw sequences 1,1,1; 1,2; 2,1; 3. F
Uni. Worcester - CS - 9908
CS504: Analysis of Computations and Systems - Spring 1999Homework VIII - with solution1. Let an be the number of ways to obtain the score n by throwing a die. For example, a3 4. This corresponds to the possible throw sequences 1,1,1; 1,2; 2,1; 3. F
Uni. Worcester - CS - 504
CS504: Analysis of Computations and Systems - Spring 1999Homework VI - with SolutionThis may be as good a place as any to repeat that when you submit a home assignment or an exam you should show all work. Otherwise, when a result seems to appear "o
Uni. Worcester - CS - 99
CS504: Analysis of Computations and Systems - Spring 1999Homework VI - with SolutionThis may be as good a place as any to repeat that when you submit a home assignment or an exam you should show all work. Otherwise, when a result seems to appear "o
Uni. Worcester - CS - 504
CS504Name_ Midterm ExamDate : October 22, 1992 All documentation permitted 1(10 points) The product of polynomials A=an xn + an -1xn-1 +.+ a1x +a0 and B=bmxm + bm -1xm-1 +.+ b1x +b0 is polynomial C=cn +mxn+m + cn+m -1xn+m-1 +.+ c1x +c0 where ci =
Uni. Worcester - CS - 504
CS504Name_ Final ExamDate : December 10, 1991 All documentation permitted 1(25 points) Consider the following program. procedure Friendly (n : integer); var k : 1.n ; begin if n > 0 then for k := 1 to n do begin write("hello"); Friendly (k -1) en
Uni. Worcester - CS - 504
CS504Name_ Final ExamDate : December, 1992 All documentation permitted 1. (25 points) A) Given a set of positive integers A={a1,.,am}, find a generating function FA(z) such that [zn]FA(z) is the number of subsets of A which add up to n. For exampl
Uni. Worcester - CS - 2
CS504: Analysis of Computations and Systems Spring 1999Final test Worcester Campus 5/5/99 All books and notes are allowed but do not pass them around! Name:1. A right-binary tree is a binary tree in which no node may have a left child only a
Uni. Worcester - CS - 504
CS504: Analysis of Computations and Systems Spring 1999Final test Worcester Campus 5/5/99 All books and notes are allowed but do not pass them around! Name:1. A right-binary tree is a binary tree in which no node may have a left child only a
Uni. Worcester - CS - 2
CS504: Analysis of Computations and Systems Spring 1999Solution of Midterm test Worcester Campus 3/10/1999Clearly the test surprised many of you. I am still not sure why, but most (all?) performed under what I believe is their normal capabilty.
Uni. Worcester - CS - 504
CS504: Analysis of Computations and Systems Spring 1999Solution of Midterm test Worcester Campus 3/10/1999Clearly the test surprised many of you. I am still not sure why, but most (all?) performed under what I believe is their normal capabilty.
Uni. Worcester - CS - 504
CS504: Analysis of Computations and Systems Spring 1999Homework X & Additional ProblemsThe rst 3 Problems are Due: May 3 or 5, 1999 1. (a) Find the number of all words of size n over the alphabet a, b which begin with the string ab and end with th
Uni. Worcester - CS - 99
CS504: Analysis of Computations and Systems Spring 1999Homework X & Additional ProblemsThe rst 3 Problems are Due: May 3 or 5, 1999 1. (a) Find the number of all words of size n over the alphabet a, b which begin with the string ab and end with th
Uni. Worcester - CS - 99
CS504: Analysis of Computations and Systems Spring 1999Homework IVDue: February 22 or 24, 1999RecurrencesSince recurrences are a major tool in the analysis of algorithms, this assignment deals with them exclusively. 1. Consider the rst order li
Uni. Worcester - CS - 9904
CS504: Analysis of Computations and Systems Spring 1999Homework IVDue: February 22 or 24, 1999RecurrencesSince recurrences are a major tool in the analysis of algorithms, this assignment deals with them exclusively. 1. Consider the rst order li
Uni. Worcester - CS - 99
CS504: Analysis of Computations and Systems Spring 1999Homework IV with Solution RecurrencesSince recurrences are a major tool in the analysis of algorithms, this assignment deals with them exclusively. 1. Consider the rst order linear recurrence