MyOpenMath/Solutions/Big-O

From testwiki
Revision as of 03:14, 23 March 2021 by imported>Guy vandegrift
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

User:Guy vandegrift/T/Title

An excellent introduction to this subject can be found at this document from web.mit.edu:

In this introduction to Big O notation, we solve two problems: one simple and the other so tricky I got a bit lost. The advantage of Big-O notation is that you can quickly "see" an answer without doing elaborate perturbation theory. Instead you just learn a few low order approximations for small ϵ. A few examples are sin(ϵ)ϵ, cosϵ112ϵ2. All we need for this discussion is the first order approximation for (1+ϵ)p.

Ruler misalignment

You want h but measure y.

Have you ever pondered the fact that you can measure your height without carefully verifying that the ruler is perfectly vertical? In the language of Big O notation, if the actual height is h, the error is second order in the distance, x, between the actual and proper locations of the bottom of the ruler (see figure). To understand how this all works, begin with the Pythagorean theorem and express the erroneously measured height as:

y=h2+x2=h(1+x2h2)1/2

Advanced mathematics with numbers that have dimensions is best done by creating dimensionless variables, and this is especially true when analyzing approximations. A handy approximation is that whenever ϵ<<1, we can write:

(1+ϵ)p=1+pϵ+𝒪ϵ2+....

Here the "big-O" informs us that the next term is proportion to ϵ2. The 𝒪-symbol allows us to avoid consideration of this term, while at the same time, preserve the location of these higher order terms, in case the calculation needs to be improved. We define, Δy=yh, to be the error that arises from ruler misalignment. We presume that this error will be small ... but small compared with what? This problem has two large terms, (h,y), and two small ones (x,Δy). The big-O notation will help us sort things out. From the two equations displayed above:

yh=1+Δyh=1+12(xy)2+𝒪(xy)4

Example

x=0.1y, then Δy/h=.005, which implies that:

A horizontal displacement of one end of ruler's length by ten percent will increase the measured height by approximately half of one percent.

This calculation is only an estimate that lacks a proper proof because higher order terms have been neglected. On the other hand, it is likely to be correct, since the next term in the expansion is of order (x/y)4104=0.01%.

Defining the small parameter

This section might seem unnecessary, but the next calculation is so weird that it might help to discuss it here: Whether something is "first" or "second" order depends on you choose to define things. Here we have chosen,

ϵ=x2y2,

and we are working to "first order" in ϵ, even though it is "second" order in x/y.

Note the approximation that the two paths to the screen are parallel
Two slit diffraction when screen is close
A better way to visualize Δr as the base of a triangle for nearly parallel paths. Click for explanation

Two slit diffraction with narrow slits

When the screen is far from the slits

Problem: Two narrow slits are separated by 0.8 mm. The 15-th fringe appears 89 mm from the center of the diffraction pattern, and the screen is 9 m from the slits. What is the wavelength?

The standard textbook solution to this problem uses the formula, nλ=dsinθ, where :

15λ=0.8 mm×89 mm90002+892 mmλ527.4 nm.

This solution is only valid when the distance to the screen, L is much greater than the distance between the slits, d. In the next section we will derive an exact equation, and then use big-O notation to recover the standard formula in the limit that d/L is small.

  • To learn about two slit diffraction visit:
OpenStax College Physics Chapter 27-3
wikibooks:Waves/Double_slit_Diffraction
  • To see a hand written solution on MyOpenMath visit:
https://myopenmaths3.s3.amazonaws.com/ufiles/2556987/interference_question_ID_420941.pdf

When the screen is not far from the slits

The wavelength and dimensions of the device in the previous section were chosen so that the simple formula would yield the correct answer. But how we solve the problem when the spacing between the slits is close to the distance to the screen. The geometry is shown in the figure to the right. It helps to define,

R=L2+y2, so that:

r1=L2+(yd/2)2=R2yd+d2/4

r2=L2+(y+d/2)2=R2+yd+d2/4

Note from the figure that y/R=sinθ, and that the two paths are effectively parallel when d<<R. The exact formula for the path difference is:

Δr=r2r1=T2+ydT2+yd,

where,

T=L2+y2+d24=R2+d24

From the formulas stated without proof in the previous section, we are looking to show that:

ΔrydR=dsinθ.

We also seek insight into the nature of higher order correction terms in order to estimate when this simple formula is likely to be valid. The standard approach would be to perform a Taylor series expansion of the function f(d)=Δr, using d as the variable. But in order to highlight big-O notation, we employ the aforementioned expansion:

(1+ϵ)1/2=1+ϵ2+𝒪ϵ2.

Wright this expression with ϵ replaced by ϵ, and subtract the two:

(1+ϵ)1/2(1ϵ)1/2=[1+ϵ2+𝒪ϵ2][1ϵ2+𝒪ϵ2]

When subtracting in the big-O notation, it is essential to realize that in general,

𝒪ϵ2𝒪ϵ2=𝒪ϵ2𝒪ϵ2

This is because 𝒪ϵ2 stands for Cϵ2, where C is some unknown constant. The difference between unknown constants is not usually zero. However in this case the exact cancellation of all even terms leaves us with an expression containing only terms that are odd in ϵ:

(1+ϵ)1/2(1ϵ)1/2=ϵ+𝒪ϵ3+...

The absence of a second order term suggests that the first order term is likely to be sufficient for reasonably small values of ϵ. The physics of this problem informs us that, Δr=nλ, so that we seek and expression for,

Δr=T2+ydT2+yd=T[1+ϵ+1ϵ],

We see here that our small parameter is,

ϵ=ydT2

Δr=ϵT+𝒪ϵ3T=ydT+T𝒪ϵ3

One final task remains: Since since y/R=sinθ, we need to replace yd/T = yd/R (...plus small terms.) It is left as an exercise for the reader to show that:

1T=1R{1𝒪(d24R2)}

In other words, T and R are very close to each other, differing only at second order in our small parameter. Unless θ is very close to π/2, the three lengths T,R,and L are all of the same order and are not small:

𝒪T=𝒪R=𝒪L=𝒪ϵ0

We also note that yd/T=𝒪ϵ, so that up to but not including third order, the difference in path length is:

Δr=ydR[1+𝒪ϵ2]ydsinθ+...,

which agrees with the formula found in most physics books.

nλdsinθ is a good approximation even with the screen this close to the slits.
If your small parameters have small parameters, you need analysis.

Example

While not exact, the familiar formula for fringes when the screen is far away, the approximate formula, nλ=dsinθ, works surprisingly well for the screen close to the slits. Here, [d,y,L]=[321,274,404]]. The fringe number was n=1 (first maximum.)

Yet, the "small parameter" is not very small:

yd/R20.37.

The approximate formula for the first fringe is depicted in the figure as λ1, which equals the length of the line segment, CD.

The actual wavelength is λ=CE. The point E was by creating the (dotted) arc of length r1, which intersect with line CP, which has length r2. The approximation,

nλ1=dsinθ .

yields,

λ1=180.18...=λ×1.037...,

where,

λ=173.66...,

is the exact wavelength, calculated from:

nλ=L2+y2+d24+ydR2L2+y2+d24+yd,

Another approach

The big-O approach led us initially to a rather awkward small parameter,

ϵ=yxT2=yxR2+x2/4yxR2+𝒪x3yR4

In other words, the convenient small parameter differs from the useful small parameter by a small parameter. Weird, huh?

We could also solve this problem with a Taylor series. In anticipation of doing differential calculus, we replace d by x as the variable to represent the distance between the slits. Now define the path length difference Δr by the function F, where:

F(x)=R2+x24+yxR2+x24yx

This looks like a lot of trouble, but symbolic software is available that can make this almost effortless. This expression also shows us why the big-O approach got into trouble. There are really two small dimensionless parameters lurking in this problem, and we can distinguish between them with subscripts:

ϵR=x24R2, and ϵy=yxR2,

so that

ΔrR=1+ϵR+ϵy1+ϵRϵy

In other words we need to understand the function,

f(x,y)=1+x+y1+xy,

when x and y are small. What I would do here is a two-dimensional expansion:

f(x,y)=f0+fx|0x+fy|0y+122fx2|0x2+122fy2|0y2+2fxy|0xy+...