[SER222] Asymptotics (4/5): Tight Bounds

Ruben Acuna
30 Aug 201712:24

Summary

TLDREl guion trata sobre los límites superior e inferior de las funciones y cómo los límites ajustados (tight bounds) son útiles para modelar el comportamiento de programas. Se explica que los límites ajustados son cuando dos funciones se superponen y se convierten en idénticas a medida que el tamaño de la entrada se hace muy grande. Se introduce el símbolo 'tilde' para representar límites ajustados y se contrasta con 'big O', que arroja información. Además, se menciona el símbolo 'theta', que representa límites ajustados cuando una función es tanto big O como Omega de otra, aunque es menos común debido a su dificultad para ser demostrado.

Takeaways

  • 📈 Los límites ajustados (tight bounds) son una forma de describir las relaciones entre funciones donde, para valores grandes de x, dos funciones se solapan y se comportan de manera idéntica.
  • 🔢 Un ejemplo de límite ajustado es la relación entre las funciones x^4 + 2x y x^4, donde para valores de x muy grandes, ambas funciones se comportan de manera similar.
  • 📚 El límite ajustado se representa con el símbolo 'tilde' (~) y se usa para mantener información sobre la función de crecimiento, incluyendo el coeficiente.
  • ✂️ Para encontrar un límite ajustado, se eliminan todos los términos menos el término dominante, pero se mantiene el coeficiente.
  • 📊 Para validar un límite ajustado, se toma el límite del ratio de la función original y la función límite ajustada, y si el resultado es uno, entonces la función límite ajustada es válida.
  • 📐 La diferencia entre Big O y límite ajustado (tilde) es que Big O descarta el coeficiente, mientras que el límite ajustado lo mantiene, lo que puede ser útil para comparar funciones con diferentes coeficientes.
  • 📉 El límite ajustado Theta (Θ) se usa cuando una función es tanto Big O como Omega de otra función, lo que significa que tiene límites superior e inferior que se encuentran.
  • 🛑 Es difícil obtener límites Theta porque requiere que los límites superior e inferior sean iguales, lo que a menudo no ocurre en las funciones de crecimiento.
  • 📖 Aunque Theta es popular en la literatura, es menos común usarlo en la práctica debido a la dificultad de demostrar que los límites superior e inferior son iguales.
  • 🔄 La preferencia general es por el límite ajustado (tilde) porque mantiene más información y es más fácil de escribir y entender que Theta.

Q & A

  • ¿Qué son los límites superior e inferior de una función?

    -Los límites superior e inferior de una función son valores que proporcionan una estimación de la complejidad de una función. El límite superior (O) indica el peor caso y el límite inferior (Ω) indica el mejor caso.

  • ¿Qué es un límite ajustado y cómo se relaciona con las funciones?

    -Un límite ajustado es una función que se asemeja mucho a otra función a medida que el tamaño de la entrada se hace grande. Se dice que dos funciones están ajustadas si su relación se acerca a 1 cuando la entrada se vuelve muy grande.

  • ¿Cómo se determina si dos funciones están ajustadas entre sí?

    -Para determinar si dos funciones están ajustadas, se calcula el límite de la razón entre ellas cuando el número de entradas tiende al infinito. Si ese límite es 1, las funciones están ajustadas.

  • ¿Cuál es la diferencia entre un límite ajustado (tilde) y un límite superior (O)?

    -El límite ajustado (tilde) mantiene la información del coeficiente, mientras que el límite superior (O) lo descarta. Esto hace que el límite ajustado sea más preciso y conservador de información.

  • ¿Cómo se determina el límite ajustado (tilde) de una función de crecimiento?

    -Para encontrar el límite ajustado de una función de crecimiento, se mantienen los términos dominantes y se eliminan los términos subdominantes, sin descartar el coeficiente.

  • ¿Por qué es preferible usar límites ajustados (tilde) en lugar de límites superiores (O)?

    -Los límites ajustados (tilde) son preferibles porque conservan más información, lo que permite una estimación más precisa de la complejidad de una función.

  • ¿Qué es Theta y cómo se relaciona con los límites ajustados?

    -Theta (Θ) es una notación que indica que una función está tanto en O como en Ω de otra función, es decir, es un límite superior y un límite inferior ajustado al mismo tiempo.

  • ¿Cuál es la dificultad para encontrar una función que cumpla con la notación Theta?

    -La dificultad de encontrar una función que cumpla con la notación Theta es que requiere que el límite superior y el límite inferior sean iguales, lo que a menudo no ocurre en la práctica.

  • ¿Cómo se representa la idea de 'error' en las funciones de límite ajustado?

    -La idea de 'error' en las funciones de límite ajustado se representa mediante el término 'a', que es una cantidad pequeña que puede variar y que se incluye en la expresión para indicar que se han eliminado términos no dominantes.

  • ¿Por qué es importante mantener el coeficiente en el límite ajustado (tilde)?

    -Mantener el coeficiente en el límite ajustado es importante porque puede afectar significativamente la cantidad de trabajo que se tiene que hacer en una función, y por lo tanto, proporcionar una estimación más precisa.

Outlines

00:00

📈 Limitaciones y conceptos de funciones

El primer párrafo explica los límites superior e inferior de las funciones y cómo se visualizan. Se menciona la importancia de los límites estrechos y cómo se pueden representar gráficamente. Se usan dos funciones, x al cuadrado y x al cuadrado más 2x, para ilustrar cómo se superponen al aumentar el valor de x. Se enfatiza que el límite estrecho de x al cuadrado más 2x es x al cuadrado, y cómo esto se puede representar matemáticamente usando el símbolo tilde (≈). Se describe el proceso para encontrar límites estrechos eliminando términos no dominantes y conservando el coeficiente. Además, se menciona la importancia de los límites estrechos para modelar el comportamiento de programas y cómo pueden proporcionar una estimación precisa del trabajo que se debe realizar.

05:03

🔍 Detalles y diferencias entre Big O y Tilde

El segundo párrafo profundiza en la diferencia entre los límites superiores (Big O) y los límites estrechos (Tilde). Se explica que mientras Big O descarta información relevante como los coeficientes, Tilde los conserva, lo que resulta en una estimación más precisa de la función de crecimiento. Se proporcionan ejemplos para ilustrar cómo se calcula el límite estrecho para funciones específicas, como 2n más tres y log de n veces 35n al cuadrado. Se discute la preferencia por el uso de Tilde por su capacidad para mantener información valiosa y cómo esto puede afectar la comparación de funciones de crecimiento. También se menciona la relación entre Big O y Tilde, y cómo Big O puede representar términos fluctuantes usando la notación de límite.

10:03

🔗 Theta y sus implicaciones en la modelación de funciones

El tercer párrafo explora el concepto de Theta como un tipo de límite estrecho que requiere que tanto el límite superior como el inferior de una función sean iguales. Se explica que esto es difícil de lograr y que, en la práctica, los límites Theta rara vez existen porque es complicado hacer que los límites superior e inferior se toquen. Se discute la dificultad de demostrar que los límites de una función están lo suficientemente cerca como para cumplir con la definición de Theta. Aunque Theta es menos utilizado en la práctica, se entiende como un límite estrecho que sigue de cerca una función de crecimiento. Se menciona que, aunque Theta es más popular en la literatura, Tilde es más fácil de usar y entender.

Mindmap

Keywords

💡Límite

En matemáticas, un límite describe el comportamiento de una función cuando el argumento se acerca a un cierto valor. En el vídeo, se menciona el uso de límites para definir las relaciones entre funciones y para verificar si una función es un límite estrecho de otra, como cuando se habla de que la relación entre dos funciones tiende a uno cuando 'n' se hace muy grande.

💡Función

Una función es una relación entre dos conjuntos en la cual cada elemento del primer conjunto está asociado a exactamente un elemento del segundo. En el vídeo, las funciones son el tema central, donde se analizan sus comportamientos y cómo se relacionan a través de límites y límites estrechos.

💡Límite Superior

Un límite superior es una noción matemática que se usa para describir el comportamiento superior de una función. En el vídeo, se menciona cómo los límites superiores son una forma de modelar el crecimiento de funciones, pero suelen descartar información importante como los coeficientes.

💡Límite Inferior

Similar al límite superior, el límite inferior describe el comportamiento inferior de una función. En el vídeo, se discute cómo los límites inferiores ayudan a entender el crecimiento de funciones, pero igual que los límites superiores, pueden no ser lo suficientemente precisos.

💡Límite Estrecho

Un límite estrecho es una relación entre dos funciones que se acercan el uno al otro cuando el argumento se hace muy grande. En el vídeo, se explica que un límite estrecho es una forma de modelar el comportamiento de programas de manera más precisa que los límites superiores o inferiores.

💡Tilde (Límite Estrecho)

La tilde se usa para representar límites estrechos en la notación asintótica de funciones. En el vídeo, se explica que la tilde nos permite mantener información sobre los coeficientes, lo que resulta en una estimación más precisa del comportamiento de las funciones.

💡Dominante

Un término dominante en una función de crecimiento se refiere al término que tiene la mayor influencia en el comportamiento de la función cuando el argumento se hace muy grande. En el vídeo, se menciona que para encontrar límites estrechos, solemos mantener el término dominante y descartar los demás.

💡Coeficiente

Un coeficiente es un factor numérico que se multiplica por una variable en una función. En el vídeo, se discute la importancia de mantener el coeficiente en los límites estrechos, lo que nos permite tener una estimación más precisa del comportamiento de las funciones.

💡Alfa

Alfa se menciona en el contexto de límites estrechos como una forma de representar términos adicionales que no son dominantes y que se descartan en la notación asintótica. En el vídeo, se explica que estos términos Alfa pueden representar cualquier constante que no sea dominante.

💡Theta

Theta se refiere a una noción de límite estrecho donde tanto el límite superior como el inferior de una función se cierran en una misma función. En el vídeo, se menciona que theta es más difícil de alcanzar que la tilde porque requiere que los límites superior e inferior sean iguales.

Highlights

Introduction to tight bounds for functions

Visualizing tight bounds with two functions: x^4 and x^4 + 2x

Tight bounds occur when functions overlap as x gets large

Definition of tight bound: x^4 + 2x is tightly bounded by x^4

Tight bounds provide an accurate estimate for large values of x

Tight bounds are useful for modeling growth functions

Different ways to write tight bounds: tilde and theta

Tilde notation represents a function that is tightly bounded

Finding a tilde bound by dropping non-dominant terms

Example of finding a tilde bound for 2n + 3

Validation of a tilde bound using limits

Tilde bounds retain more information than big O bounds

Preference for tilde bounds over big O for retaining information

Graphical representation of big O and tilde bounds

Theta bounds require both upper and lower bounds to be the same

Theta is harder to achieve than tilde

Theta is less commonly used due to its complexity

Conclusion on the preference for tilde over theta

Transcripts

play00:05

So, now that we have spent some time

play00:06

understanding upper and lower bounds for functions,

play00:09

let's talk about tight bounds.

play00:10

So, tight bounds, we didn't really do it in our overview,

play00:13

kind of picture of stuff.

play00:15

So let's try to visualize this.

play00:16

So, consider you have may be two functions

play00:19

you have a x to the fourth and x to the fourth plus 2x.

play00:22

So I have graphed that here in this picture.

play00:26

The one that starts more kind of linearly,

play00:28

this is going to be our x to the fourth plus 2x.

play00:36

The one on the other side is going to be x to the fourth.

play00:42

So I have two functions there.

play00:44

Notice that when x gets reasonably large,

play00:46

these functions overlap one another.

play00:49

So they follow each other one to one.

play00:50

Instead of one being substantially greater than the other

play00:52

or substantially less than the other,

play00:53

they kind of just seem to overlap.

play00:56

They exactly follow one another.

play00:57

This is what I would call a tight bound.

play00:59

So the tight bound, x to the fourth plus 2x,

play01:03

is x to the fourth.

play01:05

As x gets really large, these functions become identical.

play01:09

So this is what's called a tight bound.

play01:13

So there's this little area in the beginning

play01:15

where 2x has a little impactor, but once x gets

play01:17

sufficiently larger, I guess past that x zero cut off point,

play01:23

they become effectively the same.

play01:26

So, one thought would be is that, hey, this would be

play01:28

another way to model or understand growth functions.

play01:30

We can hope to write a tight bound for it instead of

play01:32

an upper bound or lower bound.

play01:34

And this particular tight bound, generally speaking,

play01:37

is gonna give me a pretty good estimate for exactly

play01:39

how much work I have to do.

play01:40

Now, it will be a little bit off because I'm forgetting

play01:42

about that plus 2x term there,

play01:45

but for very large values of x it'll be exactly the same.

play01:49

So tight bounds are very nice when we can find them.

play01:51

They'll let us almost exactly model how our program behaves.

play01:55

So there are a couple different ways

play01:57

that we can write tight bounds.

play01:58

We're gonna do this first tilde and then,

play02:01

on the next page, theta.

play02:02

So tilde.

play02:03

We'll literally write the following.

play02:04

We'll write tilde f of n to basically represent a function

play02:07

that is tight bounded.

play02:10

What the tight bound means is basically if I have

play02:12

two functions, f of n, g of n,

play02:14

and I divide them in the limit, that the ratio will be one.

play02:19

So as n gets really large, imagine we're taking the limit,

play02:22

we'll use the limit that's in text down below.

play02:25

As that n value gets really large, that ratio is one.

play02:28

And what that represents is that those functions are

play02:30

convergent on one another.

play02:31

They're basically overlapping on our graph.

play02:33

They are effectively the same, they are tight bound

play02:36

of one another, f is tight bounded by g.

play02:41

So how do we actually find a tilde?

play02:43

How do we find this bound?

play02:45

Well, if we have a growth function

play02:47

it's actually really easy.

play02:49

For a growth function, all we do is drop all but the

play02:51

dominant terms.

play02:53

So it's actually less work than trying to write

play02:55

for a big O expression.

play02:56

In big O, we dropped all but the dominant term

play02:59

and then we dropped the coefficient.

play03:01

Here we leave the coefficient in place.

play03:04

So, looking down, we actually have some examples.

play03:07

So here I have my f of n, and these are actually

play03:08

the same as what we did for big O.

play03:09

So we have 2n plus three as our first one.

play03:12

In this case I'm trying to find out what the tilde is,

play03:14

what is the tight bound for it?

play03:16

I keep the dominant term and drop everything else.

play03:21

So in this case I keep 2n.

play03:24

So, this over here is saying that g of n are tight bound

play03:27

is equal to 2n.

play03:29

So, tight bound over here.

play03:32

Original function over here.

play03:35

Now, if I want to validate that, I have to basically

play03:37

take a limit.

play03:39

Before when we did some algebra,

play03:40

we had to figure out some constants.

play03:42

Here it's almost easier depending on how hard it is

play03:44

for you to value them.

play03:46

Basically what happens is that we need to check

play03:47

the ratio of them.

play03:49

So the ratio g of n over f of n.

play03:54

Here I'm saying the limit of 2n over 2n plus three.

play03:58

Of course I'm taking the limit as n gets really large.

play04:00

We said earlier that we want to take a look at our programs,

play04:03

at our growth functions when n is really large.

play04:05

For programs that are so large that there's no kind of

play04:08

special behavior happening as we go between the small ns.

play04:12

No special overhead, no special cases.

play04:14

So let n be really large.

play04:16

So now what we do, let's say we used that process

play04:19

to determine that g of n, here we've determined that

play04:23

tilde, the tight bound is 2n and we want to verify it.

play04:27

All I really do is take that limit of the ratio

play04:29

and evaluate it.

play04:30

So I take that there and I see what it's equal to.

play04:34

If it's equal to one then I'm good.

play04:36

Those things follow each other exactly in the limit

play04:39

so that is a valid tight bound.

play04:41

So here I'm not gonna work through the algebra doing that.

play04:43

It's pretty simple though.

play04:44

I really wouldn't expect you to do

play04:45

the algebra yourself either.

play04:47

As long as you set it up, you can probably put it into

play04:48

something like a CAS, a Computer Algebra System,

play04:50

and it will compute the answer for you.

play04:53

So our second example here is for f2.

play04:56

f2 is a little more complicated.

play04:57

This is log of n times 35n squared.

play05:02

If we wanna find the tilde for that,

play05:04

we drop all but the dominant term and then

play05:06

leave that term alone.

play05:07

So here we drop this, over here we drop the three

play05:10

and we're just left with 2n.

play05:12

Here we don't have a coefficient so there's no extra

play05:15

information that we keep by leaving it alone.

play05:18

For this big O we're just throwing away

play05:19

that coefficient here.

play05:20

In tilde we keep it but if it's not a coefficient

play05:22

it doesn't really matter.

play05:24

Again, if I wanna show whether or not that's valid,

play05:26

I basically take the limit as n approaches infinity,

play05:29

I would ratio those two functions.

play05:31

If it's equal to one then I'm good to go.

play05:34

And these two limits here, if you want to value them,

play05:35

they will work out, they will value to one.

play05:38

So we should be good to go.

play05:40

So, there we have it.

play05:41

So that's our tilde bounds for both f1 and f2.

play05:46

At this point we have several different ways

play05:48

to characterize a function in terms of bounds.

play05:50

My general preference is gonna be for tilde.

play05:53

At least in terms of big O.

play05:55

So big O is an upper bound, but big O we are basically

play05:58

throwing away information.

play05:59

We threw away not just all the lower terms

play06:01

but the coefficient as well.

play06:03

Tilde is keeping that information.

play06:04

Tilde is retaining that number in front.

play06:07

And that is really valuable

play06:08

because that number could actually matter.

play06:10

We can imagine if we have two functions,

play06:11

maybe we have an f of n, one under n versus f of n one of n,

play06:15

those two functions, in terms of big O, o of n

play06:18

in terms of big O are gonna look the same.

play06:20

Big O is gonna be o of n.

play06:21

So if I have here, let me actually draw this,

play06:25

so I have an f of n equal 100n.

play06:30

And f of n equal 2n.

play06:37

In terms of big O, these things are the same.

play06:39

These are both gonna be big O of n.

play06:43

This basically is throwing away the fact that

play06:45

one of them is 50 times lower than the other.

play06:47

And I don't like that.

play06:48

In tilde, we would have maybe tilde of 100n

play06:54

versus tilde of 2n.

play06:58

We keep that coefficient.

play07:00

In that case I can clearly see how different

play07:01

those things are.

play07:03

So for me I prefer that tilde because I'm not

play07:05

throwing away information.

play07:07

The only issue is that tildes can be harder to write

play07:09

because you need to have that coefficient in front.

play07:11

If anybody does some of the empirical analysis that we did,

play07:13

we may have a value in front, but it's kind of questionable.

play07:17

It's super specific to the system or something.

play07:20

But if we have it, I really think we should keep it.

play07:23

Now, as a final note here, I have a remark here

play07:27

based on big O.

play07:31

Here we're saying we gave a prospect for determining

play07:34

the g of n in a tilde.

play07:35

Now g of n is literally just a term for the

play07:38

original growth function.

play07:39

It's a particular mathematical term.

play07:42

What we can think of is the following.

play07:45

My f of n, my original function, this over here.

play07:49

That is really g of n, the tight bound,

play07:51

that first term plus air.

play07:55

So tilde, we say throw away all but the dominant term.

play07:58

So, in this case, my dominant term is lineal,

play08:01

it just has n in in it,

play08:02

versus my other term is constant time.

play08:04

Well basically what that means is we can say,

play08:06

think of this as f of n is g of n, our 2n

play08:09

plus some air, plus o of one air.

play08:13

O of one is basically a little quantity that

play08:15

kind of can vary a little bit.

play08:17

Basically what we are saying is that the air

play08:19

in that expression is upper bound on some constant.

play08:25

That may be a little bit awkward to think about

play08:27

but big O, when we write it in a mathematical expression,

play08:31

and we won't do it often in this course,

play08:32

usually we just say it equals f of n is bound recently,

play08:35

but when we use o of n by itself, what that is representing

play08:38

is a bit of a term that can fluctuate.

play08:41

So, in our tilde expression, why we threw away that constant

play08:45

our term that wasn't dominant, we're really writing

play08:47

power to two is a three, but we just threw it out.

play08:51

And the way that we can represent that we threw it out

play08:53

is by saying that there is an o of one air there.

play08:56

I'm using the word air basically whenever I have

play08:58

o of n in a normal expression to represent that

play09:00

o of n is kind of a bound.

play09:02

There's tons of things that could be under it.

play09:04

An upper bound is basically representing that

play09:05

they have this mystery function that hides underneath it.

play09:11

Here I could be hiding four or five or six.

play09:13

I threw away whatever constant was added on there

play09:15

so it could have been any of those.

play09:16

And the way I can represent that is actually using big O.

play09:20

The next line there I have is similar example

play09:22

where it says f of, actually it should be f2,

play09:25

that thing is really g2 plus an air on log, log of n.

play09:30

'Cause I kept the dominant term

play09:32

and I threw away the log term.

play09:33

So that gives me a little bit of air.

play09:37

Okay, so let's take a look at some more.

play09:41

So tilde's really nice because it keeps a lot of detail.

play09:43

Maybe you don't have to worry too much

play09:44

about that relationship with big O

play09:46

but just know that it contains more information.

play09:48

It's a tighter bound.

play09:49

Now let's take a look at one more method we can use

play09:51

to tightly bound something.

play09:53

And that's called theta.

play09:54

So theta goes back to our definitions of big O and Omega.

play09:59

So basically what we say is that a function is tight bounded

play10:03

by g of n.

play10:03

So we have this over here, f of n.

play10:05

f of n is tight bounded by g of n, state of g of n

play10:09

when this holds.

play10:12

f of n equals theta of g of n if and only if

play10:16

f of n is big O of g of n and if n is Omega of g of n.

play10:22

So when our upper bound and our lower bound are the same

play10:25

well then my theta holds.

play10:27

Now the issue here is that it's rather hard

play10:30

to get both upper and lower bounds to look the same.

play10:32

So if you think about what we've talked through,

play10:35

you can think about maybe our upper bounds are gonna look

play10:37

something like n, our lower bounds will look

play10:38

something like ten.

play10:39

It's hard to make those convert.

play10:42

So a lot of times our thetas don't really exist

play10:45

because they require to bring

play10:46

our upper and lower bounds together.

play10:50

So when I think about this graphically,

play10:51

normally it's something like this.

play10:56

Where this is maybe my f of n.

play10:59

This is my upper bound, I'll call it a.

play11:00

My lower bound, I'll call it b.

play11:04

And the problem is, is normally a and b diverge.

play11:08

Those functions go their own way.

play11:11

Sure a is an upper bound for f, b is a lower bound for f

play11:14

but a and b don't ever meet up again, they diverge.

play11:19

The problem with this definition is it basically is saying

play11:21

that you have to bring these in.

play11:25

And it's gonna be extra work for you to prove

play11:27

that our o of n and Omega are really close together.

play11:30

That they are the same.

play11:32

And only once you've done that, once you've brought in

play11:34

those two functions as tight as possible,

play11:36

get them as close to that f of n as possible,

play11:39

are you allowed to say that that f of n

play11:40

has a tight bound that's equal to a and b.

play11:45

That they compress together on that line

play11:48

and once they meet up that they enforce a tight bound,

play11:51

that they enforce a theta bound.

play11:54

So this is a little bit harder to do

play11:56

than some other things.

play11:58

Again, this is gonna be something we almost never use.

play12:02

For us, the way we think of it, is that theta is basically

play12:06

a tight bound.

play12:08

So it's another function that closely follows

play12:09

a growth function.

play12:12

For us though, we'll mainly use tilde

play12:14

just because it's gonna be a little easier to write,

play12:15

a little easier to think about.

play12:17

Theta is more popular in literature.

play12:20

It's maybe something you hear people talking about

play12:21

but it's just so hard to get.

Rate This

5.0 / 5 (0 votes)

Etiquetas Relacionadas
Límites EstrechosAnálisis de FuncionesCrecimento de FuncionesModelado de CrecimientoProgramaciónMatemáticasOptimizaciónAlgoritmosEducación TécnicaAnálisis de Algoritmos