69
The Complexity of Songs By Rohan Sharma

The Complexity of Songs

Embed Size (px)

Citation preview

Page 1: The Complexity of Songs

The Complexityof Songs

By Rohan Sharma

Page 2: The Complexity of Songs

Disclaimer

Page 3: The Complexity of Songs

“The Ideal Talk”

Page 4: The Complexity of Songs

Introduction

Page 5: The Complexity of Songs

Informative

Page 6: The Complexity of Songs

Accessible

Page 7: The Complexity of Songs

< 10 minutes

Page 8: The Complexity of Songs

My Talk

Page 9: The Complexity of Songs

No introduction

Page 10: The Complexity of Songs

Uninformative

Page 11: The Complexity of Songs

Arcane

Page 12: The Complexity of Songs

Possibly> 10 minutes

Page 13: The Complexity of Songs

Possibly> 10 minutes

Page 14: The Complexity of Songs

</Disclaimer>

Page 15: The Complexity of Songs

ComputerScience

Page 16: The Complexity of Songs

ComputerScience

Page 17: The Complexity of Songs

ComputerScience

Page 18: The Complexity of Songs
Page 19: The Complexity of Songs

ComputerScience

Page 20: The Complexity of Songs
Page 21: The Complexity of Songs

Astronomy

Page 22: The Complexity of Songs
Page 23: The Complexity of Songs

Warning:Boring Stuff Ahead!

Page 24: The Complexity of Songs
Page 25: The Complexity of Songs

Computational Complexity

Page 26: The Complexity of Songs

Largest Member

Page 27: The Complexity of Songs

3 2 7 9 1

Page 28: The Complexity of Songs

3 2 7 9 1

Page 29: The Complexity of Songs

3 2 7 9 1

Page 30: The Complexity of Songs

3 2 7 9 1

Page 31: The Complexity of Songs

3 2 7 9 1

Page 32: The Complexity of Songs

3 2 7 9 1

Page 33: The Complexity of Songs

3 2 7 9 1

Page 34: The Complexity of Songs

3 2 7 9 1

Page 35: The Complexity of Songs

Linear TimeO(n)

Page 36: The Complexity of Songs

Binary Search

Page 37: The Complexity of Songs

3 7 10 21 33 39 46

Search for 10

Page 38: The Complexity of Songs

3 7 10

Search for 10

Page 39: The Complexity of Songs

10

Found 10

Page 40: The Complexity of Songs

Logarithmic timeO(lg n)

Page 41: The Complexity of Songs
Page 42: The Complexity of Songs
Page 43: The Complexity of Songs
Page 44: The Complexity of Songs
Page 45: The Complexity of Songs

The Complexity of Songs

Page 46: The Complexity of Songs
Page 47: The Complexity of Songs

How?

Page 48: The Complexity of Songs

Letters?

Page 49: The Complexity of Songs

Tedious!

Page 50: The Complexity of Songs

Words?

Page 51: The Complexity of Songs

Yes!

Page 52: The Complexity of Songs

Toughest: O(n) Easiest: O(1)

Page 53: The Complexity of Songs
Page 54: The Complexity of Songs

Never gonna give you upNever gonna let you downNever gonna run around and desert youNever gonna make you cryNever gonna say goodbyeNever gonna tell a lie and hurt you

Page 55: The Complexity of Songs

Never gonna give you upNever gonna let you downNever gonna run around and desert youNever gonna make you cryNever gonna say goodbyeNever gonna tell a lie and hurt you

FAIL

Page 56: The Complexity of Songs

Breakthrough

Page 57: The Complexity of Songs
Page 58: The Complexity of Songs

O(n1/2)

Page 59: The Complexity of Songs

The Twelve Days of Christmas

On the first day of Christmas my true love sent to me A partridge in a pear tree.

On the second day of Christmas my true love sent to me Two turtle doves, and a partridge in a pear tree.

On the third day of Christmas, my true love sent to me Three French hens, two turtle doves, and a partridge in a pear tree.

Page 60: The Complexity of Songs

The Twelve Days of Christmas

On the first day of Christmas my true love sent to me gift 1

On the second day of Christmas my true love sent to me gift 1, gift 2

On the third day of Christmas, my true love sent to me gift 1, gift 2, gift 3

...

On the nth day of Christmas, my true love sent to me gift 1, gift 2, gift 3, ..., gift n

Page 61: The Complexity of Songs

The Twelve Days of Christmas

gift 1gift 1, gift 2gift 1, gift 2, gift 3...gift 1, gift 2, gift 3, ..., gift n

Page 62: The Complexity of Songs

The Twelve Days of Christmas

gift 1gift 1, gift 2gift 1, gift 2, gift 3...gift 1, gift 2, gift 3, ..., gift n

Page 63: The Complexity of Songs

O(n1/2)

Page 64: The Complexity of Songs

Breakthrough #2

Page 65: The Complexity of Songs

N Bottles of Beer

n bottles of beer on the walln bottles of beer!You take one down, and pass it aroundn - 1 bottles of beer on the wall!

Page 66: The Complexity of Songs

O(lg n)

Page 67: The Complexity of Songs
Page 68: The Complexity of Songs

O(1)

Page 69: The Complexity of Songs

Questions?