Math bleg:

Can anyone recommend to me any simple functions with the following properties: f(0)=0, f(infinity)=1, and f'(0)=infinity? I.e., a function that could be used for the probability of getting a policy change as a function of your lobbying expenditures; but I'd like to have that first-derivative condition so I'm guaranteed to have an interior solution when I maximize af(x)-x for any a.

UPDATE: Oops! I meant f(0)=0, not f(x)=0. That's corrected now.

UPDATE 2: Thanks, folks. Aaron Bergman suggested 1 + e^(-x^2)(sqrt(x)-1). Unfortunately, I forgot to specify that I also wanted f'(x)>0 for all x; and that function goes above 1 and then dips back down so f(infinity)=1. While I'm at it, I also wanted f"(x)<0 for all x. Syd suggested sqrt(x)/(sqrt(x)+1)), which works fine. Chrismn suggested 1-e^(-sqrt(x)), which also works fine. Maniakes suggested the logistic function, but I don't think I can make that match all three of my conditions. Chrismn suggested the constant absolute risk aversion -e^(-ax)+1, but that violates f(0)=0. Aaron Bergman, finally, suggests (2/pi) atan(sqrt(x)), which looks cool.

UPDATE 3: Aaron Bergman also suggests an ingenious method, which I was unaware of, to generate all the functions like that you want! Just take a function g such that g(0)=0, g(infinity)=1, and g'(0) is finite (he doesn't say it, but perhaps you also need it to be nonzero). Then for any r in the interval (0,1), define f(x)=g(x^r). That way, first, f(0) = g(0^r) = g(0) = 0. Second, f(infinity) = g(infinity^r) = g(infinity) = 1. And, third, f'(x) = r x^(r-1) g'(x^r), so f'(0) = r 0^(r-1) g'(0^r) = r infinity g'(0) = infinity. All three functions I liked above are special cases of this. Thanks, Aaron!

UPDATE 4: Reader Paul Edelman suggests another function: sqrt(x/(1+x)). This illustrates a similar way of generating such functions: Take a function g defined as in Update 3, then define f(x)=[g(x)]^r. That way, f(0)=0 and f(infinity)=1 obviously. Also, f'(x) = r g'(x) [g(x)]^(r-1), so f'(0)=infinity. Now that's not the way Paul found the function. He used yet another way, which is also nice: Look for a function g such that g(0)=0, g'(0)=0, and g has a vertical asymptote at 1. Then take the inverse of that function, and that's your f. So x^2 definitely has value and first derivative 0 at 0, and if you stick a (1-x^2) denominator on it, you get yourself an asymptote. So g(x)=x^2/(1-x^2) works, and f(x)=sqrt(x/(1+x)) is its inverse function.

UPDATE 5: Sadly, these functions don't have closed-form solutions, if, say, I want to take the inverse of the derivative!

Roger (mail):
f(x) = 0 for what x?
8.31.2006 1:26pm
Aaron Bergman (mail):
1 + e^(-x^2)(sqrt(x)-1)
8.31.2006 1:29pm
Jens Fiederer (mail) (www):
In any standard math, there is no such thing as
there is only the limit of f(x) as x approaches infinity.
And since you have JUST SPECIFIED that f(x) = 0, the limit of f(x) as x approaches infinity is 0, not 1.

f(0) -> infinity (better said "undefined") on the other hand is easy.
8.31.2006 1:30pm
Aaron Bergman (mail):
I think it's pretty clear he means f(0) = 0, especially given the description -- spend nothing, get nothing.
8.31.2006 1:33pm
Syd (mail):
You need to restate that. I don't think you want f(x) = 0 because it gives you the 0 function.

If you want f(0) = 0, sqrt(x)/(sqrt(x)+1)) will do.
8.31.2006 1:38pm
Cheburashka (mail):
f(x) = x/infinity
8.31.2006 1:48pm
Cheburashka (mail):
Never mind :P
8.31.2006 1:49pm
chrismn (mail):
The simplest I could come up with is 1-e^(-sqrt(x)) which is close to Aaron's above.

In economics and finance, the utility function u(c) = -e^(- gamma c) is commonly used. It's domain is the entire real line and its range is (-infinty,0). It is increasing and concave (a requirement for a utility function) and has the property that -u''(c)/u'(c) is a constant, gamma. Since -u''(c)/u'(c) is called risk aversion, this utility function is referred to as constant absolute risk aversion. The addition of the 1 above makes f(infinity) = 1 instead of zero and the sqrt gets the derivative at zero right.
8.31.2006 1:49pm
For any n, take the function
F(x) = 0, x is less than or equal to n
F(x) = 1, x is greater than n

Now take the function on lim nā€”> infinity

This will give you a function with the three properties you requested. It is not, however, differentiable at infinity.
8.31.2006 1:49pm
Sorry, that third condition was f'(0). N.A.
8.31.2006 1:51pm
We can prove that no such function exists, because for any epsilon greater than 0, f(0+epsilon) = 0 and f(0) = 0 by your definition, so it follows that if the derivative of f at 0 exists, it must be 0. It cannot be infinity.
8.31.2006 1:53pm

Shows up all the time in nature, in economics, and in manufacturing theory, and is often a good model for diminishing marginal returns.

You can set the constants so that f(0) = 0 and f'(0) = (arbitrary) (the Y axis is somewhere in the middle of the curve, and the curve is shifted so it intersects the origin), or so that the lower asymtope is the X axis, f(0) is a little higher than 0, and the interesting part of the graph is somewhere to the right.
8.31.2006 1:54pm
Navin R. Johnson (mail):
oh my god.
8.31.2006 2:00pm
ruidh (www):
Any cumulative probability density function which is defined over the non-negative reals satisfies every condition but the derivative. And I'm not at all sure you need or even want to specify the derivative that way. It's very likely the case that small expenditures of funds will not apprecably increase the probability of getting passed. Spending too little might insult the wrong folks and get them to vote against you. "Here' I'll give you this biro imprinted with your name if you vote for my bill" is likely to be counter productive. The steepness of the CDF near zero in your original request implies that small expenditures of money quickly give you an apprecable probability of success.

Some example functions include the threshold function. Probability is zerp until some threshold amount is reached at which probability becomes one. Probably not what you want.

S-shaped functions that increase slowly until thy reach an inflection point and then rapidly approach 1. these are used for the likelihood that someone will exercise a call option as a function of interest rates. The derivative at the inflection point controls how wide the interesting area of how much to expend is.
8.31.2006 2:23pm
ruidh (www):
I should add that plain, old normal probaility distributions produce nice, s-shaped CDFs.
8.31.2006 2:25pm
Stephen C. Carlson (www):
I found a page with a graph of a utility function that appears to have the desired properties [assuming you meant f(0)=0]. See FIG. 9.6 in:
8.31.2006 2:27pm
Aaron Bergman (mail):
(In the neverending pursuit of avoinding actual work....)

Mine goes above 1 briefly which isn't cool. The others all work, but I'll throw out (2/pi) atan(sqrt(x)).

More generally one way to get solutions is to let g be a function such that g(0) = 0, g(+oo) = 1 and g'(0) < oo, and let r be a number in (0,1). Then f(x) = g(x^r) satisfies what you want.

The examples so far are g = 1 + e^{-x^2}(x - 1), g = x / (1 + x), g = 1 - e^{-x} and g= (2/pi) atan(x).
8.31.2006 2:44pm
chrismn (mail):

Why do you need an explicit functional form? Why not simply assume a function f such that f(0) = 0, f'(0)=infinity, f'(infinity) = 1, f'(x)>0 and f' '(x) < 0. Max_x a f(x) - x is then a concave programming problem whose solution is determined by its first order condition and you can say what happens to x as a increases without knowing the functional form. Specifically, as a increases f'(x) = 1/a implies that f'(x) decreases which implies that that x increases since f'(x) is a decreasing function from f''(x) < 0.
8.31.2006 3:19pm
Sasha Volokh (mail) (www):
Chrismn -- I agree. It's just that I have a subproblem of that problem where the sign is ambiguous, and I want to illustrate how it can be different under different functional forms.
8.31.2006 3:21pm
Jon Rowe (mail) (www):
This reminds me of how much I hate much. I am a math ignoramus as you seem to be speaking in a foreign language to me.
8.31.2006 4:33pm
Dave Hardy (mail) (www):
Non-math issue:

Lobbying expenditures may not be indicative of much. At least when I was first in DC (1979-80), there was no legal definition of lobbying, in the sense of what got counted in.

NRA wanted to keep their numbers low, and so reported salaries proportioned to when a lobbyist actually talked to a legislator. Which is generally going to be well under an hour a day per person, and doesn't include secretaries' salaries, office expenses, etc.

Citizen's Committee wanted theirs high, so they reported the entire budget of their federal division. They had one lobbyist and a secretary, NRA had five fulltime lobbyists and as many secretaries.

As a result there were occasional conflicts when Citizen's Committee announced it was spending more on lobbying than was any other firearm organization.
8.31.2006 4:49pm
cmn (mail) (www):
It was my understanding that there would be no math.
8.31.2006 5:20pm
TO (mail):
So... if a prison guard is 2000th or so in the succession line for the British throne, but he's seriously dating a Catholic, you're looking for the probability that spending money lobbying him for policy change will actually have an effect?
8.31.2006 5:39pm
logicnazi (mail) (www):
Why the preference for closed form inverse? I've always felt that was a pretty arbitrary demand. All it means is that we picked some finite list of functions like sin, cos that we can approximate efficently and ask for the function writen in terms of those.

Writing the function in terms of inverse of blah or integral of blah has always struck me as just as good. I kinda feel all the time we spend teaching kids to find closed form solutions to anything but the simplest integrals is a waste of time in an age of computers. Teach them the basic principles and how you could approximate the value if you wanted. Making them remember that the inverse of 1/sqrt(1+x^2) is arcsin or arctan or whatever is just kinda silly.
8.31.2006 5:44pm
A. Zarkov (mail):
Trying to model in the probability domain can lead to difficulties. Use the odds ratio, or the log odds ratio as your response and make it a simple function the expenditures. For example:

p/(1-p) )= a * x

where p= probability of a policy change

x= expenditures

You have to do more than find a function that satisfies boundary conditions. You have to worry about estimating the parameters or generating samples from the distribution for simulation purposes.

Note I would think even with zero expenditures there is still a non-zero probability of a policy change.

I would fool around with log(p/(1-p)) = some simple (not necessarily polynomial) function of x.
8.31.2006 5:45pm
Delurking (mail):
I must admit I don't understand why you want F(0) = 0 and F'(0) = 0, given what you are trying to model. First, the policy might change anyway even if you do nothing. Second, even if you rule that out as a possibility, an infinite slope at 0 doesn't seem likely as a good model.

How about something like this:
F(x) = 1/(Exp[(a-x)/b)]+1)

In rough terms: a tells you where the middle is, and b tells you how quickly it rises. So, a how much $ it takes to have a reasonable chance of changing the policy, and b gives you the "chance" part of it (if b = 0, then you have a threshold at a where the instant you cross it, your odds go from 0 to 1). If you make 0 < b << a, then F(0) is exceedingly small.
8.31.2006 5:52pm
Delurking (mail):
Damn, beaten to it.
However, I might argue that my post is more transparent.
8.31.2006 6:03pm
lucia (mail) (www):
Can you relax this: f'(0)=infinity ?

If you are willing to accept f'(0) is pretty big, you can use

f(x)= 1-exp(-ax)

The derivative at zero x=0 is "a", which you can make pretty darn big. The function is a snap to integgrate. You can take the inverse easily. Doubtless if you are looking for some sort of closed form function, that should help.

I don't know what you are trying to do, but it may turn out that you can take the limit as a-> infinity at the end of the analysis.
8.31.2006 6:04pm
I'm crushed.

First I return from lunch to find my favorite solutions taken ā€” those being the family f=sqrt(g), where g(x)=x/x+1 , arctan(x), etc.

Then -- horror! -- I find that no longer supports the <SUP> tag.

So I'll just agree with the later posters that the requirement that f' diverges near zero is unrealistic ā€” "nonphysical," if we were talking about physics ā€” and that relaxing it permits a wide range of elegant solutions: all with nice inverses, simple derivatives, parameters, etc.: 1-exp-x, arctan, x/x+1, etc.

Higher Math: when your answer won't work, reject the question.
8.31.2006 6:30pm
Yeah, requiring f' --> +oo near zero implies that the first $1 buys you a lot of persuading, when I think the opposite is plausible: that there's a certain "inertial barrier" to be overcome, a certain minimum stake, in persuading legislators or voters. If anything, I'd guess that f'(0)~0 is more likely.

And I agree that f(0)=0 is unrealistic, given that laws can pass with little or no $.

Regardless, please bring back the <SUP> tag. How can we talk math without having at least super/subscripts?
8.31.2006 6:40pm
Donald Kahn (mail):
Don't overlook the fundamental theorem of base 1 arithmetic:

For all n, n=0.
8.31.2006 7:07pm
chrismn (mail):
f'(0) = infinity allows one to avoid corner solutions. If not, then then the solution to max_x a f(x) - x may be x = 0 (in fact, will be for all a such that f'(0)< 1/a). I assume Sasha wants to use in his work that f'(x) = 1/a, not f'(x) = 1/a if x is greater than 0 and f'(x) <= 1/a if x=0 which is much messier.
8.31.2006 10:32pm
chrismn (mail):
8.31.2006 10:35pm
xcosray (mail):
Draw a quarter circle centered at (1,0) with radius 1. That is,

y = sqrt (1- x**2)
9.1.2006 12:26am
These were my two favorites:

Probability is zerp until some threshold amount is reached

This reminds me of how much I hate much.

And I agree with this

I must admit I don't understand

But I do have a comment.

I.e., a function that could be used for the probability of getting a policy change as a function of your lobbying expenditures;

Far be it from me to make nasty comments about "ivory tower math" and its lack of relationship to the real world......but don't you actually need some data?

For example, your theoretical function must take into account in the real lobbying world the analogy to presidential campaigns, which would be

I.e., a function that could be used for the probability of getting a primary candidate selected as the party candidate as a function of your campaign expenditures;

A number of primary candidates have spent huge amounts of money, to get diddly squat. If memory serves, John Connally, for example, spent $25 million and got one delegate.

Resume unreality
9.1.2006 1:07am
Sasha Volokh (mail) (www):
Lev: The real world is for the empirical papers! Incidentally, this is all consistent with spending huge amounts of money to get diddly squat. John Connally would probably have gotten even fewer delegates (e.g., zero) if he had spent less. He had his own personal f(x), which is different than the corresponding function for other politicians.

Chrismn: The way I like to summarize the Inada conditions (well, actually just the ones that relate to the first derivative): Refer to infinity as "I". Then the limit of f'(x) at I is nada, and the limit of f'(x) at nada is I.

Everyone who complained about f(0)=0 (and possibly about f(infinity)=1): I agree, those conditions aren't necessary -- I just put that in for this question so the answers would all be standardized. It's trivial to make f(0) arbitrary and f(infinity) also arbitrary (as long as f(infinity)>f(0) and both are in [0,1]).

Everyone who complained about my insisting on concavity all the way (or about my insisting on f'(0)=infinity): I also agree that this isn't fully realistic, and in fact in my paper I'm almost certainly going to talk about S-shaped curves at some point; but concave functions are of course easiest for illustrating some basic points.
9.1.2006 1:18am
Sasha Volokh

Maybe what you need is...The Laffer Curve...or...a black body radiation curve (and I don't mean Halle Berry or Beyonce).
9.1.2006 1:41am
Physics Nick:
The first thing I thought of was the error function.

It can be expressed in a power series (as shown in the link above) and is technically considered 'closed-form' since the integration values are tabulated everywhere (it is very commonly used in physics). Also, you can integrate the first few terms by hand and get a good idea of what is going on.

Hope that helps.

9.1.2006 1:46am
xcosray (mail):
Oops, misread the question as f(1) = 1, not f(infinity) = 1. Strike my earlier elegant, now totally nonsensical comment.
9.1.2006 4:38am
Stephen (M) Ethesis (mail) (www):
Err, (x/(1+x)) works just fine, you don't need to take a root. x=0; f(x)=0. x=infinity, f(x) = 1. Taking the square root just changes the shape of the curve, but not the boundaries.
9.1.2006 12:09pm
Stephen (M) Ethesis (mail) (www):
I should have noted that without the various roots, the concavity isn't much (looks like a straight line until infinity), but it is there. ;)
9.1.2006 12:11pm
y = (2/pi) * arcsec(x-1)

...where the arcsec function is the inverse secant function. If y = arcsec (x), then x = sec (y).

- simple function. Check.
- f(0) = 0. Check.
- f(infinity) = 1. Check, if the arguments are in radians.
- f'(0)=infinity. Check.
9.1.2006 1:09pm
Sasha Volokh (mail) (www):
Stephen Ethesis: You forgot the condition that f'(0)=infinity.
9.1.2006 1:20pm
DJ (mail):
This is all a joke, right? People don't really talk this way.
9.1.2006 1:23pm
Seth Chandler (mail):
I believe the following there is a very icky closed form solution of the derivative of the function Sqrt[x/(1+x)]

-3/4 + Sqrt[1 - 8/(3^(1/3)*(-9*x^4 + Sqrt[3]*Sqrt[64*x^6 + 27*x^8])^
(1/3)) + (2*(-9*x^4 + Sqrt[3]*Sqrt[64*x^6 + 27*x^8])^(1/3))/
(3^(2/3)*x^2)]/4 +
Sqrt[1/2 + 2/(3^(1/3)*(-9*x^4 + Sqrt[3]*Sqrt[64*x^6 + 27*x^8])^
(1/3)) - (-9*x^4 + Sqrt[3]*Sqrt[64*x^6 + 27*x^8])^(1/3)/
(2*3^(2/3)*x^2) +
1/(2*Sqrt[1 - 8/(3^(1/3)*(-9*x^4 + Sqrt[3]*Sqrt[64*x^6 + 27*x^8])^
(1/3)) + (2*(-9*x^4 + Sqrt[3]*Sqrt[64*x^6 + 27*x^8])^(1/3))/

I am happy to send anyone a Mathematica notebook or PDF version thereof showing the solution.
9.1.2006 2:54pm

The quarter circle is still the obvious choice, just substitute x/(x+1) for x to satisfy the limit as x goes to infinity.
9.1.2006 4:00pm
David Matthews (mail):
The arcsecant function (properly translated and scaled) fits the bill nicely.

f(x) = (2/pi)*Arcsec(x+1)

lim x-> inf f(x) = (2/pi)*(pi/2) = 1,

f(0) = (2/pi)*Arcsec(0+1) = 0

f'(0) = 1/(abs(x+1)*sqrt((x+1)^2 - 1) -> infinity

and it has a nice closed-form antiderivative:

F(x) = (2/pi)*[(x+1)Arcsec(x+1) - Ln|x+1 + sqrt((x+1)^2 - 1)|] + C
9.1.2006 5:34pm
David Matthews (mail):
Jade Philosopher:

Oops, you beat me to it. But, at least I integrated it!

9.1.2006 5:35pm
David Matthews (mail):
Oh, and you wanted (x+1) not (x-1).

9.1.2006 5:36pm
David Speyer (mail):
I haven't read through all of the comments, but what about
f(x)=1-1/(1+x^{1/3})? The conditions at 0 and infinity are easily checked, and it can be shown to be convex. After a little algebra, we get

f'(x)=(1/3) /(x^{1/3}+x^{2/3})^2

So f'(x)=a is equivalent to x^{1/3}+x^{2/3}=1/(3a)^{1/2}, which is a quadratic equation in x^{1/3} and can thus be solved by the quadratic formula.

To be honest, I find this repulsive. The "most natural" way for a function to have an infinite derivative is to locally look like a square root, not a cube root. But trying to do an example like this with 1-1/(1+x^{1/2}) leads to the cubic formula (you get x^{1/4}+x^{3/4}=something). The cubic formula, especially when the u^2 term is zero, isn't actually that terrible. Still, I imagine that it is worse than you are willing to deal with.

Do you really need a precise formula for the inverse? I imagine that any analysis that you are going to do only really depends on the asymptopics as the slope goes to zero and infinity and you can get the asymptopic behavior of the inverse much more easily than you can get a closed form.
9.3.2006 12:49am
David Speyer (mail):
Another option is f(x)= (2/pi) tan^{-1}(x^{1/3}). f'(x)=(2/3 pi)/(x^{2/3}+x^{4/3}) so you get x^{4/3}+x^{2/3} = something, which is a quadratic in x^{2/3}. I have the same objection to this formula as the previous one, although it is maybe a little nicer.
9.3.2006 1:02am