basics

What are Functions? A Short and Simple Explanation

Understanding functions is vital for anyone intending to master calculus or learning mathematical physics. For those who have never heard of the concept of the function, here’s a quick introduction. A function f(x) is a mathematical expression, you can think of it as an input-output system, establishing a connection between one independent variable x and a dependent variable y. We “throw” in a certain value of x, do what the mathematical expression f(x) demands us to do, and get a corresponding value of y in return. Here’s an example of this:

OpenDocument Text (neu)_html_2530265c

The expression on the right tells us that when given a certain value of x, we need to multiply the square of x by 2, subtract 3x from the result and in a final step add one. For example, using x = 2, the function returns the value:

OpenDocument Text (neu)_html_1ee58f49

So this particular function links the input x = 2 to the output y = 3. This is called the value of the function f(x) at x = 2. Of course, we are free to choose any other value for x and see what the function does with it. Inserting x = 1, we get:

OpenDocument Text (neu)_html_m2dd52194

So given the input x = 1, the function produces the output y = 0. Whenever this happens, a value of zero is returned, we call the respective value of x a root of the function. So the above function has one root at x = 1. Let’s check a few more values:

OpenDocument Text (neu)_html_m392e8a9b

OpenDocument Text (neu)_html_m45d12ce2

OpenDocument Text (neu)_html_m3b7adb04

The first line tells us that for x = 0, the value of the function lies on y = 1. For x = -1 we get y = 6 and for x = -2 the result y = 15. What to do with this? For one, we can interpret these values geometrically. We can consider any pair of x and y as a point P(x / y) in the Cartesian coordinate system. Since we could check every x we desire and calculate the corresponding value of y using the function, the function defines a graph in the coordinate system. The graph of the above function f(x) will go through the points P(2 / 3), P(1 / 0), P(0 / 1), P(-1, 6) and P(-2 / 15). Here’s the plot:

OpenDocument Text (neu)_html_m14f7d05e

Graph of f(x) = 2x² – 3x + 1

You can confirm that the points indeed lie on the graph by following the x-axis, as usual the horizontal axis, and determining what distance the curve has from the x-axis at a certain value of x. For example, to find the point P(2 / 3), we move, starting from the origin, two units to the right along the x-axis and then three units upwards, in direction of the y-axis. Here we meet the curve, confirming that the graph includes the point P(2 / 3). Make sure to check this for all other points we calculated. Of course, to produce such a neat plot, we need to insert a lot more than just six values for x. This uncreative work is best done by a computer. Feel free to check out the easy-to-use website graphsketch.com for this, it doesn’t cost a thing and requires no registration. Note that the plot also shows a second root at x = 0.5, the point P(0.5 / 0). Let’s make sure that this value of x is a root of our function f(x) by inserting x = 0.5 and hoping that it produces the output y = 0:

OpenDocument Text (neu)_html_m4441024

As expected. This was all very mathematical, but what practical uses are there for functions? We can use them to establish a connection between the value of one physical quantity and another. For example, through experiments or theoretical considerations we can determine a function f(p) that links the air pressure p to the air density D. It would allow us to insert any value for the air pressure p and calculate the corresponding value for the air density D, which can be quite useful. Or consider a function f(v) that establishes a connection between the velocity v of an object and the frictional forces F it experiences. This is extremely helpful when trying to determine the trajectory of the object, yet another function f(t) that specifies the link between the elapsed time t and the position x of the object. Just to give you one example of this, the function:

OpenDocument Text (neu)_html_m10f571dc

connects the elapsed time t (in seconds) with the corresponding height h (in meters) for an object that is dropped from a 22 m tall tower. According to this function, the object will have reached the following height after t = 1 s:

OpenDocument Text (neu)_html_m15f3bd03

Insert any value for t and the function produces the object’s location at that time. In this case we are particularly interested in the root. For which value of the independent variable t does the function return the value zero? In other words: after what time does the object reach the ground? We could try inserting several values for t and hope that we find the right one. A more promising approach is setting up the equation f(x) = 0 and solving for x. This requires some knowledge in algebra.

OpenDocument Text (neu)_html_m7ffb1fca

Subtracting 22 on both sides leads to:

OpenDocument Text (neu)_html_m5f83aae

Divide by -4.91:

OpenDocument Text (neu)_html_m7c18916e

And apply the square root:

OpenDocument Text (neu)_html_53b4383e

For this value of t the function f(t) becomes zero (due to inevitable rounding errors, not perfectly though). The rounding errors are also why I switched from the “is equal to”-sign = to the “is approximately equal to”-sign ≈. You should do the same in calculations whenever rounding a value.

OpenDocument Text (neu)_html_26c795d3

Graph of f(t) = -4.91t² + 22

As you can see, functions are indeed quite useful. If you had trouble understanding the algebra that led to the root t = 2.12, consider reading my free e-book “Algebra – The Very Basics” before continuing with functions.

This was an excerpt from my e-book Math Shorts – Exponential and Trigonometric Functions

funcF

Advertisements

The Placebo Effect – An Overview

There is a major problem with reliance on placebos, like most vitamins and antioxidants. Everyone gets upset about Big Science, Big Pharma, but they love Big Placebo.

– Michael Specter

A Little White Lie

In 1972, Blackwell invited fifty-seven pharmacology students to an hour-long lecture that, unbeknownst to the students, had only one real purpose: bore them. Before the tedious lecture began, the participants were offered a pink or a blue pill and told that the one is a stimulant and the other a sedative (though it was not revealed which color corresponded to which effect – the students had to take their chances). When measuring the alertness of the students later on, the researchers found that 1) the pink pills helped students to stay concentrated and 2) two pills worked better than one. The weird thing about these results: both the pink and blue pills were plain ol’ sugar pills containing no active ingredient whatsoever. From a purely pharmacological point of view, neither pill should have a stimulating or sedative effect. The students were deceived … and yet, those who took the pink pill did a much better job in staying concentrated than those who took the blue pill, outperformed only by those brave individuals who took two of the pink miracle pills. Both the effects of color and number have been reproduced. For example, Luchelli (1972) found that patients with sleeping problems fell asleep faster after taking a blue capsule than after taking an orange one. And red placebos have proven to be more effective pain killers than white, blue or green placebos (Huskisson 1974). As for number, a comprehensive meta-analysis of placebo-controlled trials by Moerman (2002) confirmed that four sugar pills are more beneficial than two. With this we are ready to enter another curious realm of the mind: the placebo effect, where zero is something and two times zero is two times something.

The Oxford Dictionary defines the placebo effect as a beneficial effect produced by a placebo drug or treatment, which cannot be attributed to the properties of the placebo itself and must therefore be due to the patient’s belief in that treatment. In short: mind over matter. The word placebo originates from the Bible (Psalm 116:9, Vulgate version by Jerome) and translates to “I shall please”, which seems to be quite fitting. Until the dawn of modern science, almost all of medicine was, knowingly or unknowingly, based on this effect. Healing spells, astrological rituals, bloodletting … We now know that any improvement in health resulting from such crude treatments can only arise from the fact that the patient’s mind has been sufficiently pleased. Medicine has no doubt come a long way and all of us profit greatly from this. We don’t have to worry about dubious healers drilling holes into our brains to “relieve pressure” (an extremely painful and usually highly ineffective treatment called trepanning), we don’t have to endure the unimaginable pain of a surgeon cutting us open and we live forty years longer than our ancestors. Science has made it possible. However, even in today’s technology-driven world one shouldn’t underestimate the healing powers of the mind.

Before taking a closer look at relevant studies and proposed explanations, we should point out that studying the placebo effect can be a rather tricky affair. It’s not as simple as giving a sugar pill to an ill person and celebrating the resulting improvement in health. All conditions have a certain natural history. Your common cold will build up over several days, peak over the following days and then slowly disappear. Hence, handing a patient a placebo pill (or any other drug for that matter) when the symptoms are at their peak and observing the resulting improvement does not allow you to conclude anything meaningful. In this set-up, separating the effects of the placebo from the natural history of the illness is impossible. To do it right, researchers need one placebo group and one natural history (no-treatment) group. The placebo response is the difference that arises between the two groups. Ignoring natural history is a popular way of “proving” the effectiveness of sham healing rituals and supposed miracle pills. You can literally make any treatment look like a gift from God by knowing the natural history and waiting for the right moment to start the treatment. One can already picture the pamphlet: “93 % of patients were free of symptoms after just three days, so don’t miss out on this revolutionary treatment”. Sounds great, but what they conveniently forget to mention is that the same would have been true had the patients received no treatment.

There are also ethical consideration that need to be taken into account. Suppose you wanted to test how your placebo treatment compares to a drug that is known to be beneficial to a patient’s health. The scientific approach demands setting up one placebo group and one group that receives the well-known drug. How well your placebo treatment performs will be determined by comparing the groups after a predetermined time has passed. However, having one placebo group means that you are depriving people of a treatment that is proven to improve their condition. It goes without saying that this is highly problematic from an ethical point of view. Letting the patient suffer for the quest of knowledge? This approach might be justified if there is sufficient cause to believe that the alternative treatment in question is superior, but this is rarely the case for placebo treatments. While beneficial, their effect is usually much weaker than that of established drugs.

Another source of criticism is the deception of the patient during a placebo treatment. Doctors prefer to be open and honest when discussing a patient’s conditions and the methods of treatment. But a placebo therapy requires them to tell patients that the prescribed pill contains an active ingredient and has proven to be highly effective when in reality it’s nothing but sugar wrapped in a thick layer of good-will. Considering the benefits, we can certainly call it a white lie, but telling it still makes many professionals feel uncomfortable. However, they might be in luck. Several studies have suggested that, surprisingly, the placebo effect still works when the patient is fully aware that he receives placebo pills.

Experimental Evidence

One example of this is the study by Kaptchuk et al. (2010). The Harvard scientists randomly assigned 80 patients suffering from irritable bowel syndrome (IBS) to either a placebo group or no-treatment group. The patients in the placebo group received a placebo pill along with the following explanation: “Placebo pills are made of an inert substance, like sugar pills, and have been shown in clinical studies to produce significant improvement in IBS symptoms through mind-body self-healing processes”. As can be seen from the graph below, the pills did their magic. The improvement in the placebo group was roughly 30 % higher than in the no-treatment group and the low p-value (see appendix for an explanation of the p-value) shows that it is extremely unlikely that this result came to be by chance. Unfortunately, there seems to be a downside to the honesty. Hashish (1988) analyzed the effects of real and sham ultrasound treatment on patients whose impacted lower third molars had been surgically removed and concluded that the effectiveness in producing a placebo response is diminished if the patient comes to understand that the therapy is a placebo treatment rather than the “real” one. So while the placebo-effect does arise even without the element of deception, a fact that is quite astonishing on its own, deception does strengthen the response to the placebo treatment.

plac1

Results of Kaptchuk et al. (2010)

Let’s explore some more experimental studies to fully understand the depth and variety of the placebo effect. A large proportion of the relevant research has focused on the effect’s analgesic nature, that is, its ability to reduce pain without impairing consciousness. Amanzio et al. (2001) examined patients who had undergone thoracotomy, a major surgical procedure to gain access to vital organs in the chest and one that is often associated with severe post-operative pain. As handing out sugar pills would have been irresponsible and unethical in this case, the researchers found a more humane method of unearthing the placebo effect: the open-hidden paradigm. All patients received powerful painkillers such as Morphine, Buprenorphine, Tramadol, … However, while one group received the drug in an open manner, administered by a caring clinician in full view of the patient, another group was given the drug in a hidden manner, by means of a computer-programmed drug infusion pump with no clinician present and no indication that the drug was being administered. This set-up enabled the researchers to determine how much of the pain reduction was due to the caring nature of the clinician and the ritual of injecting the drug. The results: the human touch matters and matters a lot. As can be seen from the graph below, every painkiller became significantly more effective when administered in an open fashion. Several follow-on studies (Benedetti et al. 2003, Colloca et al. 2004) confirmed this finding. This demonstrates that the placebo effect goes far beyond the notorious sugar pill, it can also be induced by the caring words of a professional or a dramatic treatment ritual.

plac2
Results of Amanzio et al. (2001)

The fact that the human touch is of major importance in any clinical treatment, placebo or otherwise, seems pretty obvious (though its power in reducing pain might have surprised you). Much less obvious are the roles of administration form and treatment ritual, something we shall further explore. For both we can use the following rule of thumb: the more dramatic the intervention, the stronger the placebo response. For example, several studies have shown that an injection with salt-water is more effective in generating the placebo effect than a sugar pill. This is of course despite the fact that both salt-water and sugar pills do not have any direct medical benefits. The key difference lies in the inconveniences associated with the form of delivery: while swallowing a pill takes only a moment and is a rather uncomplicated process, the injection, preparation included, might take up to several minutes and can be quite painful. There’s no doubt that the latter intervention will leave a much stronger impression. Another study (Kaptchuk et al. 2006) came to the exciting conclusion that a nonsensical therapeutic intervention modeled on acupuncture did a significantly better job in reducing arm pain than the sugar pill. While the average pain score in the sham acupuncture group dropped by 0.33 over the course of one week, the corresponding drop in the sugar pill group was only 0.15. Again the more dramatic treatment came out on top.

The experimental results mentioned above might explain why popular ritualistic treatments found in alternative medicine remain so widespread even when there are numerous studies providing ample proof that the interventions lack biological plausibility and produce no direct medical benefits. Despite their scientific shortcomings, such treatments do work. However, this feat is extremely unlikely to be accomplished by strengthening a person’s aura, enhancing life force or harnessing quantum energy, as the brochure might claim. They work mainly (even solely) because of their efficiency in inducing the mind’s own placebo effect. Kaptchuk’s study impressively demonstrates that you can take any arbitrary ritual, back it up with any arbitrary theory to give the procedure pseudo-plausibility and let the placebo effect take over from there. Such a treatment might not be able to compete with cutting-edge drugs, but the benefits will be there. Though one has to wonder about the ethics of providing a patient with a certain treatment when demonstrably a more effective one is available, especially in case of serious diseases.

Don’t Forget Your Lucky Charm

This seems to be a great moment to get in the following entertaining gem. In 2010, Damish et al. invited twenty-eight people to the University of Cologne to take part in a short but sweet experiment that had them play ten balls on a putting green. Half of the participants were given a regular golf ball and managed to get 4.7 putts out of 10 on average. The other half was told they would be playing a “lucky ball” and, sure enough, this increased performance by an astonishing 36 % to 6.4 putts out of 10. I think we can agree that the researchers hadn’t really gotten hold of some magical performance-enhancing “lucky ball” and that the participants most likely didn’t even believe the story of the blessed ball. Yet, the increase was there and the result statistically significant despite the small sample size. So what happened? As you might have expected, this is just another example of the placebo effect (in this particular case also called the lucky charm effect) in action.

OK, so the ball was not really lucky, but it seems that simply floating the far-fetched idea of a lucky ball was enough to put participants into a different mindset, causing them to approach the task at hand in a different manner. One can assume that the story made them less worried about failing and more focused on the game, in which case the marked increase is no surprise at all. Hence, bringing a lucky charm to an exam might not be so superstitious after all. Though we should mention that a lucky charm can only do its magic if the task to be completed requires some skill. If the outcome is completely random, there simply is nothing to gain from being put into a different mindset. So while a lucky charm might be able to help a golfer, student, chess player or even a race car driver, it is completely useless for dice games, betting or winning the lottery.

Let’s look at a few more studies that show just how curious and complex the placebo effect is before moving on to explanations. Shiv et al. (2008) from the Stanford Business School analyzed the economic side of self-healing. They applied electric shocks to 82 participants and then offered them to buy a painkiller (guess that’s also a way to fund your research). The option: get the cheap painkiller for $ 0.10 per pill or the expensive one for $ 2.50 per pill. What the participants weren’t told was that there was no difference between the pills except for the price. Despite that, the price did have an effect on pain reduction. While 61 % of the subjects taking the cheap painkiller reported a significant pain reduction, an impressive 85 % reported the same after treating themselves to the expensive version. The researchers suspect that this is a result of quality expectations. We associate high price with good quality and in case of painkillers good quality equals effective pain reduction. So buying the expensive brand name drug might not be such a bad idea even when there is a chemically identical and lower priced generic drug available. In another study, Shiv et al. also found the same effect for energy drinks. The more expensive energy drink, with price being the only difference, made people report higher alertness and noticeably enhanced their ability to solve word puzzles.

 

This was an excerpt from my Kindle e-book Curiosities of the Mind. To learn more about the placebo effect, as well as other interesting psychological effects such as the chameleon effect, Mozart effect and the actor-observer bias, click here. (Link to Amazon.com)

Exponential Functions and their Derivatives (including Examples)

Exponential functions have the general form:

Derivatives_html_28f62f1b

with two constants a and b (called base). It’s quite common to use Euler’s number e = 2.7182… as the base and the exponential function expressed as such:

Derivatives_html_m55d6ad0b

with two constants a and c. Converting from one form to the other is not that difficult, just use ec = b or c = ln(b). Here’s how it works:

Derivatives_html_m3951e5f

Derivatives_html_59deade

As for the plot, you should keep two special cases in mind. For b > 1 (which corresponds to c > 0 in case of base e), the function goes through the point P(0,a) and goes to infinity as x goes to infinity.

Derivatives_html_m47952ca3

(Exponential function with b > 1 or c > 0. For example: f(x) = 8·3x)

This is exponential growth. When 0 < b < 1 (or c < 0) this turns into exponential decline. The function again goes through the point P(0,a), but approaches zero as x goes to infinity.

Derivatives_html_m3039be7

(Exponential function with 0 < b < 1 or c < 0. For example: f(x) = 0.5x)

Here’s how the differentiation of exponential functions works. Given the function:

Derivatives_html_28f62f1b

 The first derivative is:

Derivatives_html_1caa28b5

For the case of base e:

Derivatives_html_m55d6ad0b

We get:

Derivatives_html_m7e6aad94

You should remember both formulas. Note that the exponential functions have the unique property that their first derivative (slope) is proportional to the function value (height above x-axis). So the higher the curve, the sharper it rises. This is why exponential growth is so explosive.

———————————————–>

Example 1:

Derivatives_html_m59848e08

Derivatives_html_m30687e30

Example 2:

Derivatives_html_m79ef2f66

Derivatives_html_1f8b7d15

Example 3:

Derivatives_html_3b1b3aeb

Derivatives_html_729444d5

Derivatives_html_2c9b781e

Derivatives_html_m63701786

Derivatives_html_74dba73b

Example 4:

Derivatives_html_m43291588

Derivatives_html_6f6b9781

<———————————————–

If exponential functions are combined with power or polynomial functions, just use the sum rule.

———————————————–>

Example 5:

Derivatives_html_6de189e

Derivatives_html_5a9fe046

Derivatives_html_m7f2d5936

Derivatives_html_753619fa

Derivatives_html_63759307

Example 6:

Derivatives_html_m1e3db122

Derivatives_html_42e3abb4

Derivatives_html_4069df23

Derivatives_html_m3887b4fe

Derivatives_html_m517177dd

(This was an excerpt from the FREE ebook “Math Shorts – Derivatives”)

New Release for Kindle: Math Shorts – Derivatives

The rich and exciting field of calculus begins with the study of derivatives. This book is a practical introduction to derivatives, filled with down-to-earth explanations, detailed examples and lots of exercises (solutions included). It takes you from the basic functions all the way to advanced differentiation rules and proofs. Check out the sample for the table of contents and a taste of the action. From the author of “Mathematical Shenanigans”, “Great Formulas Explained” and the “Math Shorts” series. A supplement to this book is available under the title “Exercises to Math Shorts – Derivatives”. It contains an additional 28 exercises including detailed solutions.

Note: Except for the very basics of algebra, no prior knowledge is required to enjoy this book.

Table of Contents:

– Section 1: The Big Picture

– Section 2: Basic Functions and Rules

Power Functions
Sum Rule and Polynomial Functions
Exponential Functions
Logarithmic Functions
Trigonometric Functions

– Section 3: Advanced Differentiation Rules

I Know That I Know Nothing
Product Rule
Quotient Rule
Chain Rule

– Section 4: Limit Definition and Proofs

The Formula
Power Functions
Constant Factor Rule and Sum Rule
Product Rule

– Section 5: Appendix

Solutions to the Problems
Copyright and Disclaimer
Request to the Reader

Inflation: How long does it take for prices to double?

A question that often comes up is how long it would take for prices to double if the rate of inflation remained constant. It also helps to turn an abstract percentage number into a value that is easier to grasp and interpret.

If we start at a certain value for the consumer price index CPI0 and apply a constant annual inflation factor f (which is just the annual inflation rate expressed in decimals plus one), the CPI would grow exponentially according to this formula:

CPIn = CPI0 · f n

where CPIn symbolizes the Consumer Price Index for year n. The prices have doubled when CPIn equals 2 · CPI0. So we get:

2 · CPI0 = CPI0 · f n

Or, after solving this equation for n:

n = ln(2) / ln(f)

with ln being the natural logarithm. Using this formula, we can calculate how many years it would take for prices to double given a constant inflation rate (and thus inflation factor). Let’s look at some examples.

——————–

In 1918, the end of World War I and the beginning of the Spanish Flu, the inflation rate in the US rose to a frightening r = 0.204 = 20.4 %. The corresponding inflation factor is f = 1.204. How long would it take for prices to double if it remained constant?

Applying the formula, we get:

n = ln(2) / ln(1.204) = ca. 4 years

More typical values for the annual inflation rate are in the region several percent. Let’s see how long it takes for prices to double under normal circumstances. We will use r = 0.025 = 2.5 % for the constant inflation rate.

n = ln(2) / ln(1.025) = ca. 28 years

Which is approximately one generation.

One of the highest inflation rates ever measured occurred during the Hyperinflation in the Weimar Republic, a democratic ancestor of the Federal Republic of Germany. The monthly (!) inflation rate reached a fantastical value of r = 295 = 29500 %. To grasp this, it is certainly helpful to express it in form of the doubling time.

n = ln(2) / ln(296) = ca. 0.12 months = ca. 4 days

Note that since we used the monthly inflation rate as the input, we got the result in months as well. Even worse was the inflation at the beginning of the nineties in Yugoslavia, with a daily (!) inflation rate of r = 0.65 = 65 %, meaning prices doubled every 33 hours.

——————–

This was an excerpt from “Business Math Basics – Practical and Simple”. I hope you enjoyed it. For more on inflation check out my post about the Time Value of Money.