>>> The problem is unlikely to be the rank of your contraint
matrix. If you
>>> fill a 9x9 matrix with 36 zeros at random, the probability if it being
>>> singular is zero (it shouldn't be difficult to prove this formally)
>>> although of course the event is not impossible (nice example of an event
>>> with 0 Lebesgue measure).
>>
>> Jack, I don't think this is true, for example the probability of getting
>> a column with all (9) zeros by chance may be small, but certainly not
>> zero if you allocate 36 zeros randomly. If I were good in combinatorics
>> I could give you the exact numbers, but I'm not.
>>
>> Apart from that the constraints are not chosen at random. A line has
>> measure zero in a plane, but still I can pick exactly points on the line.
>>
>> So I'm not saying the matrix is singular, but without further
>> investigation/thinking I cannot rule out that it is.
>
> You're absolutely right, my friend. After all, the number of ways you can
> put n*(n-1)/2 zeros into a square matrix with n rows is finite, and some of
> those do give rise to singular matrices, so yes, it isn't a Lebesgue 0. I
> stand corrected.
I believe Prob(one column is all zeros) = 9 * (1/9)^9 = 2.3e-08
when inserting 9 zeros at random; it would be higher for 36 zeros.

Now _this_ is fun:
<hansl>
set echo off
set messages off
set seed 20140702
function matrix C(scalar n)
/* build a random nxn matrix with
n*(n-1)/2 zeros in random locations
*/
scalar n2 = n*n
scalar m = round((n2 - n)/2)
matrix a = mnormal(n2,1)
matrix e = msortby(mnormal(n2,1) ~ seq(1,n2)', 1)
matrix e = e[1:m,2]
a[e] = 0
return mshape(a, n, n)
end function
function scalar sing_freq(scalar n, scalar repli)
x = 0
loop repli --quiet
matrix a = C(n)
if rank(a) < n
x++
endif
endloop
return x/repli
end function
# --- main -------------------------------------
scalar repli = 5000
loop i=2..9 --quiet
scalar p = sing_freq(i, repli)
printf "%2d: %10.6f\n", i, p
endloop
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------