Monday, October 29, 2012

The Dirac-delta


The Dirac-delta functional δ(x–a) is an extremely useful mathematical object despite its abstract nature. It was proposed by Paul Dirac – an electrical engineer who decided to become a physicist and shared the 1933 Nobel Prize in Physics with Erwin Schrodinger. The story went that mathematicians did not like the way the Dirac-delta was derived and defined by its inventor, which was probably considered not rigorous enough, but in the end mathematicians recognized its beauty and importance. Paul Dirac also wrote a quantum mechanics textbook, The Principles of Quantum Mechanics, which was written concisely and beautifully at the same time.

The Dirac-delta exemplifies a proof that when an idea anchors several things at once, it needs not be explicit. It is a subtle object since it is defined by an integral representation:

∫ dx f(x)δ(x–a) = f(a),

where the integral is performed over an interval that includes x = a. δ(x–a) = 0 in almost everywhere except at x = a. Despite this extremely localized effect, it is so strong that it never gives a chance to f(x), as it is integrated over the interval, to yield anything other than its value at x = a. It is difficult to explicitly write what δ(x–a) is. There are several representations of the Dirac delta, e.g., a Gaussian peak and a Lorentzian peak, but they are still approximations to what the integral representation sufficiently captures.

Using the integral representation, we can derive three basic properties of the Dirac-delta:

1. ∫ dx f(x) δ(n)(x–a) = (-1)n f (n)(a), where the (n) superscript indicates an nth derivative;

2. ∫ f(x) δ(ax–b) = a-1 f(b/a);

3. ∫ dx f(x) δ(g(x)) = ∑ f(xi)/g'(xi), where xi are roots of g(x) and the ' superscript indicates a first derivative.

The marvel of the Dirac-delta is its ability to concisely sum up a complete set of continuous functions for the space of nonperiodic functions. It is used to represent a Fourier transform:

δ(x–y) = (2π)-1 ∫ dk exp[ik(x–y)],

where the integral is over –∞ < k < ∞. This result is obtained from the Fourier series representation of the Dirac-delta and from extending the domain of the Fourier series representation to cover the entire space (–∞ < x < ∞).

The integral representation would become

∫ dx f(x) δ(x–y) = (2π)-1 ∫ dx f(x) ∫ dk exp[ik(x–y)]

                          = (2π)-1 ∫ dk exp[–iky] f(k) = f(y),

which defines both Fourier transform and its inverse of f(x). This is the most concise way to define a Fourier transform I know - as clearly explained by Mark Swanson's Path Integrals and Quantum Processes. A complete derivation of Fourier transform and its math details can found in Ian Sneddon's Fourier Transforms, which is a terrific source book on Fourier transform.

The Dirac-delta is used to model effects of periodic diffraction slits, to obtain Green's functions of various differential equations, and many more. It has wide-ranging applications, from specific mathematical models to fundamental equations.

Sunday, October 28, 2012

Sirkus


Aku bukan diriku lagi
Lama tak ingat buat apa 
Teman kerabat mengejarku
Aku jadi orang mahapenting
Untuk masalah amat tak penting

Besok pakai baju apa
Nanti mau ngopi dimana
Kita beli gincu warna apa
Kemarin kamu difuck siapa
Mana peduli aku cuuk!

Saat aku tanya kamu cinta kenapa
Kamu bilang payudaraku elok
Tapi besok akan tertunduk layu
Kamu bilang mataku menyala
Tapi lusa redup terdera keriput
Mana peduli kamu cuuk!

Tak Sampai


Umur menapak senja, sebar senyumku
Tidak bisa sembunyikan hambar hatiku.

Hanya kau tahu: sembilu tersimpan lama
Walau aku sudah terima semua.

Hidupku terwujud palsu dan aku biasakan
Kubur mata hatiku dengan kealiman lazim.

Jalan sendiri aku di sisa hidup ini
Walau semua menyapaku: aku sepi.

Tuesday, October 23, 2012

Mechanics Problem 2

I like simple mechanics problems that illuminate fundamentals. An example is shown in the schematic diagram above. 

A small block of mass m1 is released from rest at the tip of an inclined plane of a wedge of mass m2. The wedge base has a length d and the incline has an angle θ. The small block slides on the incline and eventually reaches its bottom. The wedge will slide to the left as the small block slides.

Neglecting friction, determine the speed of the wedge when the small block reaches the bottom of the inclined plane.

Hint: This problem requires you to use conservation of momentum and conservation of energy, in addition to understanding inertial reference frame. An alternative way is to use Newton's second law and to use a clever kinematic constraint.

Saturday, October 20, 2012

Beta Distribution


Out of the 5 probability distribution groups I discussed in my previous blog, one group I like the most is the beta distribution. It sits alone – like me when writing this blog – compared to the other 4 groups. Another group that stands alone is the hypergeometric distribution, but this can be approximated by binomial distribution at some point.

Beta distribution is still connected to binomial, but with a clever twist involving conditional probability. It is worth telling in this blog. The story goes like this.

Binomial distribution gives the probability of having r successes out of n trials, where the sequence of these r successes among the n trials does not matter. It is equal to n!/(r! (n–r)!) pr(1-p)n–r, and it is a conditional probability P(r | P = p) since it gives us the probability of getting r successes if there are n trials and the probability of success is p.

There are many situations where the value of p is unknown. For instance, if I work as a port authority's container inspection staff, I have to inspect thousands of incoming containers to the port. It is impossible to inspect all of these containers, so I have to sample only a fraction of them. As I sample them, I will find containers that have to be processed further and others that pass security and other checks. From the limited sampling I have done, I have to then determine what is the most likely total number of containers that actually need further processing. This data is useful if I would like to propose additional inspection staff, for example. In a situation like this, beta distribution becomes very useful.

Using example above, you can imagine that there are a lot of useful applications for beta distribution.

Beta distribution is obtained from the binomial using Bayes' theorem since it gives the conditional probability of probability, P(p | R = r), if there are r successes out of n trials from the sampling done. The Bayes' theorem states that P(p | R = r) P(r) = P(r | P = p) P(p). Since P(p) = 1 and P(r) = 1/(r + 1), we arrive at the beta distribution:

P(p | R = r) = (n+1)!/((n–r)! r!) pr (1–p)n–r.

It looks similar to the binomial distribution, but they are very different because p is the variable for beta distribution: it gives the probability distribution of probability of getting r successes out of n trials. In other words, to get a certain r successes for a given number of trials n, we can vary the probability p.

If the inspections are done many times, it is reasonable to seek the average of the probability p. But if the inspection is done once, it is the most likely probability p we need to find. Analyzing beta distribution further allows us to determine the optimum sampling size so that we can minimize errors and keep the inspection cost down.

The mean of p is equal to (r+1)/(n+2) with its attendant standard deviation. How about the most likely probability p? I will leave this for you to calculate.

Friday, October 19, 2012

5 Groups of 13 Probability Distributions


I teach a probability and statistics for engineers course this Fall term. One challenging task for students is to correctly pick the most appropriate probability distribution function for a particular problem. It requires them to think about its underlying probability structure and to precisely extract every bit of information from sentences of the problem. They learn that words "at least" or "given that" carry significant implications.

I cover standard discrete probability functions: (i) binomial, (ii) geometric, (iii) negative binomial, (iv) hypergeometric, (v) Poisson, and (vi) uniform, while for continuous probability functions: (vii) uniform, (viii) normal, (ix) exponential, (x) gamma, (xi) Weibull, (xii) lognormal, and (xiii) beta.

I am going to summarize these statistical distribution functions by simple illustrations to highlight the thought process that underlies the selection of the most appropriate distribution function.

1. The first group of the 13 distribution functions is the discrete uniform and the continuous uniform. They are picked if we know only the possible outcomes of a problem without a priori information on their individual likelihood. The outcomes are distinct from each other and are consequently thought to be independent of each other. In other words, a presence of one outcome does not influence the likelihood of another outcome.

We use the discrete uniform if we can count these outcomes as pure numbers (i.e., integers). For instance, a possible outcome of buying grocery is 2 apples. We use the continuous uniform if we deal with intervals, whether distance or time or something else. 12 km distance is an interval, thus a continuous variable. If we use the sign posts along the 12 km distance as counters, then we ought to use the discrete uniform.

2. The second group is headed by the binomial. We need this function to describe the probability of r successes occuring in x attempts. The binomial does not care the sequence of these r successes. For example, 3 successes and 1 failure can be described as p3(1–p), where p is the probability of a success. If we want 3 successes first and then followed by 1 failure – precisely in that order – then the expression p3(1–p) is equal to its probability. However, in many problems we do not care the sequence of appearance of the 3 successes. So, the sequence can be one of these 4: ppp(1–p), pp(1–p)p, p(1–p)pp, (1–p)ppp. Thus, there are 4 possible outcomes. The probability of having 3 successes and 1 failure in which ever order they appear is thus 4ppp(1–p).

Binomial function leads to Poisson function if the probability of success, p, is small. How small? It depends on the number of attempts x. Roughly, px should be several orders of magnitude smaller than x and x needs to be large (i.e., 1000 or more).

Binomial function leads to normal function if the number of attempts is large and our data are expressed in continuous variables, such as time duration or distance. The normal function requires that we have average and standard deviation information. The normal function can also be used – since it approximates binomial – to approximate binomial and Poisson function.

Lognormal function can be thought of as a variation of normal function. The probability of an outcome can be described by binomial function, but there is an exponential function relationship connecting the outcome probability and the binomial function. (Complicated, eh?)

3. The third group is headed by negative binomial. This group also describes the probability of r successes in x attempts. But we impose a peculiar sequence of appearance of the successes: we want 1 out of r successes to occur last in the x attempts. This means ppp(1–p) is ruled out as a possible outcome since the last attempt results in a failure of probability (1–p). Why do we need this peculiar sequence? This requirement describes "waiting time" problems. It describes the probability of waiting for a computer to malfunction, for example. It describes the probability of train arrival, and so on.

If we want 1 success only, the negative binomial function is reduced to the geometric function. From the negative binomial we can get the exponential function.

If our variable is continuous, then the negative binomial becomes the gamma distribution. (Gamma function is not appropriate name since it is referred to one well-known function.) Exponential function can be obtained from the gamma distribution when we want 1 success only.

The exponential function can also be derived from Poisson, so we have an overlap between the second and third group. This overlap occurs because we can describe possible outcomes of having at least 1 success using either Poisson (thus, binomial) or negative binomial function. Probability having at least 1 success is the opposite of probability of having no success. The description of a no-success outcome: (1–p)x for x attempts is the same for either binomial or negative binomial.

Weibull function can be thought of as an improvement of exponential function since the latter describes a lifetime of a spare part that does not age. A spare part made of metals ages with time. Such spare part, such as a ball bearing, degrades over time and does not fail suddenly.

4. The fourth group is hypergeometric function. It describes the probability of sequentially picking r objects from a basket filled with x objects, given that this population of x objects is divided into two classes: "success" and "failure" objects. It is similar to binomial, but hypergeometric imposes a condition that p, the probability of success, is not constant: p depends on the remaining objects in the basket as we sequentially remove one object after another to yield a total of r objects.

It is expected, therefore, that if the number of objects in the basket is very large, then taking 1 object out, will not significantly change p. In this case, p can be considered constant if we do not take too many objects from the basket, i.e., r is much smaller than x. Hypergeometric function can thus be approximated by binomial when x is very large and r is much smaller.

5. The fifth group is beta function. It is related to binomial, but instead of concerning with the number of successes in a given number of attempts, we actually want to know what is the most likely probability of success given only information on the number of successes. The beta function – which is from the beta integral – tells us how we can guess the most fair probability based on incomplete information.

Saturday, October 6, 2012

Jika Tuhan Tidak Ada


Jika Tuhan tidak ada hidup berarti waktu
Hanya sekali bukan singgah sebentar
Tak kenal dirimu waktumu hangus
Waktumu terbuang hidupmu lenyap

Jika Tuhan tidak ada semua hanya dongeng
Cerita lama masyarakat jaman baheula
Kamu pegang erat karena sungguh takut
Bayang akhir hidupmu sendiri

Jika Tuhan tidak ada kamu akan bingung
Biasa pikir timbang hari tunggu akhirat
Tiada larang berdalil dosa suruh janji pahala
Apa jadi pegangan hidup cuma sekali

Jika pun Tuhan ada belum tentu
Dia mau hidupkan kamu lagi
Terlalu bosan muak bermain sama
Pencium pantat tanpa mendebat

Thursday, October 4, 2012

Morning Frost


Grass blade morning frost
Smooth supple bike tires

October zero degree sunrise
Helmet whirling calm wind

I sped my body arched
A simple pleasure I smiled