Hi,
On Tuesday 03 Jul 2012, Simon King wrote:
> Hi!
>
> On 2012-07-02, Martin Albrecht wrote:
> > Shouldn't both give the same distribution mod p? Since every non-singular
> > matrix A has a LU decomposition we should be able to just sample L and U
> > separately to produce A?
>
> Sorry for my ignorance, but is it really the case that an LU
> decomposition exists for all invertible matrices? I thought there may
> only be an LUP decomposition.
Argh, yes, you're right: should be LUP.
> If I am not mistaken, the LU decomposition is unique if one requires
> that L (or U) has only 1 on the diagonal. Because of the uniqueness, I'd
> expect that putting 1 on the diagonal of L and choosing the entries of U
> and the remaining of L randomly equally distributed yields a reasonable
> distribution of invertible matrices.
>
> However, if it is really the case that we must consider LUP
> decompositions, then I am not totally convinced that a nicely distributed
> random choice of a permutation matrix P on top of the choice of L and U as
> above yields a nice distribution of invertible matrices.
Mhh, why not? If A = LUP we just write AP^-1 = LU, hence for each LU we
construct there are as many As as there are permutation matrices, or am I
missing something (again :))?
Cheers,
Martin
> Mhh, why not? If A = LUP we just write AP^-1 = LU, hence for each LU we
> construct there are as many As as there are permutation matrices, or am I
> missing something (again :))?
I am not sure that the LUP decomposition is unique (I understand that
the LU is).
On Tuesday, 3 July 2012 09:56:04 UTC+8, Charles Bouillaguet wrote:> Mhh, why not? If A = LUP we just write AP^-1 = LU, hence for each LU we
> construct there are as many As as there are permutation matrices, or am I
> missing something (again :))?
I am not sure that the LUP decomposition is unique (I understand that
the LU is).An invertible matrix need not have an LU decomposition. E.g. A=[[0,1],[1,1]] does not have it.It's evident over F_2: L can only take 2 values, and U can only take 2 values, so you can't havemore than 4 different matrices of the form LU :–)
On Tuesday, 3 July 2012 10:36:37 UTC+8, Dima Pasechnik wrote:
On Tuesday, 3 July 2012 09:56:04 UTC+8, Charles Bouillaguet wrote:> Mhh, why not? If A = LUP we just write AP^-1 = LU, hence for each LU we
> construct there are as many As as there are permutation matrices, or am I
> missing something (again :))?
I am not sure that the LUP decomposition is unique (I understand that
the LU is).An invertible matrix need not have an LU decomposition. E.g. A=[[0,1],[1,1]] does not have it.It's evident over F_2: L can only take 2 values, and U can only take 2 values, so you can't havemore than 4 different matrices of the form LU :–)by the way, for generating random elements it might be better to use the Bruhat decomposition, which is unique. See
I know little of random methods, but do we really need to make things so complicated? As the OP suggests, we might as well just generate matrices uniformly at random and discard if not invertible. The set of invertible matrices is Zariski open, so the probability of hitting a non-invertible matrix should be very small (0 for real or complex matrices, I don't know about finite fields).
well, it's not that small, especially for finite fields. E.g. for F_2 and n=3, one only gets 168 invertible matrices out of 512=2^9 in total...(I can't resist saying that the order of GL(n,q) is (q^n-1)(q^{n-1}-1)...(q^2-1)(q-1))So it's not gonna be very fast, also note that computing the determinant comes at a nonzero cost when matrices are big...
On Tuesday, July 3, 2012 10:53:23 AM UTC+1, Dima Pasechnik wrote:well, it's not that small, especially for finite fields. E.g. for F_2 and n=3, one only gets 168 invertible matrices out of 512=2^9 in total...(I can't resist saying that the order of GL(n,q) is (q^n-1)(q^{n-1}-1)...(q^2-1)(q-1))So it's not gonna be very fast, also note that computing the determinant comes at a nonzero cost when matrices are big...I stand corrected. Even in the worst case scenario (with F_2) it still seems that about one in three matrices is invertible,
so the situation is not too bad. Also, there is no need to compute the determinants, knowing if the rank is full or not is enough.
So my point is: even if not *very* fast, still seems faster than what we have now, and it is very easy to implement while we think of a better solution.
Javier
As far as I can tell all methods need matrix multiplication, so whatever
choice me make the difference will be constant, i.e., how many matrix-matrix
products we need (assuming asymptotically fast techniques were implemented)
You don't have to re-generate the entire matrix, you could likely get
away with changing one random element at a time. (And if you did so,
perhaps computing the rank would be cheaper). Still, +1 to it's much
faster than what we have now and still easy to implement.
You're right, one does want to ensure that there's a high probability
of changing its rank. One could also change O(n) entries (one on each
row/column) rather than all O(n^2). This will have a larger impact for
large fields (where the per-element entropy is high, and GF(2) is a
worst-case as individual-element-setting is expensive). But I suppose
in those cases you're unlikely to hit a non-invertible matrix in the
first place.