# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

6 Pages

### exam07

Course: COMP 108, Fall 2009
School: East Los Angeles College
Rating:

Word Count: 1092

#### Document Preview

: COMP108 DEPARTMENT Computer Science Tel. No. 795-4257 MAY 2007 EXAMINATIONS Bachelor of Arts : Year 1 Bachelor of Science : Year 1 Bachelor of Science : Year 2 Master of Engineering : Year 1 No qualication aimed for: Year 1 ALGORITHMIC FOUNDATIONS TIME ALLOWED : TWO hours INSTRUCTIONS TO CANDIDATES Answer FOUR questions. If you attempt to answer more questions than the required number of questions (in any...

Register Now

#### Unformatted Document Excerpt

Coursehero >> California >> East Los Angeles College >> COMP 108

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.
: COMP108 DEPARTMENT Computer Science Tel. No. 795-4257 MAY 2007 EXAMINATIONS Bachelor of Arts : Year 1 Bachelor of Science : Year 1 Bachelor of Science : Year 2 Master of Engineering : Year 1 No qualication aimed for: Year 1 ALGORITHMIC FOUNDATIONS TIME ALLOWED : TWO hours INSTRUCTIONS TO CANDIDATES Answer FOUR questions. If you attempt to answer more questions than the required number of questions (in any section), the marks awarded for the excess questions answered will be discarded (starting with your lowest mark). All logarithms are to the base 2. PAPER CODE COMP108 page 1 of 6 Continued Question 1 1A. State (without proof) the order of magnitude, in the form of O(f (n)), of the following functions. Use the simplest f (n) possible in your answers. n2 + n log3 n + 5n + 10 II. 6 n3 + n5 + 7n2 + n III. 5 log n + n + log3 n + 1 I. IV. 3n + n4 + 2n + n2 [4 marks] 1B. Consider the following graph G. The label of an edge is the cost of the edge. a 1 e 2 4 3 f 5 b 6 10 c 12 g 7 14 8 d 8 h Using Kruskals algorithm, draw a minimum spanning tree (MST) of the graph G. Write down the order in which the edges are selected. Is the MST drawn unique? (i.e., is it the one and only MST for the graph?) [8 marks] 1C. Referring to the same graph above, nd the shortest paths from the vertex a to all other vertices in the graph G using Dijkstras algorithm. Show the changes of the labels of the vertices step by step and give the order in which edges are selected. [13 marks] PAPER CODE COMP108 page 2 of 6 Continued Question 2 2A. Consider the following graph G. The label of an edge is the edge number. Give the incidence matrix of the graph G. a 3 1 4 e 7 b 2 5 c 6 d f [4 marks] 2B. The time complexity of the merge sort algorithm to sort n numbers, denoted by T (n), can be described by the following recurrence. T (n) = 1 if n = 1, 2T (n/2) + n if n > 1. Show that T (n) = O(n log n) by the substitution method. (Hint: show that T (n) 2n log n for n 2 by Mathematical Induction.) [8 marks] 2C. A length-n sequence S of characters S[0], S[1], , S[n1] is called a palindrome if S is the same as its reverse. For example, CIVIC, DAD, NOON, RADAR are all palindromes. Design and write a pseudo code algorithm to determine if a sequence S of characters is a palindrome or not. What is the worst case time complexity of your algorithm (in big-O notation)? Explain briey. [13 marks] PAPER CODE COMP108 page 3 of 6 Continued Question 3 3A. I. Briey describe the idea of the greedy method. II. Briey describe the idea of the divide-and-conquer method. [4 marks] 3B. Show that the function n3 log n + 2n3 + 3n2 log n + 2n2 + 5n + 2 is O(n3 log n). [8 marks] 3C. Suppose there are two assembly lines each with 4 stations, Si,j . The assembly time is given in the circle representing the station and the transfer time is given next to the arrow from one station to another. S1,1 0 10 10 45 5 S1,2 0 20 10 S1,3 0 10 S1,4 start 5 30 S2,1 0 20 S2,2 5 0 30 S2,3 5 0 10 S2,4 nish I. Using dynamic programming, ll in the table of the minimum time fi [j] needed to get through station Si,j . Show all the intermediate steps in computing these values. j f1 [j] [j] f2 1 2 3 4 II. What is the minimum time f needed to get through the assembly line? III. Which stations should be chosen? [13 marks] PAPER CODE COMP108 page 4 of 6 Continued Question 4 4A. Which of the following problems is/are NP-complete problem(s)? I. Finding minimum spanning tree (MST) in a weighted undirected graph. II. Vertex Cover Problem. III. 0/1 Knapsack problem. IV. Finding the n-th Fibonacci number. 4B. I. [4 marks] Describe what a decision problem is and what an optimisation problem is. II. An optimisation problem can be turned into a decision problem if we add a parameter k; and then ask whether the optimal value in the optimisation problem is at most or at least k. State the decision version of the following optimisation problems: a. Given an undirected graph G, nd the minimum number of colours that is needed to colour the edges in G such that no two edges with the same colour share a common endpoint. b. Given an undirected graph G, nd the maximum number of vertices such that for any two such vertices, there is no edge connecting them. [8 marks] 4C. Consider the following recursive algorithm to compute Fibonacci numbers. Algorithm F (n) if 0 n 1 then result = 1 else if n > 1 then result = F (n 1) + F (n 2) return result Suppose f (n) denote the time complexity of the above algorithm. f (n) satises the following recurrence f (n) = I. 1 if n 1, f (n 1) + f (n 2) + 1 if n > 1. II. Using the iterative method, show that f (n) is exponential in n. III. The above algorithm is not efcient. Design and write the pseudo code of a faster (non-recursive) algorithm using the concept of dynamic programming. What is the time complexity of the faster algorithm (in big-O notation)? [13 marks] Show that f (n) > 2f (n 2). PAPER CODE COMP108 page 5 of 6 Continued Question 5 5A. What are the time complexities (in big-O notation) of the followin...

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:

East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 3 (Suggested Solution)8 February 20081. (a) Base case: When n = 0, L.H.S = x0 = 1, R.H.S = (x1 1)/(x 1) = 1 = L.H.S Therefore, statement is true for n = 0 Induction hypothesis: Assume the statement is true
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Class Test 2 (Friday 18 April 2008)Name: ID:Answer ALL questions. Use the space provided and the back page if necessary. 1. Consider the following graph G. The label of an edge is the cost (weight) of the edge. b c
Sveriges lantbruksuniversitet - BISC - 309
Background knowledge expected Population growth models/equations exponential and geometric logistic Refer to 204 or 304 notes Molles Ecology Chs 10 and 11 Krebs Ecology Ch 11 Gotelli - Primer of Ecology (on reserve)The ecology of small populations
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Assessment 1Suggested solutions1. Target: to prove that 2n3 + n3 log n + 3n2 log n + n2 + 3n + 2 log n + 5 is O(n3 log n). 2n3 n3 log n for all n 4, 3n2 log n n3 log n for all n 3, n2 n3 log n for all n 2,
East Los Angeles College - COMP - 108
COMP108 Continuous AssessmentClass Test 1 (avg 62%) 12 Assessment 1 (avg 64%) Test 2 (avg 57%) Assessment 2 (avg 78%)10861148 7 6 5 5 3 0E or below D5 3 15 3 2 3 2 3 35 5 55 4 3 35 4 220CBAA+A+
Sveriges lantbruksuniversitet - BISC - 404
Reproductive and life history strategies Pollination syndromes Breeding systems Plant Gender and Mating systems Timing/frequency of reproduction Seed dispersal and dormancyParts of a FlowerPollination syndromesPollination syndromes Statis
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsDivide and ConquerPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Algorithmic Foundations COMP108Divide and Conquer Algorithmic FoundationsLearning outcomesCOMP
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108Algorithmic Foundations COMP108Learning outcomes COMP108 Algorithmic FoundationsGraph TheoryAble to tell what is an undirected graph and what is a directed graphKnow how to represent a graph using matrix and lis
McGill - MUMT - 611
Daniel McEnnisMasters Student in Music Technology at McGill UniveristyHomeFeature Extraction SystemA Java Based ApproachPreliminary design documents for version 0.1Class Diagram Use Case Diagram ProjectProposalPast ProjectsMAT proof command
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsGraph TheoryPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Algorithmic Foundations COMP108Learning outcomesAble to tell what is an undirected graph and what is a di
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 8 (Suggested Solution)14 March 20081. Refer to the program GraphSol.java from the tutorial page. 2. Select a fruit F from the box Orange &amp; Apple. If the fruit F is an apple, then the box should be labelled
Allan Hancock College - PILACCAR - 20064
[pic] Primary Industries Levies and Charges Collection Amendment Regulations 2006 (No. 4)1 Select Legislative Instrument 2006 No. 193 I, PHILIP MICHAEL JEFFERY, Governor-General of the Commonwealth of Australia, acting with t
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsGreedy methods Prudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Algorithmic Foundations COMP108Greedy methods .Algorithmic Foundations COMP108Learning outcomesUnder
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 4 (Suggested Solution)15 February 20081. Refer to the program SearchSol.java from the tutorial page. 2. Refer to the program MatchSol.java from the tutorial page. 3. Divide the eggs into four groups. Weigh
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 1018 April 2008Note: If youve spent 10 minutes on a question without any clue of how to proceed, talk to the demonstrator. 1. Suppose there are two assembly lines each with 4 stations, Si,j . The assembly t
Sveriges lantbruksuniversitet - IR - 3461
1ENDLEGISLATED POVERTYN E W S L E T T E RJanuary, 1992IIWe won!Single parents on welfare don't have to look for work or training. The new welfare rule goes into effect immediately. End Legislated Poverty worked for three years to get this
Sveriges lantbruksuniversitet - LIB - 3461
1ENDLEGISLATED POVERTYN E W S L E T T E RJanuary, 1992IIWe won!Single parents on welfare don't have to look for work or training. The new welfare rule goes into effect immediately. End Legislated Poverty worked for three years to get this
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsAlgorithm efficiency + Searching/SortingPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Algorithmic Foundations COMP108Learning outcomesAble to carry out simple asym
Sveriges lantbruksuniversitet - IR - 3471
(TND LEGISLATED#53The B. C. government has changed the welfare law about how much money you can have and still apply for welfare. The new law means that you don't have to use up nearly all your savings before you can apply for welfare. If you are a
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 7 (Suggested Solution)7 March 20081. Iterative method: T (n) = = = = = = = = = = = = 3 T (n 1) + 1 3 (3 T (n 2) + 1) + 1 32 T (n 2) + 3 + 1 32 (3 T (n 3) + 1) + 32 + 3 + 1 33 T (n 3) + 32 + 3 + 1 33 (3,
Sveriges lantbruksuniversitet - IR - 2605
Evidence Based Library and Information Practice 2006, 1:2 Evidence Based Library and Information Practice Commentary Evidence Based Librarianship and Open Access Heather Morrison Project Coordinator, British Columbia Electronic Libr
Sveriges lantbruksuniversitet - LIB - 2605
Evidence Based Library and Information Practice 2006, 1:2 Evidence Based Library and Information Practice Commentary Evidence Based Librarianship and Open Access Heather Morrison Project Coordinator, British Columbia Electronic Libr
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 77 March 2008Note: If you've spent 10 minutes on a question without any clue of how to proceed, talk to the demonstrator. 1. Solve the following recurrence by the iterative method. T (n) = 1 3 T (n - 1) + 1
Sveriges lantbruksuniversitet - IR - 2059
EVIDENCE ON THE BANK LENDING CHANNEL IN UKRAINEInna Golodniuk University Degree in Physics, Chernivtsi National University, 1997 MA in Economics, University of Kyiv-Mohyla Academy, 1999PROJECT SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS
Sveriges lantbruksuniversitet - LIB - 2059
EVIDENCE ON THE BANK LENDING CHANNEL IN UKRAINEInna Golodniuk University Degree in Physics, Chernivtsi National University, 1997 MA in Economics, University of Kyiv-Mohyla Academy, 1999PROJECT SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 629 February 20081. Merge sort is a sorting algorithm that divides n numbers into two halves, recursively sorts each of them, and then merge the two resulting sorted lists into a final sorted list. Apply mer
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Assessment 1Deadline: Friday, 7 March 2008 (4pm)(Submit to Student One-Stop-Shop) 1. Prove that the function 2n3 +n3 log n+3n2 log n+n2 +3n+2 log n+5 is O(n3 log n). Remember to explain for each term why it is no mor
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsIntroduction + Mathematical InductionPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108/200708Algorithmic Foundations COMP108Module information Algorithmic Foundation
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 125 January 20081. Simplify the following mathematical expressions (a) (x - 2)(x + 1) + x + 2 (b) x2 + 2x + 1 (d) 2 + log2 (x/4) 2. Give the trace table and the output of the following algorithm for m = 16.
Sveriges lantbruksuniversitet - IR - 1590
Playful Play with Games: Linking Level Editing to Learning in Art and DesignMaia EngeliPlanetary Collegium University of Plymouth UK maia@enge.li ABSTRACT The title Playful Play with Games refers to the possibility of creative involvement with game
East Los Angeles College - COMP - 108
AlgorithmicFoundations COMP108COMP108 AlgorithmicFoundationsDivideandConquerPrude Wong ncehttp:/www.csc.liv.ac.uk/~pwong/te aching/com p108AlgorithmicFoundations COMP108DivideandConquerAlgorithmicFoundationsLearningoutcomesCOMP108 U
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsAlgorithm efficiency + Searching/SortingPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Learning outcomes Ableto carry outAlgorithmic Foundations COMP108sim asympt
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsIntroduction + Mathematical InductionPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108/200708Algorithmic Foundations COMP108Module information .Teaching TeamDr Prud
East Los Angeles College - COMP - 108
AlgorithmicFoundations COMP108COMP108 AlgorithmicFoundationsGraphTheoryPrude Wong ncehttp:/www.csc.liv.ac.uk/~pwong/te aching/com p108Learningoutcomes Ableto te llAlgorithmicFoundations COMP108what is an undire d graph and what is a cte
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsDynamic ProgrammingPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Algorithmic Foundations COMP108Dynamic programmingan efficient way to implement some divide and
Sveriges lantbruksuniversitet - ECON - 305
Problem Set #5 Answer KeyEconomics 305: Macroeconomic Theory Spring 20071Chapter 9, Problem #1There are two eects of an increase in the depreciation rate. First, given the marginal product of capital in period two, M PK , the net marginal prod
East Los Angeles College - COMP - 108
AlgorithmicFoundations COMP108COMP108 AlgorithmicFoundationsGreedymethods Prudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108AlgorithmicFoundations COMP108GreedymethodsLearningoutcomes Unde rstand whatAlgorithmicFoundations COMP
Sveriges lantbruksuniversitet - ECON - 305
Econ 305 Spring 2008 Tutorial Notes 2Chapter 3 3. Correlation a) Positive. b) Negative. c) Negative. d) Positive. e) Politicians would certainly argue that the correlation is positive. Others may be less sure. f) 4. Leads and Lags. a) The cleanlines
East Los Angeles College - COMP - 108
0 1 0 1 1 0 0 0 01 0 1 0 0 1 0 0 00 1 0 0 0 0 0 0 01 0 0 0 0 0 1 1 01 0 0 0 0 0 0 0 00 1 0 0 0 0 0 0 10 0 0 1 0 0 0 0 00 0 0 1 0 0 0 0 00 0 0 0 0 1 0 0 0
East Los Angeles College - COMP - 108
30 40 30 3050 10 20 1040 20 40 3010 50
Hudson VCC - BOT - 006
Soi l sthe una ppr eci a ted na tur a l r esour ceFr ed M a gdoff D ept. Pl a nt &amp; Soi l Sci enceYou ask me to pl ow the gr ound. Shal l I take a kni fe and tear my mother s br east? Native American ChiefM any a hi l l si de do the tor r ent
East Los Angeles College - COMP - 108
5 2 15 15 4 4 119 1 3 24 7
East Los Angeles College - COMP - 108
0 0 0 1 1 00 0 1 1 0 00 1 0 0 0 01 1 0 0 0 01 0 0 0 0 10 0 0 0 1 0
East Los Angeles College - COMP - 108
0 0 0 1 1 10 0 1 1 0 00 1 0 0 0 01 1 0 0 0 01 0 0 0 0 11 0 0 0 1 0
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Examination 2005-06Suggested solutions Question 1 Solution1A. Adjacency matrix of G: a b c d e f a 0 1 1 1 0 0 b 1 0 1 0 1 1 c d e 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 f 0 1 1 1 1 0PSfrag replacements1B. Greedy me
Allan Hancock College - PILACCAR - 2003112003
PRIMARY INDUSTRIES LEVIES AND CHARGES COLLECTION AMENDMENT REGULATIONS 2003 (NO. 11) 2003 NO. 305 PRIMARY INDUSTRIES LEVIES AND CHARGES COLLECTION AMENDMENT REGULATIONS 2003 (NO. 11) 2003 NO. 305 - TABLE OF PROVISIONS1. Name of Regulations 2
Sveriges lantbruksuniversitet - M - 202
lab #9 worksheet-- make a new folder for week 9- files for this week: w9edf1.m w9edf2.m w9edf3.m- start matlab &amp; change to the week 9 folderKEY QUESTION: what is the meaning ofthose goodness-of-fit quantities, W^2 and r^2?warm-u
Sveriges lantbruksuniversitet - APMA - 930
Integral Equations Arising From the Incompressible Navier-StokesBryan QuaifeDepartment of Mathematics, SFUthe boundary data. However, I am able to impose either Neumann or Dirichlet boundary data for the full fourth order problem with an integral
Sveriges lantbruksuniversitet - M - 251
Simon Fraser UniversityMATH 251: Calculus III Course Outline Fall 2008Instructor: Office: Office Hours: Workshop Hours: Email: Course Web page: Dr. David Muraki SC K10538 by appointment Mondays 1:30-2:30 in AQ 4110 muraki@sfu.ca newton.science.sfu.
Sveriges lantbruksuniversitet - M - 495
Homework #01 MATH495/STAT490 Introduction to Probability Models submit your write-up Wednesday 17 September. participation in webct discussions is encouraged. please respect page limits &amp; remember to Guidelines for Reports.A) Warm-ups from Ros
Sveriges lantbruksuniversitet - M - 462
March 22, 2004 PATENTSFor Speed in Swimsuits, Add BumpsBy TERESA RIORDANARLIER this month at Pressure, a Manhattan nightclub, buff Olympic swimming hopefuls - including 18-year-old Michael Phelps, who won four gold medals at last year's World Ch
Wilfrid Laurier - EDER - 603
Patriarchal Structuralist Rights and Freedoms Liberal Feminism Marxist/ socialist Feminism Critical Theory Enlightenment Essential Feminism Postmodern Radical Feminism Feminist Research Types of FeminismI think, therefore I am Strives to interpret
Wilfrid Laurier - EDER - 603
A Hermeneutic Circle of Epistemologies Reading Ushers (1996) article critiquing epistemological assumptions definitely keeps me travelling on the hermeneutic circle. I keep going around and around these paradigms. I empathize with one paradigm, only
Wilfrid Laurier - EDER - 603
intertextual linguistic constructhistory is less than the past epistemologydiscourse interpretiveWhat History Isinterpretsvalues, positions, ideologies,hermeneutic tied to the historianRemember Hermesrepresentative of the views of the
Wilfrid Laurier - EDER - 603
A full circle This course has been a fantastic experience for me. I finally feel like I understand. Not only do I understand, but I think I can do this. I know that I have to do this. Last year when I started my PhD, I considered words like epistemol
Wilfrid Laurier - EDER - 603
Did I Ever Leave Home?I am scared of getting too excited, but Biesta &amp; Burbules (2003) really makes me feel like I am coming home. Dewy is often cited as the founding theorist for many of my distance education models. I knew of Dewey well before I
Wilfrid Laurier - EDER - 603
Narrative, Biographical and StoryBetter Balance of self and participant Autobiographical Biographical Where is the participants voice Smithbattle (1994) Story is well toldHumans can only interpret themselves within their world Stroobants (2005) A
Allan Hancock College - APTLB - 2001371
1998-1999-2000-2001 The Parliament of the Commonwealth of Australia HOUSE OF REPRESENTATIVES Presented and read a first time Air Passenger Ticket Levy (Collection) Bill 2001 No. , 2001 (Transport and Regional Services) A Bi
Wilfrid Laurier - EDER - 677
Synchronous tools1Evaluation of Synchronous Communication ToolsKaren Chisvin Krista Poscente Denis BeaulieuEDER 677 Distributed Learning University of Calgary For Dr. Qing LiTuesday, October 12, 2004Synchronous tools2Abstract We eval
Wisc La Crosse - MATH - 145
Math 145January 23, 2007Outline1. 2. 3.Recap Other Sampling Designs Graphical methodsStatistics is the science of collecting, analyzing, interpreting, and presenting data.Two kinds of Statistics:1. 2.Descriptive Statistics. Inferenti
Wilfrid Laurier - EDER - 677
Kristas EDER 677 Journal Entry for Session 11: Instructional and Digital DesignBalancing Synchronous Activities with Distance Educations Flexibility Diverse Populations Before I read Qing and Brads paper (Li &amp; Johnson, 2004) I had not thought of ou