39 views

Uploaded by ahmbash

EECS 2011 Problem Set 1 Solutions

- t Rns Formations
- Asymptotics-HandoutNoNotes
- 1.pdf
- Roughness and Growth Characteristics of Self-Affine Thin Gold Films
- Archie Hingle Pickett
- Ziad's Mind Logging
- Math 30-1 Formula Sheet
- APA Lecture Notes Part1
- Furman 2008 Exam
- function gamma.pdf
- Course File CSE 6th Sem DAA
- narep353
- Algorithm Analysis Big Oh
- MT1D_eng
- i001Using Function Max(..., ...) for Art Class Computing
- Using Lograrithmic Graph Paper
- l Hopital
- Fem
- MATH - CG - Curriculum
- Chapter 3

You are on page 1of 3

Instructor: James Elder

1. Prove whether each of the following is true or false. x and y are real variables.

1)

2)

3)

4)

5)

x y

y x

x y

y x

a x

xy =5

xy =5

xy =0

xy =0

y [x = a or x y = 5]

Answer:

(a) x y x y = 5 is false. Let x = 0. Then y must be 50 , which is impossible.

(b) y x x y = 5 is false. Let y be an arbitrary real value and let x = y6 if y = 0 and x = 0 if

y = 0. Then x y = 5.

(c) x y x y = 0 is true. Let x be an arbitrary real value and let y = 0. Then x y = 0.

(d) y x x y = 0 is true. Let y = 0 and let x be an arbitrary real value. Then x y = 0.

(e) a x y [x = a or x y = 5] is true. Let a = 0. Let x be an arbitrary real value. If x = 0 then

[x = 0 or x y = 5] is true because of the left. If x = 0 then let y = x5 and [x = 0 or x y = 5]

is true because of the right.

2. Asymptotic Running Times

True or False? All logarithms are base 2. No justification is necessary.

(a) 5n2 log n O(n2 )

Answer: False. It is a factor of log n too big.

(b) 4

8n

O(84n )

(c) 210 log n + 100(log n)11 O(n10 )

Answer: True: 210 log n = n10 , 100(log n)11 O(n10 ).

(d) 2n2 log n + 3n2 (n3 )

Answer: False: 2n2 log n + 3n2 O(n3 ), but 2n2 log n + 3n2

/ (n3 ).

3. Big-Oh Definition

Fill in the blanks:

f (n) O(g(n)) iff

c > 0,

n0 , f (n)

cg(n)

Answer:

f (n) O(g(n)) iff c > 0, n0 > 0, such that n n0 , f (n) cg(n)

4. Order the following functions by increasing asymptotic growth rate:

4n log n + 2n 210

3n + 100 log n 4n

n2 + 10n

n3

2log n

2n

n log n

Answer:

(a)

(b)

(c)

(d)

(e)

(f)

(g)

(h)

(i)

210

2log n

3n + 100 log n

4n

n log n

4n log n + 2n

n2 + 10n

n3

2n

Answer:

log n 2 n 4. Thus n log n n n n 4 n log n n (n).

6. Prove that if d(n) is O(f (n)) and e(n) is O(g(n)), then the product d(n)e(n) is O(f (n)g(n)).

Answer:

d(n) O (f (n)) c1 , n1 > 0 : d(n) c1 f (n)n n1 .

Similarly,

e(n) O (g(n)) c2 , n2 > 0 : e(n) c2 f (n)n n2 .

Thus, letting c0 = c1 c2 and n0 = max {n1 , n2 }, we have

d(n)e(n) c0 f (n)g(n)n n0 d(n)e(n) O (f (n)g(n)).

7. An evil king has n bottles of wine, and a spy has just poisoned one of them. Unfortunately, they dont

know which one it is. The poison is very deadly; just one drop diluted even a billion to one will still kill.

Even so, it takes a full month for the poison to take effect. Design a scheme for determining exactly

which one of the wine bottles was poisoned in just one months time while expending only O (log n)

royal tasters. State your scheme briefly, in English.

Answer: Label each bottle from 0 to n 1, and consider each as a binary number consisting

of log n bits. Now assemble log n royal goblets. Take a drop from each of the bottles whose

lowest order bit is set and deposit in the first goblet. Then take a drop from each bottle whose 2nd

bit is set and deposit in the second goblet. Continue in similar fashion through the highest-order

bit. Now hand each of the royal tasters one of the goblets and command them to drink. Note that

there is now a 1:1 correspondence between bits and tasters. In a month, some of your tasters will

drop dead. Set the corresponding bits to 1, and all other bits to 0. The resulting binary number

identifies the poisoned bottle. Long live the king!

2

True or False? All logarithms are base 2. No justification is necessary.

( )

(a) 2n n3

Answer: True

( )

(b) 3n3 + 17n2 O n3

Answer: True. For example, 3n3 + 17n2 20n3 n 1.

(c) 5n2 log n O(n2 )

Answer: False. It is a factor of log n too big.

(d) 2

10 log n

(e) 2n2 log n + 3n2 (n3 )

Answer: False: 2n2 log n + 3n2 O(n3 ), but 2n2 log n + 3n2

/ (n3 ).

9. Show that n2 is (n log n).

Answer: We seek a c > 0, n0 > 0 : n n0 , n2 cn log n n c log n. Let c = 1. Then we

require that n log n. This is satisfied n 1. Thus n2 is (n log n).

- t Rns FormationsUploaded byEd
- Asymptotics-HandoutNoNotesUploaded byHussain Al-Aali
- 1.pdfUploaded bydennypolarisz
- Roughness and Growth Characteristics of Self-Affine Thin Gold FilmsUploaded bytwjdewild
- Archie Hingle PickettUploaded byVedarini Saraswati
- Ziad's Mind LoggingUploaded byali
- Math 30-1 Formula SheetUploaded byCM2607
- APA Lecture Notes Part1Uploaded bySheela Shivaram
- Furman 2008 ExamUploaded byBHAAJI0001
- function gamma.pdfUploaded byCesar Colorado
- Course File CSE 6th Sem DAAUploaded bybias bhadra
- narep353Uploaded byfewie
- Algorithm Analysis Big OhUploaded byLaxman Adhikari
- MT1D_engUploaded byEmRan Leghari
- i001Using Function Max(..., ...) for Art Class ComputingUploaded bysfofoby
- Using Lograrithmic Graph PaperUploaded byjonathonwu
- l HopitalUploaded byfg
- FemUploaded byConstantin Dorinel
- MATH - CG - CurriculumUploaded byUma Maheswari
- Chapter 3Uploaded byVãrûñ Srîvàstávå
- Programming in QBasicUploaded bySalisu Murtala
- Ib1 Review - End of Year Exam 2012Uploaded bymakunjap
- sol2Uploaded bypoori28
- 2 Basics of Algorithm AnalysisUploaded byCesar Arturo Granados
- Lecture 02Uploaded byvaichidrewar
- DSA Manual 2019.pdfUploaded byJam Sohail Chohan
- 1Uploaded byJr Edades
- Key to Brother Duncans Focus for Final Exam Review SheetUploaded byJonathan D.Duncan
- A level Mathematics Practice Paper F – Pure Mathematics mark scheme.docxUploaded byZaka Ahmed
- Maths Formula SheetUploaded byYedu T Dharan

- MIDTERM EXAM Study Guide.pdfUploaded byahmbash
- MIDTERM EXAM Study Guide.pdfUploaded byahmbash
- First Aid Booklet - Online VersionUploaded byahmbash
- Comp 381 SAS Problems - Week 1 answers.pdfUploaded byahmbash
- Islamic Basics Starter Book.pdfUploaded byahmbash
- Chapter 3 (Colquitt)Uploaded byahmbash
- IncentivesUploaded byahmbash
- Math 2320 Assignment 2 SolUploaded byahmbash
- Chapter 4Uploaded byahmbash
- Chapter 3 (McShane)Uploaded byahmbash
- Math 1190 test 1 solUploaded byahmbash
- ITEC 3010 All SlidesUploaded byahmbash
- The Reconstruction of Religious Thought in Islam-Allama Muhammed IqbalUploaded byEmirUlMumineen
- Adms 2400 - Chapter 2Uploaded byahmbash

- Parent Function ProjectUploaded byjessicarrudolph
- Number of Non Negative Integral Solutions of an EqautionUploaded byVamsi Karthik
- Associated Laguerre PolynomialsUploaded byScottCracer
- Assignment 4Uploaded by123fake
- Kolmogorov ComplexityUploaded bySrijit Sanyal
- Challenge 2009Uploaded byHernán Lucema
- Basics 24 MayUploaded byKNOWLEDGE CREATORS
- Complex Space FactorizationUploaded byOVVOFinancialSystems
- SetsUploaded byVinayPawar
- EDU-WFcDIDrTKLpDvqHUploaded bysantkumar333
- v20_n2.pdfUploaded byJohn Chan
- PB_Thesis_2009Uploaded byTom Davis
- Fpga Implementation of Linear Ldpc EncoderUploaded byInternational Journal of Research in Engineering and Technology
- ExercisesUploaded byAli Ergin
- Beauty of Pascal's TriangleUploaded bydurga prasad
- FUploaded bymajidnsh
- Mathematics: Real NumbersUploaded byAndy_519
- H20-solution[www.alirezaweb.com].pdfUploaded byVahid Esmaeilzadeh
- Number SystemUploaded byCharan Prasad
- Ch1Uploaded byAbhicruiser
- 9-4Uploaded byksr131
- Exam TimetableUploaded byNhất Kỳ
- On the Maximum Degree Chromatic Number of a GraphUploaded byVy'n Iipsychz Athrylith
- Final MTech CS_IT_SW Syllabus (MTU)Uploaded byAvdhesh Gupta
- 552.s13.HW6.solnUploaded byemerson
- ds102_ps6.pdfUploaded bySumathi Kanna
- 03-probsolvUploaded byRaedadobeAdobe
- Distributed DeadlockUploaded bypptdownload81
- Combinatorics on Words PDFUploaded byBecky
- hw6pr2Uploaded byapi-241454978