ayyyy boy
I got a nice lil problem for ya here
I'm trying to compute https://projecteuler.net/problem=572
and i did a naive solution just to grasp the problem (pic related). Now I am going to try to optimize it. I'm planning on limiting the space of potential matrices by using the fact that for an idempotent matrix A, tr(A) = rank(A), and since the rank(A) is between 0 and 3, I would solve the diophantine equation x11+x22+x33 = [0,3], thus limiting my potential solution pool.
Any other ideas?
>other ideas
write them out by hand
>>9098918
Rank can't be three unless the matrix is the identity. The matrix is singular or the identity.
>>9098918
>https://projecteuler.net/problem=572
I would just look at how other people solved it. If you don't know already, their solutions will teach you.
bump for interest.
Rank zero can easily be handled. rank 1 will simplify the problem down to 5 variables or so, I think.
roughly
a b c
k*a k*b k*c
j*a j*b j*c
maybe Groebner basis stufff would help? I'm sure there is a trick though. There always is with these Euler problems.
>>9098918
Do your own fucking homework.
>>9098918
Groebner basis of course won't help at all since we are not working in R or C. We are looking for projections. What is a projection? It has only eigenvalues 1 or 0 and always a trivial jordan decomposition ( diagonalizable ).
so the possible eigenvalues are all combinations of 0 and 1. (0,0,0),(1,0,0),(1,1,0),(1,1,1)
You can extend the trace idea if you know this newton identity sum of diagonal elements power k is the sum of k powered eigenvalues, so for exponent 2 should give the same since 1^k and 0^k neither change with k > 0.
>>9099540
The zero matrix is the only solution in the rank 0 case. The identity is the only solution in the rank 3 case. If A is idempotent, then so is I-A, and 3-trace(A)=trace(I-A), so there are the same number of rank 1 and rank 2 solutions. So we are left with counting the rank 1 solutions.
We can assume A = u v' where u and v are 3 by 1 vectors. Then A*A=A tells us v' u = 1.
I think you can argue that u and v must be just integers. That and the bounds on the elements may be enough.