Very quick question: function signature

  • Thread starter cezarion
  • Start date
  • Tags
    Function
In summary, the conversation discusses the definition of signature in relation to quadratic forms. The signature is the number of positive and negative eigenvalues in the matrix of the quadratic form. The conversation also provides an example of how to calculate the signature for a simple quadratic form, and mentions the use of eigenvectors and diagonalization. The conversation also acknowledges that the concept of eigenvalues may not have been covered in the course yet, and suggests a clever way to express a quadratic form as a sum of quadratics to find the signature.
  • #1
cezarion
5
0
I was just wondering if somebody could give me a very quick definition and work through a short example. We have just covered quadratic forms, and one of the questions we have been given is on calculating signatures.

I found several online references that say the signature relates to the number of positive and negative squares, but I am not sure how to apply this. For instance, how would I go about getting the signature of

[tex]a b + b c + c d[/tex] ?

I immediately see

[tex].5(a + b)^2 + .5(b + c)^2 + .5(c + d)^2 - .5a^2 - b^2 - c^2 - .5d^2[/tex]

gives three positive squares and four negative sqares, but I have no idea if this is the correct way to approach the problem. Thank you for your assistance!
 
Physics news on Phys.org
  • #2
Doesn't the signature of a quadratic form refer to the number of positive versus negative eigenvalues in the matrix of the quadratic form? In this case the matrix is 4x4, isn't it? There aren't really seven independent squares.
 
  • #3
Thank you for your reply. The definition that I am supposed to use is given by

http://mathworld.wolfram.com/QuadraticFormSignature.html

I am not sure how to convert my linear series of terms into a signature though, seeing as how there are no squared terms.
 
  • #4
Let's do a simple one, take L=xy, a two dimensional quadratic form. Note you can represent this in matrix form as M=[[0,1/2],[1/2,0]]. To get the value of the quadratic form on a vector (x,y) multiply on the right by the column version of (x,y) and on the left by the row. Got that? Now let's solve it. Notice L=((x+y)/2)^2-((x-y)/2)^2. So if I let v and w be the linear functions that are the contents of the squares, L=v^2-w^2. Now think about the matrix. It has eigenvalues +1 and -1 and corresponding eigenvectors [1,1] and [1,-1]. If you think about it these actually correspond to v and w (e.g. [x,y].[1,1]=x+y, [x,y].[1,-1]=x-y) and the algebra I've done corresponds to diagonalizing L. And if you just need the signature, you only need to know the signs of the eigenvalues. So to do your problem I put your matrix into a computer program and observed that the eigenvalues I get look pretty nasty, so I don't want to explicitly write the diagonalization. But it's pretty easy to read off the signs.
 
Last edited:
  • #5
Thank you for your reply. I think I understand your example for [tex]L = xy[/tex]. If instead I take [tex]M = xy + yz[/tex] can I write [tex]M = \frac{1}{2}(x + y)^2 - \frac{1}{2}(x - y)^2 + \frac{1}{2}(y + z)^2 - \frac{1}{2}(y - z)^2[/tex]?

We haven't covered eigenvalues yet in our course, so I'm not sure how to apply that to finding the signature. Thanks again for your help.
 
  • #6
I'm afraid not. There are three variables x,y and z. So you have to express the quadratic form as a sum of three squares. Take for example the quadratic form x^2, with just one variable. That has signature 1, right? Now write it as x^2+x^2-x^2. Looks like it has a different signature written in that form. If you don't know eigenvectors then the only way I can think of is to make a really clever guess as to how to express a quadratic form in n variables as a sum of at most n quadratics. Your last example can be written as ((x+sqrt(2)*y+z)^2-(x-sqrt(2)*y+z)^2)/(4*sqrt(2) and there's also a zero eigenvalue associated with x-z. If you haven't done eigen stuff yet, I don't think this question is in the right chapter. Unless the quadratic form is REALLY EASY.
 

FAQ: Very quick question: function signature

What is a function signature?

A function signature is a unique identifier for a function that includes the function's name, return type, and parameters. It is used to differentiate between different functions with the same name.

Why is a function signature important?

A function signature is important because it allows for function overloading, where multiple functions with the same name but different signatures can exist. This allows for more flexibility and versatility in programming.

What is the difference between a function signature and a function definition?

A function signature only includes the name, return type, and parameters of a function, while a function definition also includes the code that defines what the function does. In other words, the signature is like a summary of the function, while the definition is the actual implementation.

Can two functions have the same signature?

No, two functions cannot have the same signature. Each function must have a unique signature, otherwise the compiler will not be able to differentiate between them.

How do you change a function's signature?

To change a function's signature, you must change either the function name, return type, or parameters. It is important to note that changing the function signature will also require changes to any code that calls that function.

Back
Top