47 Pages

hw_01

Course: CS 473, Spring 2012
School: University of Illinois,...
Rating:
 
 
 
 
 

Word Count: 921

Document Preview

473: CS Fundamental Algorithms, Spring 2012 Homework 1 (due Tuesday, 23:55:00, January 31, 2012) This homework contains three problems. Read the instructions for submitting the homework on the course webpage. Read the course policies before starting the homework. Collaboration Policy: For this homework, Problems 13 can be worked in groups of up to three students. Each student individually have to also do quiz 1...

Register Now

Unformatted Document Excerpt

Coursehero >> Illinois >> University of Illinois, Urbana Champaign >> CS 473

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.
473: CS Fundamental Algorithms, Spring 2012 Homework 1 (due Tuesday, 23:55:00, January 31, 2012) This homework contains three problems. Read the instructions for submitting the homework on the course webpage. Read the course policies before starting the homework. Collaboration Policy: For this homework, Problems 13 can be worked in groups of up to three students. Each student individually have to also do quiz 1 online. Submission guidelines: For every group of students, one and only one student have to upload the solutions to the homework to the class moodle page. Together with the solutions to the three questions, the submitting student of the group also have to upload a text le that contains the netid of the submitting students. Specically, this text le should be named group.txt. Each student netid (and nothing else) would be written as is on each line of this text le. As such, an example such le might look like: eric2 jeff7 cheng27 Version: 2.11 1. (45 pts.) Briges and cut vertices. Given a connected undirected graph G = (V, E ), an edge e = (u, v ) c d b e is called a bridge , or a cut-edge , if removing e disconnects the graph into two pieces, one containing u and the other containing i f v . A vertex u is called a separating vertex , or cut-vertex , if g h removing u leaves the graph into two or more disconnected pieces; k j note that u does not count as one of the pieces in this denition. p l Your goal in this problem is to develop a linear time algorithm to nd all the bridges and cut-vertices of a given graph using DFS. q rs t Let T be a DFS tree of G (note that it is rooted at the rst node from which DFS is called). For a node v we will use the notation Tv to denote the sub-tree of T hanging at v (Tv includes v ). (A) (4 pts.) In the graph shown above, identify all the bridges and cut-vertices (i.e., list all the bridge edges and cut vertices). (B) (5 pts.) Prove that any bridge of G has to be a tree edge in the tree generated by every DFS(G). Recall the property of DFS in undirected graphs. Why does this show that 1 the maximum number of bridges is n 1? What is a graph that achieves this bound? (C) (8 pts.) Suppose e = (u, v ) is a tree-edge in DFS(G) with pre(u) < pre(v ) (that means u is the ancestor of v ). Prove that e is a bridge if and only if (need to prove both directions) there is no edge from any node in Tv to either u or any of its ancestors. (D) pts.) (5 For each node u dene: low(u) = min (E) (F) (G) (H) pre(u) pre(w) where (v, w) is a back edge for some descendant v of u. Give a linear time algorithm that computes the low value for all nodes by adapting DFS(G). Give the altered pseudo-code of DFS(G) to do this. There is no need to prove that your code is correct. (5 pts.) Give a linear time algorithm that identies all the bridges of G using the low values and the steps above. Specically, provide pseudo-code for a linear time algorithm to do so. There is no need to prove that your code is correct. (5 pts.) Prove that the root of the DFS tree is a cut-vertex if and only if it has two or more children. (8 pts.) Prove that a non-root vertex u of the DFS tree T is a cut-vertex if and only if it has a child v such that no node in Tv has a backedge to a proper ancestor of u (that is, an ancestor of u which is not u itself). (5 pts.) The above two properties can be used to nd all the cut-vertices in linear time. Give the pseudo-code for a linear time algorithm to do so. There is no need to prove that your code is correct. (It is instructive to run DFS(G) on the example graph and compute the pre values and the lowvalues for each node.) 2. (25 pts.) Semi-strongly connected? Let G = (V, E ) be a directed graph. Dene a relation R on the nodes V as follows: uRv i u can reach v or v can reach u. (a) (5 pts.) Is R an equivalence relation? If yes, give a proof, otherwise give an example to show it is false. (b) (20 pts.) Call G semi-strongly-connected if for every pair of nodes (u, v ), uRv . Give a linear time algorithm to determine if G is semi-strongly-connected. By linear time we mean an algorithm that runs in time O(m + n) where m = |E | and n = |V |. 3. (30 pts.) Diameter and low-degree vertex (a) (22 pts.) Let G = (V, E ) be an undirected connected graph. Suppose G has a pair of nodes s, t that are distance d apart. Show that there is a vertex v G such that the degree of v is at most 6n/d where n = |V |. Hint: Consider BFS(s) and show the existence of three adjacent layers with total of at most 6n/d vertices. (b) (8 pts.) Show that for directed graphs the above is not true. More precisely, give an example of a directed graph on n nodes such that there is a pair of nodes s, t such that distance from s to t is (n) and for each node v in the graph, both the in-degree and out-degree are (n). 2
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:

University of Illinois, Urbana Champaign - CS - 473
CS 473: Fundamental Algorithms, Spring 2012Homework 2 (due Tuesday, 23:55:00, February 7, 2012)This homework contains three problems. Read the instructions for submitting the homework on the course webpage. Read the course policies before starting the h
University of Illinois, Urbana Champaign - CS - 473
CS 473: Fundamental Algorithms, Spring 2012Homework 3 (due Tuesday, 23:55:00, February 14, 2012)Collaboration Policy &amp; submission guidelines: See homework 1.Each student individually have to also do quiz 3 online.Version: 1.01. (30 pts.) Saving the w
University of Illinois, Urbana Champaign - CS - 473
CS 473: Fundamental Algorithms, Spring 2012Homework 4 (due Tuesday, 23:55:00, February 21, 2012)Collaboration Policy &amp; submission guidelines: See homework 1.Each student individually have to also do quiz 4 online.Version: 1.21. (30 pts.) Counting sig
University of Illinois, Urbana Champaign - CS - 473
CS 473: Fundamental Algorithms, Spring 2012Homework 5 (due Tuesday, 23:55:00, March 6, 2012)Collaboration Policy &amp; submission guidelines: See homework 1.Each student individually have to also do quiz 5 online.Version: 1.111. (45 pts.) Stock Picking.
University of Illinois, Urbana Champaign - CS - 473
CS 473: Fundamental Algorithms, Spring 2012Homework 6 (due Tuesday, 23:55:00, March 13, 2012)Collaboration Policy &amp; submission guidelines: See homework 1.Each student individually have to also do quiz 6 online.Version: 1.111. (30 pts.) An Improved Al
University of Illinois, Urbana Champaign - CS - 473
CS 473: Fundamental Algorithms, Spring 2012Homework 7 (due Tuesday, 23:55:00, March 27, 2012)Collaboration Policy &amp; submission guidelines: See homework 1.Each student individually have to also do quiz 7 online.Version: 1.11. (30 pts.) 3/4-tree.Consi
University of Illinois, Urbana Champaign - CS - 473
CS 473: Fundamental Algorithms, Spring 2012Homework 8 (due Tuesday, 23:55:00, April 3, 2012)Collaboration Policy &amp; submission guidelines: See homework 1.Each student individually have to also do quiz 8 online.Version: 1.31. (35 pts.) Recomputing corr
Rhode Island - BUS - 428
1. Relative to the spot price, the forward price will bea. Usually less than the spot priceb. Usually greater than the spot pricec. Usually equal to the spot priced. Usually less than or greater than the spot price more often it is equal to the spotp
Rhode Island - BUS - 401
Database ManagementProjectGroup 7Steven ParfittKristen PorterDaniel PoissonBUS 401: Accounting Computer SystemsApril 28, 2011
Rhode Island - BUS - 401
Final Exam-Bliss 205 7:00 PM- May 9, 201140 points MC (Advanced SQL chapter 8) Quiz #2 before Exam20 Points Essay Chapter 7o Key Digital Networking Technology Packet Switching TCPIP Client Server Technologyo Components of Networks Chapter 10o
Rhode Island - BUS - 445
Strategic Management for theCapstone Business Simulation andComp-XM :Analysis and AssessmentMichael L. Pettus, Ph.D.4th EditionALL RIGHTS RESERVED. No part of this work covered by the copyright hereon may be reproduced orused in any form or by any
Rhode Island - BUS - 428
4 . T he l ink b etween t he h ome c urrency v arue o f a f irm's a ssetsa nd ligb:ll!-tjgqnL,.luctua[lonsr&quot;and excl]?.ngeate%r s:(a) Asset exposureiI(b) Operating exposure/-6ffi-a;dTh,\*-J4of the above,ftofo&quot;e,/t\Sk6e-'\interest rate
Rhode Island - BUS - 428
III(d) 4 .00%p .a.9. Some commodities lgygl_]gllgtinto rnternallonail@.Examples include :(a) Nontrad ables/,/(b) H aircut&quot; W . l(c) H ousing /E$itaofthe bove10. TE-inflaliorraie-r7in Canada is now 4% less than Fbaf-iqJapanpp\purchasins o
Rhode Island - BUS - 428
U SE T HE F OLLOWING I NFORMATIONTIONST O A NS\MER T HE N EXT T HREE Q UES-In the belowtable, Pn is the europrice of the asset eld by the U.S.firm and P is the dollar pricehof the asset.A U.S. firm holdsan assetin Fbance nd faces he followingscena.ri
Rhode Island - BUS - 428
1tExam 2Financial ManagementBUS 428: MultinationalF all' 2 010IName: #yffyLffnu,t &amp;SrrnInstructions:r All questions axe multiple choice questions. There a,reL5 questions in total.o Using a No.2 pencil, chsose the best (or most accurate) answer f
Rhode Island - GEG - 201
1. The first type of city Ruchelman identifies is headquarter cities. Headquarters cities are citiesthat have a high concentration of corporations, banks, and high-level producer service entities.One example of a headquarter city is New York City which
Suffolk - TAX - 879
Kristen Porter1/30/12Tax 879Chapter 3 FPE 6 &amp; Chapter 4 FPE 76.Gross Income: Gross wages &amp; Commissions Earned Income from Limited Partnership Dividend &amp; Interest Income earned Capital LossLess Adjustments to AGI: IRA Contribution Alimony Paid
Suffolk - TAX - 879
Kristen Porter1/23/12Chapter 2 # 8, 128.a.8%: $10,000 X 2.159 = $21,590.005%: $10,000 X 1.620 = $16,290.00b.$25,000 X 5.5690 = $139,225c.$210,000 X 1.629 = $342, 090d.$70,000 X 2.079 = $145,530There will not be enough money to pay for my chil
Rhode Island - BUS - 402
UniversityofRhodeIslandBUS402AdvancedAccounting20102011JosephM.DAdamoCourseOutline#3:EquityInvestmentsof20%to50%OwnershipInterestI.Page1of48EquityInvestmentswithSignificantInfluence(2050%OwnershipInterestinInvestee)INVESTORS%OWNERSHIPINTERESTININVE
Rhode Island - BUS - 402
UniversityofRhodeIslandBUS402AdvancedAccounting20102011JosephM.DAdamoCourseOutline#5:AcquisitionAccountingandConsolidations(100%Ownership)I.Page1of34Acquisitionswith100%OwnershipInterestA.AcquirerandAcquireeContinueasSeparateLegalandFiscalEntities
Rhode Island - BUS - 402
UniversityofRhodeIslandBUS402AdvancedAccounting20102011JosephM.DAdamoCourseOutline#4:EquityInvestmentsofover50%OwnershipI.Page1of46EquityInvestmentswithControl(over50%OwnershipInterestinInvestee)INVESTORS%OWNERSHIPINTERESTININVESTEESCOMMONSTOCK0%
Rhode Island - BUS - 402
UniversityofRhodeIslandBUS402AdvancedAccounting20102011JosephM.DAdamoCourseOutline#8:AccountingandReportingIssuesinvolvingForeignCurrenciesI.Page1of35ForeignCurrencyAccountingA.IssuesAddressed1.IndividualTransactionsinvolvingFixedAmountsofaForei
Rhode Island - BUS - 402
UniversityofRhodeIslandBUS402AdvancedAccounting20102011CourseOutline#7:AcquisitionAccountingandConsolidations(&lt;100%Ownership)JosephM.DAdamoPage1of24FASBASC81010ConsolidationGlossaryNoncontrollingInterestTheportionofequity(netassets)inasubsidiarynot
Rhode Island - BUS - 402
UniversityofRhodeIslandBUS402AdvancedAccounting20102011JosephM.DAdamoCourseOutline#2:EquityInvestmentsofLessthan20%OwnershipInterestI.Page1of31OverviewofInvestmentsEquitySecuritiesFASBASC3201020GlossaryEquitySecurityAnysecurityrepresentinganowner
Rhode Island - BUS - 402
UniversityofRhodeIslandBUS402AdvancedAccounting20102011JosephM.DAdamoCourseOutline#9:AccountingforEmployeeBenefitsI.EmployeeBenefits:BackgroundInformationA.Objectives1.CompensationforServicesusedbyEmployer2.IncentivesMotivateemployeesB.Retai
Rhode Island - BUS - 402
UniversityofRhodeIslandBUS402AdvancedAccounting20102011CourseOutline#1:InvestmentsinDebtSecuritiesI.JosephM.DAdamoPage1of26OverviewofInvestmentsinDebtSecuritiesA.Securities:GeneralDescriptionFASBASC3201020GlossaryandMainGlossarySecurityTheevide
Rhode Island - BUS - 402
UniversityofRhodeIslandBUS402AdvancedAccounting20102011JosephM.DAdamoCourseOutline#6:IntraEntityTransactionsI.Page1of16IntraEntitySalesofInventoryA.NatureandPurposeofTransactions1.VerticallyIntegratedParentSubsidiaryPurchasessalestransactionsbe
Rhode Island - BUS - 402
UniversityofRhodeIslandBUS402AdvancedAccounting20102011JosephM.DAdamoCourseOutline#9:AccountingforEmployeeBenefitsAddendumPage1of4PENSIONTRUSTACCOUNTSFairValueofProjectedBenefitPlanAssetsObligation(PBO)BeginningBalanceActualReturnonPlanAssets
Rhode Island - BUS - 402
AccumulatedOtherFairValueofPlanAssets(FV)ProjectedBenefitObligation(PBO)PensionBenefitLiability(cr.)Asset(dr.)NetPeriodicPensionCostDr.UnamortizedPriorServiceCostCr.UnamortizedGainDr.LossDr.TransitionObligation(TO)BeginningBalanceCr.Underfun
Rhode Island - BUS - 402
DeferredTaxEffectsofEquityMethodItems:(ExercisebeginningonPage18)InvestmentinLawsonCorp.(40%)GAAPF/S1/22011OriginalCost12/312011EquityinNetEarnings12/312011InvestmentinLawsonCorp.TAXRETURNEquityinOCI1/2201120,800,00020,800,00019,200,000
Rhode Island - BUS - 402
CostMethodfollowedbyMarktoMarketforAvailableforSaleSecurity:HistoricCostFairValueFairValue$340,000$510,000$820,0001/22010UnrealizedGain$170,000inOCI12/31201012/3112/312011UnrealizedGain$310,000inOCIReverse2012DividendRevenue$50,0005%X$1,
Rhode Island - BUS - 402
OnNovember18,2011,ColbertAmeriConeInc.purchased15,000shares(lessthan1%interest)ofthe commonstockofMorimotoIronWorksInc.at$28.20pershareandincurreda$300brokersfee.11/18 EquityTradingSecuritiesCash423,300423,30011/18 AvailableforSaleEquitySecurities 4
Rhode Island - BUS - 445
Exam 1BUS 428: Multinational Financial ManagementSpring, 2012Name:Instructions: All questions are multiple choice questions. There are 15 questions in total. Using a No.2 pencil, choose the best (or most accurate) answer for each question. When you
Rhode Island - BUS - 445
Multinational Financial ManagementSpring, 2012Sample Mid term 11. In conversation, Interbank FX trades use a shorthand abbreviation in expressing spotcurrency quotations. Consider a $/ bid-ask quote of $1.9072-$1.9077. The big gure,assumed to be know
Rhode Island - BUS - 445
Exam 2BUS 428: Multinational Financial ManagementSpring, 2012Name: All questions are multiple choice questions. There are 15 questions in total. Using a No.2 pencil, choose the best (or most accurate) answer for each question. When you need to chang
Rhode Island - BUS - 445
Multinational Financial ManagementSpring, 2012Sample Mid term 21. When Interest Rate Parity (IRP) does not hold(a) there is usually a high degree of ination in at least one country(b) the nancial markets are in equilibrium(c) there are opportunities
Suffolk - TAX - 802
SOLUTIONS TO PROBLEM MATERIALS10-3a.b.c.10-12The treatment of shareholder advances that become worthless is an extremely important topic because of therestrictions that may be imposed on the taxpayers deduction (e.g., at worst, the taxpayers deduct
Suffolk - TAX - 802
Solutions to Problem Materials1SOLUTIONS TO PROBLEM MATERIALS11-27a.Prescription medicine and drugsHospitalization insuranceDoctors and dentistsLess 7.5% of $20,000 (A.G.I.)Medical expense deductionb.c.11-31$ 3006001,100$2,000(1,500)$ 50
Suffolk - TAX - 802
SOLUTIONS TO PROBLEM MATERIALS9-18Section 1016 requires that the basis of property be adjusted to reflect allowed or allowable depreciation. Although R has notclaimed any depreciation on the property, she must reduce the basis by the amount allowable,
Hashemite University - ENGINEERIN - 110400101
1- , )( , , , , , , .2- , - , , , .3-
Suffolk - TAX - 802
Solutions to Problem Materials 1CH. 12 - SOLUTIONS TO PROBLEM MATERIALS12-11Taxpayers are required to treat one or more trade or business activities or one or morerental activities as a single activity if the activities constitute an appropriate econo
Hashemite University - ENGINEERIN - 110400101
:- : , . :-Conduction1. Convective2. Radiation3. ( ( Boiler ) (Radiator
Suffolk - TAX - 802
1Chapter 9CAPITAL RECOVERY:DEPRECIATION,AMORTIZATION,AND DEPLETIONLECTURE OUTLINEI.Introduction.A.Concept of capital recovery.1.2.B.Cost allocation methods.1.2.3.II.Income doesnt occur until taxpayer recovers cost of producing income.Ex
Hashemite University - ENGINEERIN - 110400101
, ,
Suffolk - TAX - 802
1Chapter 10CERTAIN BUSINESSDEDUCTIONSAND LOSSESLECTURE OUTLINEI.Introduction.A.This chapter examines specific provisions governing certain deductions and losses common to businesses.B.Topics considered:1.2.3.4.II.Losses in general.A.Gene
Hashemite University - ENGINEERIN - 110400101
1- , )( , , , , , , .2- , - , , , .3-
Hashemite University - ENGINEERIN - 110400101
, ,
Suffolk - TAX - 802
1Chapter 11ITEMIZED DEDUCTIONSLECTURE OUTLINEI.Introduction.A.Deductions allowed for certain investment expenses and personal expenditures are referred to as itemized deductions.B.Generally, itemized deductions are claimed only if they exceed the
Hashemite University - ENGINEERIN - 110400101
: :1- .2- .3- .4 - .5- . .6- .7-
Suffolk - TAX - 802
1Chapter12DEDUCTIONSFORCERTAININVESTMENTEXPENSESANDLOSSESLECTUREOUTLINEI.At-risk rulesA. General rules1. Taxpayers are entitled to deduct losses only to the extent they are at-riska. Unused losses are suspended until the taxpayer has increased the
Hashemite University - ENGINEERIN - 110400101
: :1- 2- 3- conductivityconvectionradiation ) (boiler ) (radiator
Hashemite University - ENGINEERIN - 110400101
1. :Boller2.Barner1. 3. Collector4. Rachitic 5. Cylinder 6. Expansion tank7. .Other secondary parts. :1. 2. 3. 4. :.
Hashemite University - ENGINEERIN - 110400101
: :1. ).( Lab Coat2. .3. .4. .5. , .6. . : :
Hashemite University - ENGINEERIN - 110400101
: :1- .2- .3- .4 - .5- . .6- .7-
Hashemite University - ENGINEERIN - 110400101
: :1- 2- 3- conductivityconvectionradiation ) (boiler ) (radiator
Hashemite University - ENGINEERIN - 110400101
: , .
Hashemite University - ENGINEERIN - 110400101
: :1. .2. :.Boiler.Burner.Collector.Radiator. (ExpansionTank(Extension. .3. :. .. .. .. &quot; . :
Hashemite University - ENGINEERIN - 110400101
, ,
Hashemite University - ENGINEERIN - 110400101
: , : : 09 /54: : : T : )( : ,
Hashemite University - ENGINEERIN - 110400101
) )2 : 254016002: . : : - 1 :), -2 -3 -4 -5 -6: : -1
Hashemite University - ENGINEERIN - 110400101
:-123456789011121 . . . :- :-1- .2-3- .