1 Page

404_HW8_F11

Course: CS 91.404, Fall 2011
School: UMass Lowell
Rating:
 
 
 
 
 

Word Count: 231

Document Preview

CS Analysis UML of Algorithms 91.404 (section 201) Homework Set #8 Fall, 2011 Assigned: Wednesday, 11/9 Due: Friday, 11/18 (start of lecture) This assignment covers textbook material in Chapters 10-11. Note: Partial credit for wrong answers is only given if work is shown. 1. (40 points) Linked Lists: (adapted from Algorithm Design by Goodrich and Tamassia) Design an efficient "link-hopping"...

Register Now

Unformatted Document Excerpt

Coursehero >> Massachusetts >> UMass Lowell >> CS 91.404

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.

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.
CS Analysis UML of Algorithms 91.404 (section 201) Homework Set #8 Fall, 2011 Assigned: Wednesday, 11/9 Due: Friday, 11/18 (start of lecture) This assignment covers textbook material in Chapters 10-11. Note: Partial credit for wrong answers is only given if work is shown. 1. (40 points) Linked Lists: (adapted from Algorithm Design by Goodrich and Tamassia) Design an efficient "link-hopping" algorithm for finding the middle node of a doubly linked list with head and tail pointers and an odd number of nodes. You are not allowed to use a counter; just link-hopping. Provide pseudocode, correctness justification, and upper and lower bounds on the worst-case running time. 2. (20 points) Hashing: Consider inserting keys 9, 5, 11, 1, 6 the in order given into a hash table of length m = 7 using hash function h(k) = 2k2 mod m. a) Using h(k) as the primary hash function, illustrate the result of inserting these keys using open addressing with linear probing. b) Using h(k) as the primary hash function, illustrate the result of inserting these keys using open addressing with quadratic probing, where c1=2 and c2=1. c) Using h(k) as the hash function, illustrate the result of inserting these keys using chaining. Compute the load factor for the hash table resulting from the insertions. d) What different values can the hash function h(k) = 2k2 mod m produce when m = 7? Carefully justify your answer. 3. (40 points) Chapter 11: Textbook Problem 11-1 on p. 282 (a) - (d). Page 1 of 1
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:

UMass Lowell - CS - 91.404
UML CSAnalysis of Algorithms 91.404 (section 201) Homework Set #9Fall, 2011Assigned: Monday, 11/21Due: Monday, 12/5 (start of lecture)This assignment covers textbook material in Chapters 12-13. Note: Partial credit for wrong answers is only given if
UMass Lowell - UML - 84.314
Skoog Chapter 7Components of Optical InstrumentsGeneral Design of Optical Instruments Sources of Radiation Wavelength Selectors Sample Containers Radiation Transducers (Detectors) Signal Processors and Readouts Fiber OpticsOptical spectroscopic based o
UMass Lowell - UML - 84.314
Chapter 26: An Introduction to Chromatographic Separations Column Chromatography Migration Rates Distribution Contstants Retention Times Selectivity Factor Zone Broadening & Column Efficiency Optimizing Performance ResolutionIntro to Chromatography C
UMass Lowell - MATH - 491
Any questions about the exam? Homework? Maple? Final exam vs. final project Return exam Give overall comments: 1. Read everything before you start. Some of you didn't realize that when I ask for a formula for a sequence, I want a closed form formula, not
UMass Lowell - MATH - 491
TODAY: Short recurrence for counting lattice paths by q-weight Number partitions Short recurrence for counting lattice paths by q-weight Warm-up: combinatorial interpretation of (a choose b) b = a (a-1 choose b-1) Consequence: (a choose b) = (a/b) (a-1 ch
UMass Lowell - MATH - 491
Collect homework, and comments on how to improve the homework Any questions about the homework or the material? TODAY: Paths in DAGs Counting paths by multiplying matrices Domino tilings again Weighted enumeration A finite DAG (directed acyclic graph) is
UMass Lowell - MATH - 491
Math 491, Problem Set #11 (due 10/21/03)1. Let cn be the number of domino tilings of a 3-by-2n cylinder, obtained by gluing together the left and right sides (of length 3) of a 3-by-2n rectangle. Express the generating function c1 x + c2 x2 + c3 x3 + . .
UMass Lowell - MATH - 141
James Propp Office: OH 428C Phone: 978-934-2438 (not a good way to reach me except during office hours) Email: JamesPropp -at- gmail -dot- com Course web-page: http:/jamespropp.org/141/ Classroom: Pasteur 408 Meeting time: MonWedThuFri, 11:00-11:50 Welcom
UMass Lowell - MATH - 141
[Go around with names] [If there are new students:] Say your name Describe your academic and non-academic interests Say why you signed up for the course Say a little about your math background (esp. calculus) Talk about your best and worst math experience
UMass Lowell - MATH - 141
For graphing problems, you have to show work (e.g., plot specific points). You won't get much credit if it looks like you could have just copied your picture from the output of a graphing calculator. Key concepts of section 1.1: Function, domain, range In
UMass Lowell - MATH - 141
For Friday: Read section 1.2 Is everyone getting the email? Get contact info for new students. Reminder: You will derive the maximum benefit from (and enjoyment of) class discussions if you have done the reading ahead of time. Class meetings are where we
UMass Lowell - MATH - 141
[Collect students' notes on 1.2. Allow one day's grace: "You can hand them in on Monday."] [Remind them that the homework on section 1.1 is due on MONDAY.] The graph of y = f(x) = 1/sqrt(1x2) looks like2 .52 .01 .51 .00 .5 2 112Is the function f
UMass Lowell - MATH - 141
[Go around with names] [Hand out time sheets] Section 1.2 What's the main point of section 1.2? .?.Functions that crop up in the real world can be represented or at least approximated by functions that are algebraically built up from some universal build
UMass Lowell - MATH - 141
[Go around with names] [Collect notes on 1.3] [Hand out time sheets] Preparation for section 1.3: Quantifiers Last time we saw that the negation of the proposition "All good people like dogs" is "Some good people dislike dogs" i.e. "At least one good pers
UMass Lowell - MATH - 141
Section 1.3: The notion of limit Stewart's first definition: We write limxa f(x) = L and say "the limit of f(x), as x approaches a, equals L" if we can make the values of f(x) arbitrarily close to L by taking x to be sufficiently close (but not equal) to
UMass Lowell - MATH - 141
Section 1.3: The notion of limit (continued) [Discuss Example 9 on page 32 two ways: in terms of the picture, and in terms of strategies for Adam and Eve.] The limit of f(x) as x approaches a may be undefined, e.g., limx0 1/x. The existence of the limit,
UMass Lowell - MATH - 141
[Collect summaries of section 1.4] [Hand out time-sheets for assignment #3] Section 1.3: The notion of limit (continued) Claim (see Example 1 from p. 24): If A(h) = 4.9(10+h) for all h 0, limh0 A(h) = 49. Bad proof: "Just plug in h = 0." What's wrong with
UMass Lowell - MATH - 141
Section 1.3: The notion of limit (continued) For the function f(x) = x sin 1/x (defined for all x0) do we have limx0 f(x) = 0?0.4 0.3 0.2 0.1 0.4 0.2 0.1 0.20.20.4.?. Yes. What's Eve's strategy? .?. Eve wins by taking = . Check: For every x satisfyi
UMass Lowell - MATH - 141
[Take formal attendance]Campbell,David Young DeFilippo,James W Durkee,Zachary Martin Durrenberger,Marcelle Denise Gandevia,Munish Munir Graceffa,Erin R Kelly,Maureen Catherine Medeiros,Daniel Raposo Morris,John Patrick Theriault,Matthew Robert Vaughan,St
UMass Lowell - MATH - 141
One-sided limits: Suppose f(x) is a function defined for all values of x close to but less than a; that is, suppose there exists r > 0 such that f(x) is defined whenever x < a with |x a| < r. Then we say that limxa f(x) = L iff there for every > 0 there e
UMass Lowell - MATH - 141
[Hand out time sheets] Prof. Tibor Beke will substitute for me on Thursday and Friday of this week. Section 1.5: Continuity Key concept: Continuity. A continuous function is one that satisfies the direct substitution property limxa f(x) = f(a). Main point
UMass Lowell - MATH - 141
Section 1.5: Continuity (continued) Theorem 1.5.7: If limxa g(x) = b and limxb f(x) = c, then limxa f(g(x) = c, provided that the function f is continuous at b. Note that in the statement of the theorem, we could have written "f(b) = c" instead of "limxb
UMass Lowell - MATH - 141
Section 1.6: Limits involving infinity Key idea: Even though infinity isn't a real number, it can be useful as a way of indicating how functions behave. E.g., for f(x)=1/x2, according to our earlier definition, limx0 1/x2 is undefined, but we find it usef
UMass Lowell - MATH - 141
[Discuss True-False problems on page 70.] 1. "If f is a function, then f(s+t) = f(s) + f(t)." .?. False. Example: f(x) = x2, s = t = 1. Note however that it IS true that (f+g)(t) = f(t) + g(t); that's the definition of f+g. 2. "If f(s) = f(t), then s = t.
UMass Lowell - MATH - 141
[Hand out time-sheet; 241 too!] Revised due-date for assigment #5: 10/10 is a holiday! So it's due 10/12. Don't feel bad about making mistakes on the True/False questions! They're designed to be tricky. Better to make these mistakes now (and thereby learn
UMass Lowell - MATH - 141
Algebra review (preparing for chapter 2): (a2 b2)/(a b) = a + b (a3 b3)/(a b) = a2 + ab + b2 (a4 b4)/(a b) = a3 + a2b + ab2 + b3 (a5 b5)/(a b) = a4 + a3b + a2b2 + ab3 + b4 etc. (a + b)2 = 1a2 + 2ab + 1b2 (a + b)3 = 1a3 + 3a2b + 3ab2 + 1b3 (a + b)4 = 1a4 +
UMass Lowell - MATH - 141
For next Wednesday, read section 2.3. Last time we looked at the function f(x) = x|x|:42-2-112-2-4which can also be described by the two-part formula cfw_x2 if x < 0, f(x) = cfw_ cfw_x2 if x 0. We showed last time that f(x) is differentiable at x
UMass Lowell - MATH - 141
For Thursday, read section 2.4. "Paradox": "Solve x2 = 1. We get x = +1 and x = 1. So 1 = x = 1, implying 1 = 1." .?. An equation is only true (or false) in a context and in a domain of validity. Ignore the context and domain of validity and you may get n
UMass Lowell - MATH - 141
Unfinished business from section 2.2: We saw last time that the continuous function cfw_ x sin 1/x cfw_ cfw_0 is not differentiable at x=0.0.4 0.3 0.2 0.1for x 0 and for x = 0- 0.4- 0.2 - 0.1 - 0.20.20.4Now consider the function f(x) = cfw_ x2 sin
UMass Lowell - MATH - 141
Hand out practice exam. Paradox: Write x2 = x + x + . + x (x added to itself x times). Differentiating both sides, we get 2x = 1 + 1 + . + 1 (1 added to itself x times), or 2x = x. What's going on? .?. The equation x2 = x + x + . + x is valid only when x
UMass Lowell - MATH - 141
[Hand back homework and hand out practice test solutions.] What's the main idea of section 2.6? . Implicit differentiation: To differentiate y with respect to x, you don't always need to write y explicitly in the form f(x); it can be enough to write an al
UMass Lowell - MATH - 141
Questions about the midterm exam? Reminder: Your cheat sheet must be WRITTEN or TYPED by you. The exam will cover up through (and including) section 2.5 (the chain rule). True-false questions on pages 138139: 1. "If f is continuous at a, then f is differe
UMass Lowell - MATH - 141
Hand back homework, collect section notes Section 2.8: Linear approximation and differentials Main idea? .?. Derivatives are good for finding approximate values of functions If f is a differentiable function in the vicinity of x = a, then: for x a, the (u
UMass Lowell - MATH - 141
Section 2.8: Linear approximation and differentials (concluded): Section 2.8, Problem 24: Use differentials to estimate the amount of paint needed to apply a coat of paint 0.05 cm thick to a hemispherical dome with diameter 50 m. Solution: For a hemispher
UMass Lowell - MATH - 141
Puzzle from Monday's lecture: Does there exist an irrational number r such that rsqrt(2) is rational? Hint: The answer is in Wednesday's lecture (sort of!). Solution: We can easily prove that either r = sqrt(2) or r = sqrt(2)sqrt(2) works, but the proof w
UMass Lowell - MATH - 141
Section 3.2: Inverse functions and logarithms (concluded) Fact: If f is an increasing function then f is one-to-one. (Note: Here "increasing" means "strictly increasing".) Proof: If x1, x2 are in the domain of f with x1 < x2, then since f is increasing, f
UMass Lowell - MATH - 141
Last time we saw one way to compute the derivative of xx with respect to x. Another method we can apply is logarithmic differentiation: (d/dx) ln f(x) = f (x) / f(x) That is, if f(x) > 0 on some open interval I, then ln f(x) is differentiable with derivat
UMass Lowell - MATH - 141
Section 3.4: Exponential growth and decay (concluded). Interest If you put $100 in the bank and it's compounded yearly with 12% annual interest, after 1 year you get your original $100 plus $12 interest, for a total of $100 times 1.12 = $112. If your mone
UMass Lowell - MATH - 141
Section 3.5: Inverse trig functions (concluded). Last time we defined arcsin and arccos (also written as sin1 and cos1), and showed that (d/dx) arcsin x = 1 / sqrt(1x2) and (d/dx) arccos x = 1 / sqrt(1x2) for x in the interval . .?. (1,1). If f(x) = cos1
UMass Lowell - MATH - 141
Paradox: 0 = ln 1 = ln (1)/(1) = ln (1) ln (1) = undefined! What's going on? . .?. The rule ln a/b = ln a ln b only says that if ln a and ln b are defined (that is, if a and b are positive), then ln a/b = ln a ln b. It says nothing if ln a is undefined an
UMass Lowell - MATH - 141
Section 3.7: L'Hospital's Rule (concluded) Recall the formal statement of L'Hospital's Rule: Suppose limxa f(x) = 0 and limxa g(x) = 0. Suppose furthermore that f and g are differentiable and g (x) 0 near a except possibly at a itself. Then limxa f(x)/g(x
UMass Lowell - MATH - 141
Chapter Review true/false questions on page 195 #1: "If f is one-to-one, with domain R, then f 1(f (6) = 6." .?. Answer: True. But note that f (f 1(6) need not be defined; e.g., let f(x) = exp(x) or exp(x) + 6. #2: "If f is one-to-one and differentiable,
UMass Lowell - MATH - 141
Section 4.1: Key concepts? .?. Absolute (or global) vs. relative (or local) maxima and minima, critical numbers A function f with domain D has a global maximum at c if f(c) f(x) for all x in the domain of f. We call f(c) the maximum value of f on D. We sa
UMass Lowell - MATH - 141
Section 4.1 (continued): Theorem 3 (Extreme Value Theorem): If f is continuous on the closed interval [a,b], then there exist c and d in [a,b] such that f(x) f(c) for all x in [a,b] and f(x) f(d) for all x in [a,b]. That is, every continuous function whos
UMass Lowell - MATH - 141
Section 4.2: The Mean Value Theorem (continued) Mean Value Theorem: Let f be a function on the interval [a,b] (with a < b) that satisfies 1. f is continuous on the closed interval [a,b] 2. f is differentiable on the open interval (a,b). (We assume a < b.)
UMass Lowell - MATH - 141
Section 4.3: Derivatives and the shapes of graphs (continued) First Derivative Test: Suppose that c is a critical number of a continuous function f, and suppose that f (x) is defined for all x in a neighborhood of c (but not necessarily at c itself). (a)
UMass Lowell - MATH - 141
Section 4.4: Curve Sketching To sketch a curve y = f(x), first identify: A. Domain B. Intercepts C. Symmetry (and periodicity) D. Asymptotes (vertical, horizontal, or slant) (See exercises 4.4.47-50: We say y = L(x) := mx + b is a slant asymptote to y = f
UMass Lowell - MATH - 141
More about slant asymptotes: Consider the hyperbola x2 y2 = 1:210-1-2 -2 -1 0 1 2To see that the hyperbola x2 y2 = 1 has the line y = x as a slant asymptote, take the upper branch y = sqrt(x2 1) and show that it gets arbitrarily close to the line y
UMass Lowell - MATH - 141
Section 4.5, continued: Problem: Which rectangle with area 1 has smallest perimeter? Goal: Minimize P = 2x + 2y subject to xy = 1 Write y in terms of x: .?. y = 1/x P(x,y) = P(x) = 2x + 2/x (for x > 0) Critical points: P = 2 2/x2 which is undefined up at
UMass Lowell - MATH - 141
Section 4.5, concluded: Example 5: Find the area of the largest rectangle that can be inscribed in a semicircle of radius r. Maximize A = 2xy subject to x2 + y2 = r2 with x,y 0. We used symmetry last time to argue that the optimum solution should have x =
UMass Lowell - MATH - 141
Last time we started on the problem of approximating the minimum value of the function x2 sin x. We showed that there is a unique value x* for which this function achieves its global minimum on (,), and that this value is the unique real number satisfying
UMass Lowell - MATH - 141
Section 4.7: Antiderivatives (continued) Recap of last time: The function f(x) = 1/x doesn't have an antiderivative on R, because . .?. f(x) isn't even defined at x = 0. We showed last time that the most general antiderivative of f(x) = 1/x on the set S =
UMass Lowell - MATH - 141
For Wednesday: do true/false questions for chapter 4. Also, does there exist a twice-differentiable function f on R satisfying f (x) < 0 and f (x) > 0 for all x? Section 4.7: Antiderivatives (concluded) Last time we asked "Does the function f(x) = |x| hav
UMass Lowell - MATH - 141
Note: The exams may not have exactly three questions per day. If there are more questions, they'll be easier individually! Sometimes finding antiderivatives is tricky: An antiderivative of f(x) = (sin x) (ex) is .?. (1/2) (sin x) (ex) (1/2) (cos x) (ex).
UMass Lowell - MATH - 141
[Hand out cover sheet for exam and read it aloud] The exam will focus on sections 2.6 to 4.7. You may use a five-page "cheat-sheet", but it must be created by you; you cannot photocopy reference books or print things out from the web. I aim to arrive here
UMass Lowell - MATH - 141
Math 141, Problem Set #1 (due in class Fri., 9/9/11) Stewart, section 1.1, problems 4, 6, 14, 18, 24, 26, 28, 32, 36, and 46. (For problem 46, don't forget the instructions that govern problems 45-49 on page 10.) Also: A. Let x, y, and z respectively deno
UMass Lowell - MATH - 141
Math 141, Problem Set #2 (due in class Fri., 9/16/11) Stewart, section 1.2, problems 16, 18, 24, 32, 38, 50, 52, 64. For problem 24, write x2 - 4x + 3 as (x - 2)2 - 1 ("completing the square"). Stewart, section 1.3, problems 4, 8, 10, 22. Note that in thi
UMass Lowell - MATH - 141
Math 141, Problem Set #3 (due in class Fri., 9/23/11) Stewart, section 1.3, problems 24, 32, 34, 44, 46. (Note: For problem 1.3.24, you don't need to find ALL 's that work, or even the largest that works; it's enough to find ONE that works, so just find o
UMass Lowell - MATH - 141
Math 141, Problem Set #4 (due in class Mon., 10/3/11) Note: To get full credit for a non-routine problem, it is not enough to give the right answer; you must explain your reasoning. Stewart, section 1.5, problems 4, 12, 16, 18, 20, 28, 30, 32, 34, 36, 46,
UMass Lowell - MATH - 141
Math 141, Problem Set #5 (due in class Mon., 10/10/11) Note: To get full credit for a non-routine problem, it is not enough to give the right answer; you must explain your reasoning. Stewart, section 2.1, problems 4, 6, 10, 16, 30, 32, 36, 48. Stewart, se
UMass Lowell - MATH - 141
Math 141, Problem Set #6 (due in class Weds., 10/26/11) Note: To get full credit for a non-routine problem, it is not enough to give the right answer; you must explain your reasoning. Stewart, section 2.4, problems 16, 34, 40, 44, 46, 55. Stewart, section