Wikipedia:Reference desk/Archives/Mathematics/2011 May 16

Mathematics desk
< May 15 << Apr | May | Jun >> May 17 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


May 16 edit

Black Scholes Transformation edit

This is a basic calculus question. I'm reading this book and on page 102 there is the Black Scholes equation

 

and the following substitutions are made

 

 

 

to turn the original equation into the following:

 

What's going on here exactly? I can't put my finger on where the terms in the transformations are coming from, I know it must be some sort of application of the chain rule but I don't see what exactly. —Preceding unsigned comment added by 130.102.158.15 (talk) 04:30, 16 May 2011 (UTC)[reply]

The formula you've listed is the partial differential equation version of the Black-Scholes formula. I believe the substitutions establish the boundary conditions for the solution. You can find more about this on page 440, here: http://faculty.atu.edu/mfinan/actuarieshall/DFEM.pdf. —Preceding unsigned comment added by 12.186.80.1 (talk) 20:16, 16 May 2011 (UTC)[reply]
Your best off working backwards. Go through the second equation doing all the differentiation and you should see that you get back to the first equation. (Assuming it's correct, I haven't actually checked it.) --Tango (talk) 20:20, 16 May 2011 (UTC)[reply]

Area enclosed by ellipse equation edit

How do you find the area enclosed by the ellipse   assuming the coefficients are chosen such that the equation yields an ellipse (rather than a hyperbola). Widener (talk) 06:40, 16 May 2011 (UTC)[reply]

Per ellipse, the area is  . Dragons flight (talk) 06:49, 16 May 2011 (UTC)[reply]
Fancy that! Is there a derivation or proof? Widener (talk) 06:59, 16 May 2011 (UTC)[reply]
The proof is about two lines if you use the fact that the discriminant is an invariant on binary quadratic forms. I don't think they cover that much in undergraduate curricula nowadays though.--RDBury (talk) 12:02, 16 May 2011 (UTC)[reply]

Generating sequences based on probabilities edit

I want to create a set of fixed-length sequences based on an a priori set of probabilities describing the distribution of symbols in the resulting set of sequences. The case where the probability of each position is independent is simple enough (simply pick each symbol randomly according to probability), but I'm at a bit of a loss as how to approach the problem if the input probabilities also specify the joint probability of multiple positions.

Perhaps a toy example will make things clearer. Take a three position binary sequence A,B,C. The input to the problem is probabilities for a symbol at each position, e.g p(A=1) = 0.6; p(B=1) = 0.5; p(C=1) = 0.55. Given those probabilities, I want to create a set of output sequences that, in the limit, would satisfy those probabilities. While simple enough for independent positions, I'm also interested in cases where joint probabilities are also specified, e.g. p(A=1,B=1) = 0.3; p(B=1,C=0) = 0.2; p(A=1,C=1) = 0.25. I'm not sure how to generate the sequence when there's not just a single probability to satisfy per position, but a web of interlocking probabilities. - As I said, that's just a toy example for explanatory purposes. The cases that I'm looking into are more complicated, with potentially dozens of positions and dozens of symbols at each position, so enumerative approaches aren't going to work. The joint probabilities would be limited to pairs of positions, though. (But approaches that are extensible to triples or quartets of positions would be all the better.) Any suggestions or pointers? Thanks. -- 140.142.20.229 (talk) 17:32, 16 May 2011 (UTC)[reply]

This is not solvable on the basis of the information provided. Without some extra information such as independence or second-order-independence, the joint probabilities do not determine the global probabilities, and you need to know the global probabilities in order to generate exemplars. (Bayesian techniques sometimes make use of joint probabilities of this sort, but they are not guaranteed to give the correct answer.) Looie496 (talk) 17:41, 16 May 2011 (UTC)[reply]
I'm not familiar with the concept of "second-order-independence", so am I right in assuming that it's the three event version of two-event independence (e.g. p(X,Y) = p(X)p(Y))? If so, yes, I should have stated that that can be assumed. Basically, the given probabilities are the only constraints on the system. Having the other degrees of freedom being as unbiased as possible is preferred, although if biasing them slightly is a way to make the problem more tractable, I'm open to it. As I mentioned, the problem is somewhat trivial if you can assume (pairwise) independence, but one of my issues is that I'm not sure how the three-plus event version of independence would behave (where there's nothing special about the probability distribution of triples of events that isn't captured by the probabilities of the individual events and pairs of events; like with pairwise p(X,Y) = p(X)p(Y) independence there's nothing about the probability of the pair of events that isn't captured by the probabilities of the single events), or even if it would simplify the problem. -- 140.142.20.229 (talk) 20:40, 16 May 2011 (UTC)[reply]
I would do this by first having a validity check - if any position has more than one symbol, the sequence is not valid. Then, calculate each probability. Say you set A=1/B=1 in the first probability and then you set B=0/C=1 in the following probability. This is not a valid sequence because B cannot be 1 and 0 at the same time. Quit and try again. Set that in a loop to try it over and over and over until a valid sequence appears. I just used this tactic because I lost my key for a piece of software. I knew the range and probabilities of most of the elements of the key, so I wrote a program to randomly generate keys until one of them passed the software's key check. In your cause, the validity check would be the same as the key check I used. -- kainaw 17:59, 16 May 2011 (UTC)[reply]
If I'm understanding you correctly, you're suggesting to select A,B, and C based on their individual probabilities, and then go through the list of pair probabilities, and then do random number draws and checks for each one? For example, We randomly pick ABC to be 110. We then look at the AB pair, draw a random number, say 0.25, find it passes the p(A=1,B=1) = 0.3 check, and move on to the BC pair. We pull another random number, say 0.65, and find it fails the p(B=1,C=0) = 0.2 check. We then throw out the selection, and regenerate an ABC sequence from scratch. - My concern with that is with a large number of pair probabilities, the procedure would be highly inefficient as the repeated tests mean most generated sequences would randomly fail at least one of the pair probability tests. -- 140.142.20.229 (talk) 20:51, 16 May 2011 (UTC)[reply]
And I'm not sure this will converge to the correct result. -- Meni Rosenfeld (talk) 09:46, 17 May 2011 (UTC)[reply]
It does because you did it below. You just described it better. You produce a lot of candidates and you pick the ones that maintain the expected distribution (I called the function that checked the expected distribution a "validity check"). I wrote it in a tiny script that produced 1,000,000 candidates. I got 420,028 sets to pass the validity check. My resulting percentages are 0.600, 0.502, 0.551, 0.245, 0.300, 0.211. I noticed that it is always closer to the expected percentages in the single element checks than the two-element checks. Also, it never gets A=1/C=1 down to 0.200. It is always high (once it was 0.232). -- kainaw 16:39, 17 May 2011 (UTC)[reply]
Ok, I get your method now. I think the OP's interpretation of it is wrong. It is very different from my method. I'm still not totally convinced that it works. -- Meni Rosenfeld (talk) 19:06, 17 May 2011 (UTC)[reply]
I see a possible mistake in the implementation in which the questioner stated. Simply, it states that there is a 30% chance A=1 and B=1. That means that there is a 70% chance that A=0 or B=0. You need to check both of those. Otherwise, it is not functionally the same as using a counter/weight for each of the probabilities. By using a counter/weight, you checked both sides of the probability. -- kainaw 19:14, 17 May 2011 (UTC)[reply]
I think the following should work. For each constraint, keep a running total of how many times its condition held in the items generated so far. When you need to generate a new item, generate one independently randomly based on the single-position constraints. Calculate the sum-of-squared-differences between the required probabilities (including single-position) and the empirical probabilities, for the current set and what your set would become if you added the new sample. Find out how much the new item improves your SSE, and either add it or reject it with a probability that depends on the improvement (maybe a linear function with cutoffs at 0 and 1, and no improvement -> 0.5 probability). -- Meni Rosenfeld (talk) 09:46, 17 May 2011 (UTC)[reply]
Actually, the probability for 0 improvement should be less than 0.5. Hold on... -- Meni Rosenfeld (talk) 10:05, 17 May 2011 (UTC)[reply]
Ok, new plan, even better than the last one. Keep a weight parameter for each condition (eg "A=1, B=1"), initialized to 0. When you generate a candidate item, sum up the weights for the conditions it matches. Include it with probability equal to the logistic function of the sum. If you do include it, add to each weight some number times the difference between the target probability for the condition (for "A=1, B=1" this is 0.3) and the indicator function of whether the item matches the condition.
I've simulated this on your toy example, and after roughly 100,000 candidates, I have a set with 83548 items and the respective empirical probabilities are {0.590822, 0.498731, 0.549911, 0.301156, 0.201393, 0.259168}, compared to the target {0.6, 0.5, 0.55, 0.3, 0.2, 0.25}.
You can also in the end discard all items generated before the weights stabilized. -- Meni Rosenfeld (talk) 10:27, 17 May 2011 (UTC)[reply]
Here's the Mathematica code for my simulation:
conditions = {{1, _, _}, {_, 1, _}, {_, _, 1}, {1, 1, _}, {_, 1, 0}, {1, _, 1}};
target = {0.6, 0.5, 0.55, 0.3, 0.2, 0.25};
lgs[x_] := 1/(1 + Exp[-x]);
emp[X_] := N[Map[Count[X, #] &, conditions]/Length[X]];
matches[x_] := Map[Count[{x}, #] &, conditions];
set = {};
weights = Table[0, {Length[conditions]}];
Do[If[lgs[weights.matches[#]] > RandomReal[], AppendTo[set, #];
 weights += 0.1 (target - matches[#])] &[RandomInteger[1, 3]], {100000}]
-- Meni Rosenfeld (talk) 11:43, 17 May 2011 (UTC)[reply]
Thanks, that seems to work decently. I was a little concerned that it might be slow for large number of low-probability conditions (as you're likely to get if you have dozens of symbols at dozens of positions all extensively connected), but it seems like the acceptance rate stays above 50%, even for the small probability cases. Is there a name for this method (e.g. is it a modification of some standard technique)? I'm wondering how best to refer to it when discussing it with others. -- 140.142.20.229 (talk) 21:00, 17 May 2011 (UTC)[reply]
I don't know a name for it, but I was inspired by logistic regression when thinking about it.
Actually, I have doubts now that it is guaranteed to work. If the weights stabilize around some finite numbers, then the generated accepted items will satisfy the conditions. But the weights will likely not stabilize, so the result could be a complex interplay of the way it diverges to infinity.
It might help somewhat if you allow a constant parameter added to the sum. I'm not sure how it should be calibrated.
It's an interesting problem, but I don't have the time to continue analyzing it. Play around with it a little and see what you get. -- Meni Rosenfeld (talk) 08:17, 18 May 2011 (UTC)[reply]
It is generally called rejection sampling. Using weights is one method of rejection sampling. The drawback is that the results are not accepted to be random because the generation of a new sequence is based on the previous sequences that were generated. Sort of like flipping a coin 5 times and getting 3 heads so you purposely force it to go tails to get a 3-3 distribution. -- kainaw 12:28, 18 May 2011 (UTC)[reply]

Let me suggest a useful notation for the conditions. Let the values be called 1 and 2 (rather than 1 and 0), and let the variables ABC be indicated by the digit position. Thus the conditions (A=1) (B=1) (C=1) (A=1,B=1) (B=1,C=0) (A=1,C=1) are called 100 010 001 110 012 101. Of course you have p(000)=1, so you can compute the probabilities of 200 020 002 120 210 220 011 102 and 101, but you do not know the probabilities for 021 and 022 individually, nor the probabilities for 111 112 121 122 211 212 221 and 222. Bo Jacoby (talk) 13:22, 18 May 2011 (UTC).[reply]

Normal subgroups edit

I'm trying to study for an exam, and this is one of the review questions listed on the textbook author's website:

Q: If N is a normal subgroup and |aN| = n, then a^n = e. 
A: false
Remark: a^n belongs to N.

I can't see for the life of me why a^n should belong to N. Isn't |aN|=n just |N|, regardless of what a is, and regardless of whether N is normal? By substitution, that would seem to imply that a^(|N|) belongs to N, for any element a and for any subgroup N, which can't possibly be right... 71.176.168.114 (talk) 19:35, 16 May 2011 (UTC)[reply]

|aN| doesn't necessarily equal |N|. Consider N=Z_2 (ie. integers mod 2, so it has order 2) and a=2. aN is then the trivial group, so has order 1. --Tango (talk) 20:27, 16 May 2011 (UTC)[reply]
OK, you're right, but I still don't see the leap to "a^n belongs to N." Can you explain that or give me a hint? 71.176.168.114 (talk) 20:32, 16 May 2011 (UTC)[reply]
I think that |aN| = n is supposed to mean that the order of the element aN in the quotient group G/N is n. Matthew Auger (talk) 21:09, 16 May 2011 (UTC)[reply]
Thank you 71.176.168.114 (talk) 21:15, 16 May 2011 (UTC)[reply]
Surely |aN|=n simply means that the group aN has n elements. It may follow from that that [a] in G/N has order n (from which it very quickly follows that a^n is in N), but it still needs to be proven. --Tango (talk) 23:04, 16 May 2011 (UTC)[reply]
aN would only be a group if a∈N. The notation is confusing but I think the only interpretation that makes sense mathematically is |aN| means the order of aN in G/N. As an example, take G=<a>=cyclic of order 4, N=<a2>. Then G/N=<aN> is cyclic of order two but a2 is not e.--RDBury (talk) 01:33, 17 May 2011 (UTC)[reply]

Is there a word for a (position, orientation) pair? edit

It is something I use so commonly in geometry I'm amazed that after Googling I have not found a good word for it. Together the two describe 6 degrees of freedom of an object in relation to a defined axis system, typically

X, Y, Z, yaw, pitch and roll

There are many different ways of representing both the position and orientation parts. Any suggestions, no matter how informal, are welcome as long as it makes intuitive sense - I'm trying to choose a good type name in a program I'm writing.

196.215.115.184 (talk) 20:21, 16 May 2011 (UTC) Eon[reply]

Congruence, isometry, isometric map, movement? – b_jonas 20:29, 16 May 2011 (UTC)[reply]
They are examples of generalized coordinates. I don't know a more specific term. --Tango (talk) 20:32, 16 May 2011 (UTC)[reply]
Thanks, I think configuration is the best general word I could find so far after following your links. Actually, I thought posientation is a cool word to describe that. It turns out I'm not the first person on the internet to have thought of that! 196.215.115.184 (talk) 20:59, 16 May 2011 (UTC) Eon[reply]
What about pose? It's a term that comes up a lot in engineering when speaking of such matters.--Leon (talk) 21:59, 16 May 2011 (UTC)[reply]
Brilliant! That's the best word for it. And this is a computer vision application so I'm convinced. Thanks so much for your input. 196.211.175.2 (talk) 08:24, 17 May 2011 (UTC) Eon[reply]
Non-mathematician here, but I recall reading of a series of x,y coordinates being described as tuples, so yours would be 6-tuples. 92.24.186.11 (talk) 12:25, 21 May 2011 (UTC)[reply]
Yes, that will be a general term, but the OP is looking for something more specific. -- Meni Rosenfeld (talk) 11:06, 22 May 2011 (UTC)[reply]

Linear map from unit circle to ellipse edit

What is the linear transformation that maps the relation   onto   Widener (talk) 22:30, 16 May 2011 (UTC)[reply]

Try completing the square. That should give you the equation in a form where it is easier to see the necessary transformation. --Tango (talk) 23:00, 16 May 2011 (UTC)[reply]
Thanks. Widener (talk) 11:57, 17 May 2011 (UTC)[reply]
By the way, your question implies that the answer is unique, but it's not. Any 2×2 orthogonal matrix   maps the unit circle to itself, so if you have a linear transformation   that maps the unit circle to an ellipse, then   is another solution. 98.248.42.252 (talk) 16:21, 17 May 2011 (UTC)[reply]