473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Determinant of Large Matrix

Hello All,

I'm using numpy to calculate determinants of matrices that look like
this (13x13):

[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.]
[ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4. 1. 4. 1. 4.]
[ 1. 4. 1. 0. 9. 1. 4. 4. 9. 1. 4. 1. 4. 1.]
[ 1. 1. 4. 9. 0. 4. 4. 4. 1. 4. 1. 9. 4. 9.]
[ 1. 9. 4. 1. 4. 0. 4. 4. 9. 4. 1. 1. 4. 1.]
[ 1. 4. 9. 4. 4. 4. 0. 1. 1. 1. 9. 1. 9. 4.]
[ 1. 4. 9. 4. 4. 4. 1. 0. 4. 1. 9. 4. 4. 1.]
[ 1. 1. 4. 9. 1. 9. 1. 4. 0. 4. 4. 4. 4. 9.]
[ 1. 1. 4. 1. 4. 4. 1. 1. 4. 0. 9. 4. 9. 4.]
[ 1. 4. 1. 4. 1. 1. 9. 9. 4. 9. 0. 4. 1. 4.]
[ 1. 9. 4. 1. 9. 1. 1. 4. 4. 4. 4. 0. 4. 1.]
[ 1. 4. 1. 4. 4. 4. 9. 4. 4. 9. 1. 4. 0. 1.]
[ 1. 9. 4. 1. 9. 1. 4. 1. 9. 4. 4. 1. 1. 0.]]

For this matrix, I'm getting this with numpy:

2774532095.9999971

But I have a feeling I'm exceeding the capacity of floats here. Does
anyone have an idea for how to treat this? Is it absurd to think I could
get a determinant of this matrix? Is there a python package that could
help me?

Many thanks for any answers.

James
Jun 6 '07 #1
14 7069

On 6 jun 2007, at 13.10, James Stroud wrote:
Hello All,

I'm using numpy to calculate determinants of matrices that look like
this (13x13):

[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.]
[ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4. 1. 4. 1. 4.]
[ 1. 4. 1. 0. 9. 1. 4. 4. 9. 1. 4. 1. 4. 1.]
[ 1. 1. 4. 9. 0. 4. 4. 4. 1. 4. 1. 9. 4. 9.]
[ 1. 9. 4. 1. 4. 0. 4. 4. 9. 4. 1. 1. 4. 1.]
[ 1. 4. 9. 4. 4. 4. 0. 1. 1. 1. 9. 1. 9. 4.]
[ 1. 4. 9. 4. 4. 4. 1. 0. 4. 1. 9. 4. 4. 1.]
[ 1. 1. 4. 9. 1. 9. 1. 4. 0. 4. 4. 4. 4. 9.]
[ 1. 1. 4. 1. 4. 4. 1. 1. 4. 0. 9. 4. 9. 4.]
[ 1. 4. 1. 4. 1. 1. 9. 9. 4. 9. 0. 4. 1. 4.]
[ 1. 9. 4. 1. 9. 1. 1. 4. 4. 4. 4. 0. 4. 1.]
[ 1. 4. 1. 4. 4. 4. 9. 4. 4. 9. 1. 4. 0. 1.]
[ 1. 9. 4. 1. 9. 1. 4. 1. 9. 4. 4. 1. 1. 0.]]

For this matrix, I'm getting this with numpy:

2774532095.9999971

But I have a feeling I'm exceeding the capacity of floats here. Does
anyone have an idea for how to treat this? Is it absurd to think I
could
get a determinant of this matrix? Is there a python package that could
help me?

Many thanks for any answers.

James
--
http://mail.python.org/mailman/listinfo/python-list
Are you sure NumPy return float results. As far as I know, it
returns doubles
(about 16 digits)
------------------------------------------------------
"Home is not where you are born, but where your heart finds peace" -
Tommy Nordgren, "The dying old crone"
to************@comhem.se
Jun 6 '07 #2

James Stroud je napisao/la:
Hello All,

I'm using numpy to calculate determinants of matrices that look like
this (13x13):

[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.]
[ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4. 1. 4. 1. 4.]
[ 1. 4. 1. 0. 9. 1. 4. 4. 9. 1. 4. 1. 4. 1.]
[ 1. 1. 4. 9. 0. 4. 4. 4. 1. 4. 1. 9. 4. 9.]
[ 1. 9. 4. 1. 4. 0. 4. 4. 9. 4. 1. 1. 4. 1.]
[ 1. 4. 9. 4. 4. 4. 0. 1. 1. 1. 9. 1. 9. 4.]
[ 1. 4. 9. 4. 4. 4. 1. 0. 4. 1. 9. 4. 4. 1.]
[ 1. 1. 4. 9. 1. 9. 1. 4. 0. 4. 4. 4. 4. 9.]
[ 1. 1. 4. 1. 4. 4. 1. 1. 4. 0. 9. 4. 9. 4.]
[ 1. 4. 1. 4. 1. 1. 9. 9. 4. 9. 0. 4. 1. 4.]
[ 1. 9. 4. 1. 9. 1. 1. 4. 4. 4. 4. 0. 4. 1.]
[ 1. 4. 1. 4. 4. 4. 9. 4. 4. 9. 1. 4. 0. 1.]
[ 1. 9. 4. 1. 9. 1. 4. 1. 9. 4. 4. 1. 1. 0.]]

For this matrix, I'm getting this with numpy:

2774532095.9999971

But I have a feeling I'm exceeding the capacity of floats here. Does
anyone have an idea for how to treat this? Is it absurd to think I could
get a determinant of this matrix? Is there a python package that could
help me?

Many thanks for any answers.

James
have you tried using matlab to verify the result? matlab is very fast
and can work with large matrices, so this should be no problem for
it...

Jun 6 '07 #3
On Jun 6, 6:47 am, Tommy Nordgren <tommy.nordg...@comhem.sewrote:
On 6 jun 2007, at 13.10, James Stroud wrote:
Hello All,
I'm using numpy to calculate determinants of matrices that look like
this (13x13):
[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.]
[ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4. 1. 4. 1. 4.]
[ 1. 4. 1. 0. 9. 1. 4. 4. 9. 1. 4. 1. 4. 1.]
[ 1. 1. 4. 9. 0. 4. 4. 4. 1. 4. 1. 9. 4. 9.]
[ 1. 9. 4. 1. 4. 0. 4. 4. 9. 4. 1. 1. 4. 1.]
[ 1. 4. 9. 4. 4. 4. 0. 1. 1. 1. 9. 1. 9. 4.]
[ 1. 4. 9. 4. 4. 4. 1. 0. 4. 1. 9. 4. 4. 1.]
[ 1. 1. 4. 9. 1. 9. 1. 4. 0. 4. 4. 4. 4. 9.]
[ 1. 1. 4. 1. 4. 4. 1. 1. 4. 0. 9. 4. 9. 4.]
[ 1. 4. 1. 4. 1. 1. 9. 9. 4. 9. 0. 4. 1. 4.]
[ 1. 9. 4. 1. 9. 1. 1. 4. 4. 4. 4. 0. 4. 1.]
[ 1. 4. 1. 4. 4. 4. 9. 4. 4. 9. 1. 4. 0. 1.]
[ 1. 9. 4. 1. 9. 1. 4. 1. 9. 4. 4. 1. 1. 0.]]
For this matrix, I'm getting this with numpy:
2774532095.9999971
But I have a feeling I'm exceeding the capacity of floats here. Does
anyone have an idea for how to treat this? Is it absurd to think I
could
get a determinant of this matrix? Is there a python package that could
help me?
Many thanks for any answers.
James
--
http://mail.python.org/mailman/listinfo/python-list

Are you sure NumPy return float results. As far as I know, it
returns doubles
I don't know about NumPy, but in general, a python float is a double:
http://docs.python.org/lib/typesnumeric.html
"Floating point numbers are implemented using double in C. All bets on
their precision are off unless you happen to know the machine you are
working with."
(about 16 digits)
------------------------------------------------------
"Home is not where you are born, but where your heart finds peace" -
Tommy Nordgren, "The dying old crone"
tommy.nordg...@comhem.se

Jun 6 '07 #4
James Stroud wrote:
Hello All,

I'm using numpy to calculate determinants of matrices that look like
this (13x13):

[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[snip]
But I have a feeling I'm exceeding the capacity of floats here. Does
anyone have an idea for how to treat this? Is it absurd to think I could
get a determinant of this matrix? Is there a python package that could
help me?

Many thanks for any answers.

James
in order to verify that this result is correct, you could get the
eigenvector and eigenvalues of this matrix (for example with
numpy.linalg.eig) and check that they make sense; the determinant simply
is the product of all the eigenvalues.

gd luck
Jun 6 '07 #5
James Stroud wrote:
Hello All,

I'm using numpy to calculate determinants of matrices that look like
this (13x13):

[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.]
[ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4. 1. 4. 1. 4.]
[ 1. 4. 1. 0. 9. 1. 4. 4. 9. 1. 4. 1. 4. 1.]
[ 1. 1. 4. 9. 0. 4. 4. 4. 1. 4. 1. 9. 4. 9.]
[ 1. 9. 4. 1. 4. 0. 4. 4. 9. 4. 1. 1. 4. 1.]
[ 1. 4. 9. 4. 4. 4. 0. 1. 1. 1. 9. 1. 9. 4.]
[ 1. 4. 9. 4. 4. 4. 1. 0. 4. 1. 9. 4. 4. 1.]
[ 1. 1. 4. 9. 1. 9. 1. 4. 0. 4. 4. 4. 4. 9.]
[ 1. 1. 4. 1. 4. 4. 1. 1. 4. 0. 9. 4. 9. 4.]
[ 1. 4. 1. 4. 1. 1. 9. 9. 4. 9. 0. 4. 1. 4.]
[ 1. 9. 4. 1. 9. 1. 1. 4. 4. 4. 4. 0. 4. 1.]
[ 1. 4. 1. 4. 4. 4. 9. 4. 4. 9. 1. 4. 0. 1.]
[ 1. 9. 4. 1. 9. 1. 4. 1. 9. 4. 4. 1. 1. 0.]]

For this matrix, I'm getting this with numpy:

2774532095.9999971

But I have a feeling I'm exceeding the capacity of floats here.
It's not that you're exceeding the capacity of float64 numbers, it's just that
there are floating point calculations taking place. The way the determinant is
calculated is by doing an LU decomposition and then multiplying down the
diagonal. Although all of your entries started as integers, floating point error
does accumulate. The answer that you got is within finfo(float64).eps of
relative error of the actual answer.
Does
anyone have an idea for how to treat this? Is it absurd to think I could
get a determinant of this matrix? Is there a python package that could
help me?
If all of your matrices are going to be integers, doing the
determinant-by-minors calculations yourself is probably easy enough to code and
will retain complete precision.

http://mathworld.wolfram.com/Determi...nbyMinors.html

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Jun 6 '07 #6
James Stroud wrote:
I'm using numpy to calculate determinants of matrices that look like
this (13x13):

[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.]
[ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4. 1. 4. 1. 4.]
[ 1. 4. 1. 0. 9. 1. 4. 4. 9. 1. 4. 1. 4. 1.]
[ 1. 1. 4. 9. 0. 4. 4. 4. 1. 4. 1. 9. 4. 9.]
[ 1. 9. 4. 1. 4. 0. 4. 4. 9. 4. 1. 1. 4. 1.]
[ 1. 4. 9. 4. 4. 4. 0. 1. 1. 1. 9. 1. 9. 4.]
[ 1. 4. 9. 4. 4. 4. 1. 0. 4. 1. 9. 4. 4. 1.]
[ 1. 1. 4. 9. 1. 9. 1. 4. 0. 4. 4. 4. 4. 9.]
[ 1. 1. 4. 1. 4. 4. 1. 1. 4. 0. 9. 4. 9. 4.]
[ 1. 4. 1. 4. 1. 1. 9. 9. 4. 9. 0. 4. 1. 4.]
[ 1. 9. 4. 1. 9. 1. 1. 4. 4. 4. 4. 0. 4. 1.]
[ 1. 4. 1. 4. 4. 4. 9. 4. 4. 9. 1. 4. 0. 1.]
[ 1. 9. 4. 1. 9. 1. 4. 1. 9. 4. 4. 1. 1. 0.]]

For this matrix, I'm getting this with numpy:

2774532095.9999971

But I have a feeling I'm exceeding the capacity of floats here. Does
anyone have an idea for how to treat this? Is it absurd to think I could
get a determinant of this matrix? Is there a python package that could
help me?
Here's some anecdotal evidence that your result may be correct:

import operator

m = eval("""[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.]
[ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4. 1. 4. 1. 4.]
[ 1. 4. 1. 0. 9. 1. 4. 4. 9. 1. 4. 1. 4. 1.]
[ 1. 1. 4. 9. 0. 4. 4. 4. 1. 4. 1. 9. 4. 9.]
[ 1. 9. 4. 1. 4. 0. 4. 4. 9. 4. 1. 1. 4. 1.]
[ 1. 4. 9. 4. 4. 4. 0. 1. 1. 1. 9. 1. 9. 4.]
[ 1. 4. 9. 4. 4. 4. 1. 0. 4. 1. 9. 4. 4. 1.]
[ 1. 1. 4. 9. 1. 9. 1. 4. 0. 4. 4. 4. 4. 9.]
[ 1. 1. 4. 1. 4. 4. 1. 1. 4. 0. 9. 4. 9. 4.]
[ 1. 4. 1. 4. 1. 1. 9. 9. 4. 9. 0. 4. 1. 4.]
[ 1. 9. 4. 1. 9. 1. 1. 4. 4. 4. 4. 0. 4. 1.]
[ 1. 4. 1. 4. 4. 4. 9. 4. 4. 9. 1. 4. 0. 1.]
[ 1. 9. 4. 1. 9. 1. 4. 1. 9. 4. 4. 1. 1. 0.]]""".replace(".",
".,").replace("]", "],"))[0]

M = [[int(x) for x in row] for row in m]

def subdet(m, rowindex):
return [row[1:] for index, row in enumerate(m) if index != rowindex]

def det(m):
if len(m) == 1:
return m[0][0]
sign = 1
sigma = 0
for index, row in enumerate(m):
x = row[0]
if x:
sigma += sign * x * det(subdet(m, index))
sign = -sign
return sigma

def common_multiple(items):
items = set(items)
items.discard(0)
if items:
return reduce(operator.mul, items)
else:
return 0

def det3(m, switch_algo=8):
p = 1
q = 1
while 1:
if len(m) == switch_algo:
a, b = divmod(p*det(m), q)
assert b == 0
return a
cm = common_multiple(row[0] for row in m)
if cm == 0: return 0

sign = 1
e = enumerate(m)
for first_index, first_row in e:
if first_row[0]:
f = cm // first_row[0]
assert (cm % first_row[0]) == 0
p *= sign * cm
q *= f
first_row[:] = [f*x for x in first_row[1:]]
break
first_row[:] = first_row[1:]
sign = -sign
for index, row in e:
if row[0]:
f = cm // row[0]
assert (cm % row[0]) == 0
q *= f
row[:] = [f*x - fx for x, fx in zip(row[1:], first_row)]
else:
row[:] = row[1:]
del m[first_index]

if __name__ == "__main__":
import pprint
pprint.pprint(M)
result = det3(M)
assert result == 2774532096
print "det(M) =", result

As I use only integers, any errors should be algorithmic rather than caused
by rounding.

Peter
Jun 6 '07 #7
James Stroud wrote:
For this matrix, I'm getting this with numpy:

2774532095.9999971

But I have a feeling I'm exceeding the capacity of floats here.
Does anyone have an idea for how to treat this?
Not if you don't state your requirements more precisely. E. g. what
precision do you need?
Is it absurd to think I could get a determinant of this matrix?
Absolutely not.
Is there a python package that could help me?
Help doing what?

BTW, scilab says this:

-->det(A)
ans =

2.7745320960000E+09

-->ans-2774532095.9999971
ans =

2.8610229492188E-06

-->

The error is 15 magnitudes below your result -- what do you want
more? :)

Regards,
Björn

P.S.:
>>print 2774532095.9999971
2774532096.0
>>>
--
BOFH excuse #118:

the router thinks its a printer.

Jun 6 '07 #8
On Wed, 06 Jun 2007 04:10:43 -0700, James Stroud wrote:
Hello All,

I'm using numpy to calculate determinants of matrices that look like
this (13x13):
[snip matrix]
For this matrix, I'm getting this with numpy:

2774532095.9999971

But I have a feeling I'm exceeding the capacity of floats here. Does
anyone have an idea for how to treat this? Is it absurd to think I could
get a determinant of this matrix? Is there a python package that could
help me?
Is there a particular reason you think there is a problem? The determinant
given is pretty close to the integer 2774532096. Assuming that is the
correct value, the difference between:

2.7745320960000000e9 and
2.7745320959999971e9

gives a relative error of 1.0311731312618234e-13 percent. How much
precision were you after? :-)

I suspect that if there is a problem with the matrix, it is less likely
to be because of the size of floats and more likely that the matrix is
ill-conditioned.

I don't know if numpy will calculate the condition number of the matrix,
or estimate it. If it does, do so -- a large condition number == trouble.

http://en.wikipedia.org/wiki/Condition_number

Another way to see if the matrix is ill-conditioned is to make a small
perturbation to it (say, change two or three of the entries by 0.0001 or
so), then calculate the determinate. If the result is radically different,
then the matrix is probably ill-conditioned and there is likely no help
for you except numerical black magic and/or using a different matrix.
--
Steven.

Jun 7 '07 #9
Hello,

Thank you to those who responded for your answers. They were very
helpful and I'm confident now that numpy is calculating accurate
determinants for these matrices.

But I think I need to restate my problem a little as suggested by some
becuase I'm still bewildered.

First, here is the relevant part of my code:

# start of code

def main(word, repeats, trials):
encodings = encode(word, CODE)
random.shuffle(encodings)
values = []
pb = PB(tk.Tk())
for i in xrange(trials):
if i % 100 == 0:
pb.update(float(i)/trials)
random.seed()
encodings = random.sample(encodings, repeats)
distmat = build_distmat(encodings)
print
print distmat
values.append(det(distmat))
values.sort()
# print values
print set(values)

# end of code

Here are some notes about the code:

1. PB is a progress bar because this takes a while for a lot of trials.
2. encodings is a complete list equivalent encodings of word.
3. distmat is a representation of the distances between the sample as
integers for purposes of calculating the "content" of the hyperspace
defined by this pairwise distance matrix (Cayley-Menger determinant).
4. det is numpy.linalg.det

I get fairly unintuitive results, because if I run it once for 10 (or
1000 or 100,000) the set of values are all essentially the same:

set([-733163520.00005591, -733163520.00004566, -733163519.99998546,
-733163520.00002789, -733163519.99999189, -733163519.9999783,
-733163519.9999758, -733163520.00002348, -733163519.99996936,
-733163520.00004542])

If I run it again on 10 (or 1000) the set is basically homogenous but
now of different values (terribly confusing):

set([12048175104.00001, 12048175104.000015, 12048175104.000046,
12048175103.999994, 12048175104.000023, 12048175103.999981,
12048175103.999998, 12048175103.99999])

How could this be? This holds for 10 trials or 100000 trials. Below is
the output from the above runs.

Is this a problem with the rng? All of these matrices look different.
I'm certain this can't happen by chance.

Thank you again.

James
euler 70% ./simplex.py

[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 4. 9. 9. 4. 4. 9. 9. 1. 9. 16. 9. 9.]
[ 1. 4. 0. 9. 9. 4. 4. 16. 16. 4. 9. 9. 1. 4.]
[ 1. 9. 9. 0. 9. 9. 16. 4. 4. 16. 9. 1. 4. 4.]
[ 1. 9. 9. 9. 0. 16. 4. 4. 9. 9. 9. 9. 4. 9.]
[ 1. 4. 4. 9. 16. 0. 9. 4. 4. 4. 4. 9. 9. 4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 4. 9. 1. 9. 9. 16. 9. 4. 4. 9. 4. 16. 0.]]
set([31247376384.000099, 31247376384.000187, 31247376384.000217,
31247376383.99992, 31247376384.000214, 31247376383.999863,
31247376384.000294, 31247376383.999889, 31247376384.000324,
31247376383.999947])
euler 71% ./simplex.py

[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 9. 9. 4. 9. 9. 9. 1. 4. 4. 1. 4. 1.]
[ 1. 9. 0. 16. 4. 9. 4. 16. 9. 16. 9. 16. 4. 9.]
[ 1. 9. 16. 0. 4. 1. 9. 4. 9. 4. 1. 4. 9. 4.]
[ 1. 4. 4. 4. 0. 1. 16. 9. 4. 9. 1. 9. 9. 1.]
[ 1. 9. 9. 1. 1. 0. 9. 4. 9. 4. 4. 4. 16. 4.]
[ 1. 9. 4. 9. 16. 9. 0. 9. 16. 9. 16. 4. 9. 9.]
[ 1. 9. 16. 4. 9. 4. 9. 0. 4. 1. 9. 4. 16. 9.]
[ 1. 1. 9. 9. 4. 9. 16. 4. 0. 1. 4. 4. 4. 4.]
[ 1. 4. 16. 4. 9. 4. 9. 1. 1. 0. 9. 1. 9. 9.]
[ 1. 4. 9. 1. 1. 4. 16. 9. 4. 9. 0. 9. 4. 1.]
[ 1. 1. 16. 4. 9. 4. 4. 4. 4. 1. 9. 0. 9. 4.]
[ 1. 4. 4. 9. 9. 16. 9. 16. 4. 9. 4. 9. 0. 9.]
[ 1. 1. 9. 4. 1. 4. 9. 9. 4. 9. 1. 4. 9. 0.]]

[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 9. 1. 9. 4. 1. 4. 4. 9. 9. 9. 1. 4.]
[ 1. 9. 0. 4. 4. 9. 9. 4. 16. 9. 9. 16. 4. 9.]
[ 1. 1. 4. 0. 9. 9. 1. 4. 4. 16. 9. 9. 4. 1.]
[ 1. 9. 4. 9. 0. 16. 4. 9. 9. 4. 16. 16. 9. 16.]
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]
[ 1. 9. 9. 4. 0. 4. 9. 4. 4. 16. 4. 1. 4. 1.]
[ 1. 9. 4. 16. 4. 0. 16. 9. 9. 9. 9. 9. 4. 4.]
[ 1. 1. 9. 4. 9. 16. 0. 4. 4. 9. 1. 4. 4. 9.]
[ 1. 4. 16. 4. 4. 9. 4. 0. 4. 4. 9. 1. 9. 1.]
[ 1. 4. 9. 9. 4. 9. 4. 4. 0. 9. 1. 9. 1. 1.]
[ 1. 9. 4. 9. 16. 9. 9. 4. 9. 0. 16. 9. 16. 9.]
[ 1. 4. 4. 9. 4. 9. 1. 9. 1. 16. 0. 9. 1. 4.]
[ 1. 4. 16. 1. 1. 9. 4. 1. 9. 9. 9. 0. 9. 4.]
[ 1. 1. 9. 9. 4. 4. 4. 9. 1. 16. 1. 9. 0. 4.]
[ 1. 9. 9. 9. 1. 4. 9. 1. 1. 9. 4. 4. 4. 0.]]
set([-167037108224.00009, -167037108224.00006, -167037108223.99988,
-167037108223.99979, -167037108223.99997, -167037108224.00003])
Jun 7 '07 #10
Steven D'Aprano wrote:
[Valuable Response]

Thank you Steven for your helpful comments. Please see my reply to
Bjoern Schliessmann where I have restated my problem.

James
Jun 7 '07 #11
James Stroud wrote:
[pointless stuff]

OK. Nevermind. I'm rebinding encodings and so taking a sample from the
sample and thus getting the sample back. Terribly sorry.

James
Jun 7 '07 #12
James Stroud wrote:
If I run it again on 10 (or 1000) the set is basically homogenous
but now of different values (terribly confusing):

set([12048175104.00001, 12048175104.000015, 12048175104.000046,
12048175103.999994, 12048175104.000023, 12048175103.999981,
12048175103.999998, 12048175103.99999])
As you seem to have overread it: Note that Python only prints those
numbers with full "bogus" precision since you let it display them
using repr() (it's used in lists by default for display). If you
use str() explicitly, Python applies rounding:
>>A
[12048175104.00001, 12048175104.000015, 12048175104.000046,
12048175103.999994, 12048175104.000023, 12048175103.999981,
12048175103.999994, 12048175104.000023, 12048175103.999981,
12048175103.999998, 12048175103.99999]
>>[repr(i) for i in A]
['12048175104.00001', '12048175104.000015', '12048175104.000046',
'12048175103.999994', '12048175104.000023', '12048175103.999981',
'12048175103.999994', '12048175104.000023', '12048175103.999981',
'12048175103.999998', '12048175103.99999']
>>[str(i) for i in A]
['12048175104.0', '12048175104.0', '12048175104.0', '12048175104.0',
'12048175104.0', '12048175104.0', '12048175104.0', '12048175104.0',
'12048175104.0', '12048175104.0', '12048175104.0']
>>>
Regards,
Björn

--
BOFH excuse #83:

Support staff hung over, send aspirin and come back LATER.

Jun 7 '07 #13
Hi James

Mathematica says that the determinant of the integer version of this
matrix is 2774532096, which is another vote for the answer you have.

Mathematica says that the determinant of the 24-digit real version of
your matrix is 2.774532096*10^9, which looks very similar to me.

I'd go with Numpy.

Regards

Mark Westwood
PS 13x13 isn't a large matrix !
On Jun 6, 12:10 pm, James Stroud <jstr...@mbi.ucla.eduwrote:
Hello All,

I'm using numpy to calculate determinants of matrices that look like
this (13x13):

[[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.]
[ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4. 1. 4. 1. 4.]
[ 1. 4. 1. 0. 9. 1. 4. 4. 9. 1. 4. 1. 4. 1.]
[ 1. 1. 4. 9. 0. 4. 4. 4. 1. 4. 1. 9. 4. 9.]
[ 1. 9. 4. 1. 4. 0. 4. 4. 9. 4. 1. 1. 4. 1.]
[ 1. 4. 9. 4. 4. 4. 0. 1. 1. 1. 9. 1. 9. 4.]
[ 1. 4. 9. 4. 4. 4. 1. 0. 4. 1. 9. 4. 4. 1.]
[ 1. 1. 4. 9. 1. 9. 1. 4. 0. 4. 4. 4. 4. 9.]
[ 1. 1. 4. 1. 4. 4. 1. 1. 4. 0. 9. 4. 9. 4.]
[ 1. 4. 1. 4. 1. 1. 9. 9. 4. 9. 0. 4. 1. 4.]
[ 1. 9. 4. 1. 9. 1. 1. 4. 4. 4. 4. 0. 4. 1.]
[ 1. 4. 1. 4. 4. 4. 9. 4. 4. 9. 1. 4. 0. 1.]
[ 1. 9. 4. 1. 9. 1. 4. 1. 9. 4. 4. 1. 1. 0.]]

For this matrix, I'm getting this with numpy:

2774532095.9999971

But I have a feeling I'm exceeding the capacity of floats here. Does
anyone have an idea for how to treat this? Is it absurd to think I could
get a determinant of this matrix? Is there a python package that could
help me?

Many thanks for any answers.

James

Jun 7 '07 #14
"James Stroud" <j,,,,@mbi....a.eduwrote:
James Stroud wrote:
[pointless stuff]

OK. Nevermind. I'm rebinding encodings and so taking a sample from the
sample and thus getting the sample back. Terribly sorry.
There is truly nothing to be sorry about.
It takes guts to come right out and say that you made a mistake.
Well done!

<start rant>
One of my pet peeves are people who pretend that they never make mistakes.
Strangely enough, when you ask them to walk on water, they never quite
manage it.

This sort of thing should be cause for rejoicing, - when you think about it,
its a proof that the body of knowledge that has to do with sampling is
solid and reliable, independently of the experimenter - these days that is
quite a comforting thought.

The sanitised stuff you read in the scientific journals does not represent
the true course of the progress of science - in reality, progress is the
incidental by-product of a progressive series of blunders. But nobody
involved will acknowledge this, for fear of their precious reputations...

<end rant>

- Hendrik

Jun 8 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: raj | last post by:
Hi, I saw it mentioned that "int" is the fastest data-type for use in C ,that is data storage/retrieval would be the fastest if I use int among the following 4 situations in a 32 bit machine with...
4
by: Tuvas | last post by:
I am trying to find a nice function that quickly determines the determanant in python. Anyone have any recommendations? I've heard about numpy, but I can't get it to work (It doesn't seem to like...
2
by: aruna | last post by:
i want a c program to find the determinant of matrix and inverse of matrix as two separate c programs . please help me
1
by: naren | last post by:
can anyone help with the code for determinant,cofactor and inverse of a matrix in c++ lang? i am not getting the logic.....
1
by: avdhoot | last post by:
Hi Everybody, I am doing some project in VB6 where I ahve to calculate the Determinant of the matrix. I have got a function MDETERM but not able to pass on the parameters of the matrix and get the...
2
by: pvsgangadhar | last post by:
I need the program in c-langauge to find the determinant of a matrix for specified no.or rows and columns.
29
by: curiously enough | last post by:
I am having trouble making this recursive C function work for square matrices of size greater than 3 rows and columns. #include<stdio.h> #include<conio.h> #include<math.h> int M; float...
1
by: haderika | last post by:
Hey, I'm having trouble overloading the ~ operator (the determinant of the matrix) in a case of 2x2 matrices. So i have a matrix class, with the constructor, overloading +, += and ~ operators. the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.