Introduction to Representation Theory Discussions | Mathematics | HackerRank
We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It appears that I'm the only one that has solved this problem using C, atleast according to the leaderboard. Basically it is just to implement an inverse discrete fourier transform (as kogoro_akechi suggest and quite nicely ) and since the parameter limits are not that severe m<=2000 you can get away with a naive implementation (as kogoro_akechi has in his solution) wich has timecomplexity O(m^2) in all cases. I thought that was booring and decide, since it is an advanced problem, to implement a generalized fast fourier transform that exploits the periodicity of the exp(2pi*l*t/k) to reduce the computational complexity to O(m*log(m)) in best case and O(m*m) in the worst case (which is if m is a prime number). Here after follow my C implementation:
Essentially, this is more about finite Fourier transforms (although you could argue that this counts as representation theory of finite abelian groups).
Our matrix fulfils the identity A^k = 1. Therefore all eigenvalues must fulfill this equation as well.
We conclude the eigenvalues are of the form exp(2pi*I*t/k) where t goes from 0 to k-1 and I is the imaginary unit. Say the eigenvalue exp(2pi*I*t/k) has multiplicity a_t.
The trace of a matrix is the sum of all its eigenvalues, and taking powers of a matrix has the effect that the eigenvalues are taken to this power as well.
So, A^j has the eigenvalue exp(2pi*I*j*t/k) with multiplicity a_t and its trace is:
tr(A^j) = sum (t = 0 to k-1) a_t * exp(2pi*I*j*t/k)
This is actually just the discrete Fourier transform of the function taking t to a_t.
Therefore, we want the inverse Fourier transform of the function taking j to tr(A^j). Call the latter f_j.
The inverse transform is given by:
a_t = 1/k * sum (t = 0 to k-1) f_j * exp(-2pi*I*j*t/k).
I know that a_t is an integer, so I just calculate the real part of this sum and do some rounding with this result. Furthermore, I modded out k from j*t - the result of exp(...) is the same but errors due to big arguments are less probable to occur.
Then I print the eigenvalue exp(2pi*I*t/k) simply a_j times (my code calculates the occurrences of exp(-2pi*I*t/k) but this just reverses the order of the eigenvalues).
By the way - the number n is not needed for the calculations.
I've been thinking about this problem for a while and I don't really know how to start. I've been trying the 'hard way' because I don't know anything about representation theory... Can anyone give me a hint or some reading material about representation theory that could help me? Thanks!
No more comments
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
It appears that I'm the only one that has solved this problem using C, atleast according to the leaderboard. Basically it is just to implement an inverse discrete fourier transform (as kogoro_akechi suggest and quite nicely ) and since the parameter limits are not that severe m<=2000 you can get away with a naive implementation (as kogoro_akechi has in his solution) wich has timecomplexity O(m^2) in all cases. I thought that was booring and decide, since it is an advanced problem, to implement a generalized fast fourier transform that exploits the periodicity of the exp(2pi*l*t/k) to reduce the computational complexity to O(m*log(m)) in best case and O(m*m) in the worst case (which is if m is a prime number). Here after follow my C implementation:
Essentially, this is more about finite Fourier transforms (although you could argue that this counts as representation theory of finite abelian groups).
Our matrix fulfils the identity A^k = 1. Therefore all eigenvalues must fulfill this equation as well.
We conclude the eigenvalues are of the form exp(2pi*I*t/k) where t goes from 0 to k-1 and I is the imaginary unit. Say the eigenvalue exp(2pi*I*t/k) has multiplicity a_t.
The trace of a matrix is the sum of all its eigenvalues, and taking powers of a matrix has the effect that the eigenvalues are taken to this power as well.
So, A^j has the eigenvalue exp(2pi*I*j*t/k) with multiplicity a_t and its trace is:
tr(A^j) = sum (t = 0 to k-1) a_t * exp(2pi*I*j*t/k)
This is actually just the discrete Fourier transform of the function taking t to a_t. Therefore, we want the inverse Fourier transform of the function taking j to tr(A^j). Call the latter f_j.
The inverse transform is given by:
a_t = 1/k * sum (t = 0 to k-1) f_j * exp(-2pi*I*j*t/k).
I know that a_t is an integer, so I just calculate the real part of this sum and do some rounding with this result. Furthermore, I modded out k from j*t - the result of exp(...) is the same but errors due to big arguments are less probable to occur.
Then I print the eigenvalue exp(2pi*I*t/k) simply a_j times (my code calculates the occurrences of exp(-2pi*I*t/k) but this just reverses the order of the eigenvalues).
By the way - the number n is not needed for the calculations.
Here is my code:
I've been thinking about this problem for a while and I don't really know how to start. I've been trying the 'hard way' because I don't know anything about representation theory... Can anyone give me a hint or some reading material about representation theory that could help me? Thanks!