15 Pages

# h3_6a

Course Number: PHYS PHYS 6a, Spring 2009

College/University: UCSB

Word Count: 2255

Rating:

###### Document Preview

Homework Assignment 3 Solutions Problem 2.33: Air-bag injuries. During an auto accident, the vehicle's air bags deploy and slow down the passengers more gently than if they had hit the windshield or steering wheel. According to safety standards, the bags produce a maximum acceleration of 60 g, but lasting for only 36 ms (or less). How far (in meters) does a person travel in coming to a complete stop in 36 ms at a...

##### Unformatted Document Excerpt
Coursehero >> California >> UCSB >> PHYS PHYS 6a

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.

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:

UCSB - PHYS - PHYS 6a
UCSB - PHYS - PHYS 6a
UCSB - PHYS - PHYS 6a
UCSB - PHYS - PHYS 6a
UCSB - PHYS - PHYS 6a
UCSB - PHYS - PHYS 6a
UCSB - PHYS - PHYS 6a
Problem 1) a) W=| F| | s| cos() and =90 so W=0 b) 0&lt;90 and so cos()&gt;0 so that W&gt;0 c) Here =-180 so W&lt;0 d) =0 so W&gt;0 e) W&lt; 0 f) =-90 so W=0 g) cos()&gt;0 for 0&gt; -90 h) a. | s|=160m , | F| =18N, =0 so W=2900J b. | F| =30N, =30 so W=4200J c. | F| =12N, =-180 so
UCSB - PHYS - PHYS 6a
Problem 7.2 In the rough area, the block decelerates and travels a distance s. We can use the equation vf2= vi2+2ax. When x =s, vf=0. We can solve for acceleration: a=-vi2/2s. We want to find the distance traveled when vf= vi/3. Using vf2= vi2+2ax, we get
UCSB - PHYS - PHYS 6a
Problem 1) a) F=ma and the force supplied by both engines is the same. Therefore car b will have a greater acceleration and hence greater velocity 1 m into the race. b) We know work is change in kinetic energy. Also, W=force*distance. The same amount of w
UCSB - PHYS - PHYS 6a
UCSB - MCDB - mcbd 1A
ENZYME ACTION: EXPERIMENTS WITH TYROSINASESECOND LABORATORYPre-lab Write-Up, Week 2: The pre-lab write-up for the Enzyme Action lab (second experiment) should consist of a table that will act as an outline (i.e., protocol) for the experiment that you wi
UCSB - MCDB - mcbd 1A
EXERCISE8PLANT GENETICS V COMPUTER GENETICS (DROSOPHILA) SEX LINKAGE AND HUMAN GENETICSEquipment and supplies needed:Computers F2 Seedlings Forceps Paper TowelsPART I: Observation and Analysis of Brassica SeedlingsThe purpose of this exercise is to
Harvard - ECON - 1010
WELCOME TO ECONOMICS E-1010: WELCOME TO ECONOMICSMICROECONOMIC THEORYFall 2008 W, 7:35-9:35 Sever 213 Robert Neugeboren 51 Brattle St, Rm 522 W 3-4 and by appt. rshankar@fas.harvard.edu neugebor@fas.harvard.edu TA: Rajiv ShankarSections: Tu 6:30-7:30 o
Harvard - ECON - 1010
UNIT I: Theory of the Consumer Introduction: What is Microeconomics? Theory of the Consumer Individual &amp; Market Demand9/24Theory of the Consumer Preferences How do consumers make Indifference Curves optimal choices? Utility Functions Optimization How
Harvard - ECON - 1010
UNIT I: Theory of the Consumer Introduction: What is Microeconomics? Theory of the Consumer Individual &amp; Market Demand10/1Individual &amp; Market Demand Income &amp; Substitution Effects Normal, Inferior, and Giffen Goods Consumer Demand The Determinants of D
Harvard - ECON - 1010
UNIT II:10/8FIRMS &amp; MARKETS Theory of the Firm Profit Maximization Perfect Competition Review 11/5 MIDTERMTheory of the FirmToday we will build a model of the firm, based on the model of the consumer we developed in UNIT I. Where consumers attempt t
Harvard - ECON - 1010
UNIT II: FIRMS &amp; MARKETS10/15Theory of the Firm Profit Maximization Perfect Competition Review 11/5 MIDTERMProfit Maximization Last Time The Long-Run and the Short-Run Firm and Market Supply Perfect Competition (Part 1)Last TimeWe saw last time th
Harvard - ECON - 1010
UNIT II: Firms &amp; Markets10/22Theory of the Firm Profit Maximization Perfect Competition Review 11/5 MIDTERMPerfect CompetitionIs it true that the rational pursuit of private interests produces coherence rather than chaos, and if so, how is it done?
Pittsburgh - IE - IE 2101
How to Choose a Warehouse Management SystemHow to Choose a Warehouse Management SystemWhen it comes to choosing the right warehouse management system (WMS) for your business, its important to understand your warehouse needs and the benefits of having an
Washington - CS - 100
/* * Compilation: javac HuffmanEncoder.java In.java * Execution: java HuffmanEncoder.java &lt; input.txt * * Read in a list of 8-bit extended ASCII characters and output * their Huffman encoding. * * * % java HuffmanEncoder &lt; abra.txt * * */ public class Huf
Washington - CS - 100
/* HW4 - HuffmanTree.java Junghyun Kim ole2000@cs.uoregon.edu http:/www.cs.uoregon.edu/~ole2000 * */ p package ole2000; public class HuffmanTree cfw_ protected Object data; protected int freq; protected String prefix; protected HuffmanTree parent; protect
Cincinnati - ECON - 101
Principles of Microeconomics Chapter 101.Economic cost can best be defined as:Review QuestionsA) any contractual obligation that results in a flow of money expenditures from an enterprise to resource suppliers. B) any contractual obligation to labor or
McMaster - CAS - 2c03
SOLUTIONS TO THE MIDTERM TEST 1.[10] a.[5] 6n3/(log n + 1) = O(n3) Let c=7, n0=2. For all n 2, log n 1, and log n +1 2 Then, 6n3/(log n +1) 6n3/2 = 3n3 7n3 hold. 10n3 +9 = O(n). We have to find such n (not necessarily the smallest one) that for every n n
McMaster - CAS - 2c03
q:=p+1; while q&lt;&gt;(L.last +1) do if L.elements[q]= L.elements[p] then while q&lt;&gt;(L.last +1) do begin L.elements[q]:= L.elements[q+1] L.last:=L.last-1 end else q:= q+1 p:=p+1 end end(1)O(n2). It looks like 3 nested loops, so O(n3). By more careful investig
McMaster - CAS - 2c03
5.[13] a.[10] type Tree = record labels: array[1.max] of labeltype; n: 1.max; end; procedure Preorder(T: Tree) begin PrintPre(T, 1) end procedure PrintPre(T:Tree, m:1.max) begin if m&gt;T.n then return; write(T.lables[m]); PrintPre(T, 2*m); PrintPre(T, 2*m+1
McMaster - CAS - 2c03
CS2MD3-SOLUTIONS TO THE MIDTERM TEST Summer 2001 1.[20] a.[10] 8pts: procedure DUP(L); var x:^node; temp:^node; begin X:=L; while X^.next&lt;&gt;nil do begin new(temp); x:=x^.next; temp^.element:=x^.element; temp^.next:=x^.next; x^.next:=temp; x:=x^.next; cfw_
McMaster - CAS - 2c03
2.[10] The solution is not unique, for instance the symmetric one is also o.k.1a0.50.30.2 ebcda = 0, b=100, c=101, d=110, e=111 average = 0.51 + 0.153 + 0.153 + 0.13 + 0.13 = 2.03.[10] function SUBSET(A,B:SET):boolean; var p,q:^celltype; begin p
McMaster - CAS - 2c03
4.[10] Final solution (without all the steps)9583467125.[10] a.[4]BFS: 11,12,3,4,5,7,14,15,10,1,2,13,8,9,16 DFS: 11,12,7,8,14,3,15,9,4,10,1,16 preorder: 11,12,7,8,14,3,15,9,4,10,1,16,17,2,5,13 postorder: 8,7,12,14,9,15,3,10,16,17,1,2,4,13,5,1 i
McMaster - CAS - 2c03
SOLUTIONS TO THE MIDTERM TEST 1.[7] function PREVIOUS(p, L) : position; var q : position; begin q := FIRST(L); while qgEND(L) cfw_ or qgnil do if NEXT(q,L) = p then return(q) else q:=NEXT(q); write(invalid position) end; More informal description is Engl
McMaster - CAS - 2c03
4.[15] a.[5]For instanceabcdelast b.[10] The simplest is the recursive procedure: global var T : record nodes : array[1.max] of nodes; last : 0.max end; procedure INORDER(i : 1.max); begin if 2i T.last then INORDER(2i); print (T.nodes[i]); if 2i +
McMaster - CAS - 2c03
always full, and that height(T1)=height(T)-1, height(T2)height(T)-1. Note also that if T1 is not full than height(T2)=height(T)-2. Thus, in this case we have, height(T1)=3-1=2. If T1 is full then the height 2 implies T1 has 4 leafs at the bottom level. Si
McMaster - CAS - 2c03
8342719656.[10] a.[4]BFS: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 DFS: 1,2,7,14,8,3,9,15,4,10,11,16 preorder: 1,2,7,14,8,3,9,15,4,10,11,16,17,12,5,13 postorder: 14,7,2,8,15,9,3,10,16,17,11,12,4,13,5,1 inorder: 14,7,2,8,1,15,9,3,10,4,16,17,11,12,1
McMaster - CAS - 2c03
SOLUTIONS TO THE MIDTERM TEST1.[20] a) possible solutions:solution 1 procedure REMOVEALL(x:element, var L:LIST) var q:position; flag:integer begin flag=0; q:=L; while q^.next&lt;&gt;nil begin if q^.next^.element=x then if flag=0 then begin flag:=1; q:=q^.next
McMaster - CAS - 2c03
if (x=L.elements[i]) then for j:=i+1 to L.last do begin L.elements[j-1]:=L.elements[j]; L.last:=L.last-1; end i:=i+1; end end O(n*n) Solution 2type LIST = record elements: array[1.maxlength] of elementtype; last: integer end; position = integer; prodedur
McMaster - CAS - 2c03
solution 2The average code length is 0.08 3+0.123+0.23+0.23+0.41=2.23.[15]a)1234 abaa f(i) 0 0 1 1 g(i) 0 1 1 2b)5 b 2 26 a 3 3 not needed for (a).solution type1 (general) First note that if n=1 then mn = m &lt; m+1 = m+n, so an algorithm with comple
McMaster - CAS - 2c03
BFS means layer by layer starting from the top, i.e. (layer 1) 1 (layer 2) 2 3 (layer 3) 4 5 6 7 DFS means going to leaf starting from the left and than going back to parents and then to unvisited children, in general going around the tree anticlockwise,
McMaster - CAS - 2c03
else begin z:=x mod y; if z=0 then gcd:=y else begin push(x,y,1),S); goto 0; end end 1: if not empty(S) then (x,y,1) := top (S); pop(S); goto 1; end6.[10] Construct the string C=AA. Then B is a cyclic shift of A if and only if B is a substring of C. To c
McMaster - CAS - 2c03
Solutions to the Midterm Test 1. a. b. c. f(n) = O(n3), g(n)=O(nlogn). Note, log5n =log5 +logn =O(logn) f(n)+g(n) = O(max(f(n), g(n) =O(n3) f(n)g(n) =O(n4logn), since n3*nlogn= n4logn2. a. O(|A|B|), we have to compare each element of one set with each el
McMaster - CAS - 2c03
b. Yes. For instance c(a) = 0, c(b) = 1, c(c) = 00, c(d) = 01, c(e)=10. Then the average length is 1.40. But the code does not have prefix property, and it is useless, because it results in ambiguity when decoding. 4. a. abbabb f(i) 0 0 0 1 2 3 g(i) 0 1 1
McMaster - CAS - 2c03
if DATA(v)=x then return(true); if LEFTMOST_CHILD(v,T)&lt;&gt; null then begin v:= LEFTMOST_CHILD(v,T); ENQUEUE(v,level); while RIGHT_SIBLING(v,T)&lt;&gt;null do begin v:=RIGHT_SIBLING(v,T); ENQUEUE(v,level); end end end return(false) end c. O(n). In worst case, all
McMaster - CAS - 2c03
SOLUTIONS TO THE MIDTERM TEST1. [15] function NEXT(p: position, L: list): position var q, BEGIN: positin; begin if EMPTY(L) then write(empty list); q:=PROVIOUS(FIRST(L), L); BEGIN:=q; while (PROVIOUS(q,L) &lt;&gt; BEGIN do if PROVIOUS(q,L) = p then return(q) e
McMaster - CAS - 2c03
b.[10] type List = record elements: array[1.maxlength] of elementtype; last: integer; end; procedure ERASE_DUPLICANTS(L: List); var p,q: integer; begin p:=1; while p&lt;&gt;(L.last + 1) do begin q:=p+1; while q&lt;&gt;(L.last +1) do if L.elements[q]= L.elements[p] th
McMaster - CAS - 2c03
Average code length 20.4 + 20.2 + 20.2 + 30.08 + 40.08 + 40.04 = 2.32 The optimal Hoffman code is not unique, however, the average length is unique. 4.[10] a. [6] Pat J F(j) b.[4] A 1 0 b 2 0 a 3 1 b 4 2 a 5 3 a 6 1Same for standard algorithm and KMP. Fo
McMaster - CAS - 2c03
So, the tree should be as, 1 2 3 4 56 7 9 8 104
McMaster - CAS - 2c03
Solutions to Midterm 1.[10] a.[5] Using only definition of O(f(n) prove that the following statement is true: 2n2/(log n + 1) = O(n2) b.[5] Using only definition of O(f(n) prove that the following statement is false: 2n2 +1 = O(n) a) We claim that 2n2/(lo
McMaster - CAS - 2c03
Suppose we are lucky and each time a pivot is such that the sublist to its left is of the same size as that to its right. This would leave us with the sorting of two sublists, each of size roughly n/2. Therefore we have: T(n) = 2T(n/2)+cn for some constan
McMaster - CAS - 2c03
b) 6 / 4 / 3 / 1 \ 7 \ 9After DELETEMIN: 6 /\ 4 7 / \ 3 9 5.[10] Here are eight integers: 8, 5, 9, 3, 2, 10. Sort them using: a.[2] insertion sort b.[5] QuickSort (choose pivot as in the textbook, not randomly) c.[3] merge sort ( non-recursive) Illustrat
McMaster - CAS - 2c03
c) 8, 5, 9, 3, 2, 10 5, 8, 3, 9, 2, 10 \/ | 3, 5, 8, 9, 2, 10 \ / 2, 3, 5, 8, 8, 10, 9Worst case and average case are O(n logn)6.[10] Suppose we are hashing integers with a hash table of length 5 using the hash function h(i)=i mod 5. a.[5] Show the resu
McMaster - CAS - 2c03
CS2MD3. Sample solutions to the assignment 1 (many questions have more than one solutions). Total for this assignment is 214 pts. The assignment is worth 5%. If you think your solution has been marked wrongly, write a short memo stating where marking in w
McMaster - CAS - 2c03
In principle it suffices to find such n than for every n n, g(n)&gt;Cf(n). Then clearly for every n &gt; max(n, n0&gt;0), the above formula hold. In practice finding n is considered as a solution. It does not need to be the smallest n such that g(n)&gt;Cf(n). a.[3] 1
McMaster - CAS - 2c03
n+1 &gt; Clogn. Clearly n+1 &gt; n, so it suffices to solve n &gt; Clogn. From the question 1d above we conclude that Clogn 2C n1/2. So all we need is to solve n &gt; 2Cn1/2, or equivalently n1/2 &gt; 4C2. This means n &gt; 4C2 implies n+1&gt;Clogn, for all C&gt;0. 3.[15] T1(n)=
McMaster - CAS - 2c03
b.[5]procedure P2(n:integer); var i,j,k : integer; begin for i:=1 to 100000000 do for j:=i-1 to 20*n do for k:=1 to j do cfw_some statement requiring O(1) time end T(n) = 100000000i=1T = 100000000i=1(20nj=i-1T) = 100000000i=1(20nj=i-1(jk=1O(1) = 10000000
McMaster - CAS - 2c03
T(n) = if n1 then C1 else C + T(n-1) +T(n div 2) Let T1(n) and T2(n) be the following functions: T1(n) = if n1 then C1 else C + 2T1 (n-1), T2(n) = if n1 then C1 else C + 2*T2 (n div 2). Clearly T2(n) &lt; T(n) &lt; T1 (n) if n&gt;1. Note that, for n &gt; 1: T1 (n) =
McMaster - CAS - 2c03
7.[55] Sort the following numbers using [5] bubble, [5] insertion, [5] bin, [5] Shell, [10] quick, [15] heap, and both [5] the recursive and [5] non-recursive versions of the 2-way merge sort: 5, 11, 20, 8, 13, 10, 25, 7, 30, 12, 10, 40, 0, 3, 10, 21, 16,
McMaster - CAS - 2c03
Pass16: 0, 3, 5, 7, 8, 10, 10, 10, 11, 12, 13, 16, 20, 21, 25, 30, 40, 74 Pass17: 0, 3, 5, 7, 8, 10, 10, 10, 11, 12, 13, 16, 20, 21, 25, 30, 40, 74 Bin: First pass: Bin:0 20 10 30 10 40 0 101 11 212 123 13 34 745 5 256 167 78 89The concatenated
McMaster - CAS - 2c03
5 incr=411 10 80310716 1220 40 1310 25 2130 740 incr=2310 7510 10813 1120 21 16 1225 4030 740 incr=1 0 quick:3 357 5710 88 10 10 1010 1013 11 11 1216 12 20 21 13 16 20 2125 40 25 3030 74 40 745 11 20 8 13 10 25 7 30 12 10 40
McMaster - CAS - 2c03
11 12 11 12result: 0, 3, 5, 7, 8, 10, 10, 10, 11, 12, 13, 16, 20, 21, 25, 30, 40, 74 heap: 5 insert(5) 5 insert(11) 11 insert(20) 11 20 11 5 insert(13) 8 11 13 20 11 insert(10) 8 10 11 13 20 5 insert(25) 8 5 insert(25) 10 7 13 20 25 5 10 5 insert(8) 8 20
McMaster - CAS - 2c03
0 insert(10) 7 8 10 10 3 511 30 13 12 40 20 25 10 0 insert(21) 7 8 10 10 3 5 11 21 8 30 16 13 insert(16) 7 10 10 25 3 5 10 011 30 13 12 40 20 25 10 2112 40 200 insert(74) 7 8 10 10 3 511 30 13 12 40 20 25 10 21 16 74 3 delete(0) 7 8 10 10 5 1011 30
McMaster - CAS - 2c03
5 delete(3) 7 8 10 16 10 10 11 21 10 30 13 delete(5) 8 167 10 10 12 40 20 25 7411 30 13 12 40 20 25 74 21 8 delete(7) 10 11 12 16 10 1010 delete(8) 11 21 25 30 13 12 16 10 1021 30 13 74 40 20 2574 40 2010 delete(10) 11 21 12 16 delete(10) 10 20 25 2
McMaster - CAS - 2c03
20 delete(16) 21 25 74 25 delete(21) 40 74 40 delete(30) 74 delete(40) 74 delete(25) 30 40 40 delete(20) 30 40 25 7421 3030 74delete(74)result: 0, 3, 5, 7, 8, 10, 10, 10, 11, 12, 13, 16, 20, 21, 25, 30, 40, 74 non-recursive 2-way merge: 5 5 5 5 0 0 11
McMaster - CAS - 2c03
8.[20]Write a program (in pseudo-code) to find the mode (the most frequently occurring element) of a list of elements. What is a complexity of your program?[10] 1. MODE(A) 2. 3. / A: array of elements 4. / F: frequency 5. SORT(A) 6. m 0 7. l 0 8. F(1) 1