[sage-support] Re: The matrix function

2012-10-21 Thread E . Mehmet Kıral
Hello. I downloaded sage from the source again. I downloaded the latest version 5.3 and it downloaded without any problem. However I still have a problem importing numpy, and thus using the matrix(2) function I work inside a virtual machine and in there I run ubuntu 12.10. The ram allocated

[sage-support] Re: The matrix function

2012-10-21 Thread Dima Pasechnik
On 2012-10-21, E Mehmet Kıral wrote: > Yes I tried those syntaxes but it doesn't work. > > It seems to be a problem about importing numpy. When I try to import > numpy just alone it gives me the same problem. > > I do have numpy in my spkg. > > I have tried to reload the whole sage, only to retu

[sage-support] Re: The matrix function

2012-10-21 Thread Dima Pasechnik
On 2012-10-21, E Mehmet Kıral wrote: > Hello, > > When I write matrix(2,2,1) or matrix(QQ,3,3,1) I do not get the identitiy > matrix. > > The only way the matrix function works is when I type > matrix() > and it gives me an empty matrix. > > Why is this so? Have I not installed some package c

Re: [sage-support] Re: The matrix function

2012-10-21 Thread E . Mehmet Kıral
Yes I tried those syntaxes but it doesn't work. It seems to be a problem about importing numpy. When I try to import numpy just alone it gives me the same problem. I do have numpy in my spkg. I have tried to reload the whole sage, only to return worse results. Sage wouldn't even build. -- Y

Re: [sage-support] Re: The matrix function

2012-10-21 Thread Martin Albrecht
Guys, the OP's installation is broken: On Sunday 21 Oct 2012, E. Mehmet Kıral wrote: > /home/eren/sage/local/lib/python2.7/site-packages/numpy/lib/polynomial.py > in () 9 import re > 10 import warnings > ---> 11 import numpy.core.numeric as NX > 12 > 13 from numpy.core import isscal

[sage-support] Re: The matrix function

2012-10-21 Thread Johan Grönqvist
2012-10-21 22:24, E. Mehmet Kıral skrev: I understand that for the identity matrix there are other methods. But I do get the same error message for simply matrix(2) which according to the manual matrix?, should give me the 2by2 zero matrix. Or I get the same error when I try to construct a matr

Re: [sage-support] The matrix function

2012-10-21 Thread E . Mehmet Kıral
On Sunday, October 21, 2012 3:40:56 PM UTC-4, David Joyner wrote: > On Sun, Oct 21, 2012 at 3:32 PM, E. Mehmet Kıral wrote: > > > Hello, > > > > > > When I write matrix(2,2,1) or matrix(QQ,3,3,1) I do not get the identitiy > > matrix. > > > > To get the 3x3 identity matrix, type > > > >

Re: [sage-support] The matrix function

2012-10-21 Thread David Joyner
On Sun, Oct 21, 2012 at 3:32 PM, E. Mehmet Kıral wrote: > Hello, > > When I write matrix(2,2,1) or matrix(QQ,3,3,1) I do not get the identitiy > matrix. To get the 3x3 identity matrix, type identity_matrix(3) or MatrixSpace(QQ, 3, 3)(1) There are probably several other ways. Type matrix? f

[sage-support] The matrix function

2012-10-21 Thread E . Mehmet Kıral
Hello, When I write matrix(2,2,1) or matrix(QQ,3,3,1) I do not get the identitiy matrix. The only way the matrix function works is when I type matrix() and it gives me an empty matrix. Why is this so? Have I not installed some package correctly? Below is the error message that I get. sage:

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread Dima Pasechnik
On 2012-10-21, LFS wrote: > --=_Part_1134_6290611.1350821044307 > Content-Type: text/plain; charset=ISO-8859-1 > > yes - i finally saw that and took the call to the GDDinit out of the loop > and this may be working, but I don't know how to explain this to the > kiddies. Just tell them the t

Re: [sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
Oh I agree Dave for several reasons (not least of all that Excel is not free, nor is it math based). However I have to admit that I have not been happy with any non-Excel program for just "teaching" probability and statistics. Too complicated and the kiddies will give up. It took me 4 days to ge

Re: [sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread David Kirkby
On 21 October 2012 13:04, LFS wrote: > yes - i finally saw that and took the call to the GDDinit out of the loop > and this may be working, but I don't know how to explain this to the > kiddies. > Probably should have just stuck with Excel where I understand the > generators. Too complicated by fa

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
yes - i finally saw that and took the call to the GDDinit out of the loop and this may be working, but I don't know how to explain this to the kiddies. Probably should have just stuck with Excel where I understand the generators. Too complicated by far. Thanks everyone for your help. On Sunday

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread Dima Pasechnik
On 2012-10-21, LFS wrote: > --=_Part_87_6472836.1350820122321 > Content-Type: text/plain; charset=ISO-8859-1 > > Actually Dmitrii with this change it is giving me exactly the same > empirical data each time! well, I just gave you a general framework for initializing and using a pseudo-random

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
I am not sure, but your image looks like the bottom histogram, which is the normal distribution. The middle histogram is from the empirical data. Linda -- You received this message because you are subscribed to the Google Groups "sage-support" group. To post to this group, send email to sage-s

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
Actually Dmitrii with this change it is giving me exactly the same empirical data each time! -- You received this message because you are subscribed to the Google Groups "sage-support" group. To post to this group, send email to sage-support@googlegroups.com. To unsubscribe from this group, sen

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
Done. Thanks On Sunday, 21 October 2012 13:35:02 UTC+2, Dima Pasechnik wrote: > > On 2012-10-21, LFS > wrote: > > --=_Part_2721_6851258.1350818261101 > > Content-Type: text/plain; charset=ISO-8859-1 > > > > Thanks Dave - If I have a moment I will try the scatter plot method to > > check.

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread Dima Pasechnik
On 2012-10-21, LFS wrote: > --=_Part_2721_6851258.1350818261101 > Content-Type: text/plain; charset=ISO-8859-1 > > Thanks Dave - If I have a moment I will try the scatter plot method to > check. That seems like a useful idea for student. > (This was just for a class lesson on testing the CLT

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
Sorry Dmitrii to continually be typing your name wrong (using the Macedonian spelling where I live :)). Linda -- You received this message because you are subscribed to the Google Groups "sage-support" group. To post to this group, send email to sage-support@googlegroups.com. To unsubscribe fro

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
Yes - I think Dimitri's solution is working! (I changed the published file to his algorithm and upped the number of sets ns for the CLT and I also seem to be now be getting good empirical data.) Thank-you all! Linda -- You received this message because you are subscribed to the Google Groups

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread P Purkayastha
On 10/21/2012 06:30 PM, LFS wrote: Hiya Dmitrii Thanks so much for your quick reply, but I am still getting the same problem. I go to excel and use a RandBetween[1,1000] and just sort them according to my probability and all is good, i.e. the histogram of the expected values is "norm

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread Dima Pasechnik
On 2012-10-21, David Kirkby wrote: > On 21 October 2012 12:03, LFS wrote: >> Hiya Dave, >> What would the line of code look like to reseed it with the epoch thing each >> time I call it? >> Thanks so much, >> >> Linda > > > http://www.sagemath.org/doc/reference/sage/misc/randstate.html > > says >

Re: [sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
Thanks Dave - If I have a moment I will try the scatter plot method to check. That seems like a useful idea for student. (This was just for a class lesson on testing the CLT and I am way over my time allotment :)) Thanks to both you and Dimitri for feedback! Linda -- You received this message b

Re: [sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread David Kirkby
On 21 October 2012 12:03, LFS wrote: > Hiya Dave, > What would the line of code look like to reseed it with the epoch thing each > time I call it? > Thanks so much, > > Linda http://www.sagemath.org/doc/reference/sage/misc/randstate.html says If set_random_seed() is called with no arguments, t

Re: [sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread David Kirkby
On 21 October 2012 12:03, LFS wrote: > Hiya Dave, > What would the line of code look like to reseed it with the epoch thing each > time I call it? > Thanks so much, > > Linda The truth is I don't know off hand. I've spent a lot of time porting Sage to Solaris, but have not used it much at all. I'

Re: [sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread David Kirkby
One simple way to get a qualitative feel for the quality of random numbers is to take them two at a tim, staring with the first two being x1, y1. So you gererate: x1, y1 x2, y2 x3, y3 etc then plot a graph of x,y for all parts xn, yn The graph should look like a scatter graph, with no obvious pa

Re: [sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
Hiya Dave, What would the line of code look like to reseed it with the epoch thing each time I call it? Thanks so much, Linda > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To post to this group, send email to sage-support@googlegroups.c

Re: [sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread David Kirkby
On 21 October 2012 11:42, LFS wrote: > Hiya Dimitri, It might actually be working. Not sure, but when I increased > the number of sets ns, it does looks better. Still alot of repeats, but the > histogram looks better. Linda If there is a number of repeats, something is defnitely wrong. It should

Re: [sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread David Kirkby
On 21 October 2012 11:30, LFS wrote: > Hiya Dmitrii > Thanks so much for your quick reply, but I am still getting the same > problem. I don't know if this the best way in Sage, but it is common practice to seed the random number generator from the number of seconds since the Epoch (1/1/1970). So

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
Hiya Dimitri, It might actually be working. Not sure, but when I increased the number of sets ns, it does looks better. Still alot of repeats, but the histogram looks better. Linda On Sunday, 21 October 2012 12:30:13 UTC+2, LFS wrote: > > Hiya Dmitrii > Thanks so much for your quick reply, but I

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread LFS
Hiya Dmitrii Thanks so much for your quick reply, but I am still getting the same problem. > I go to excel and use a RandBetween[1,1000] and just sort them according > to my probability and all is good, i.e. the histogram of the expected > values is "normally distributed". > Here I keep getti

[sage-support] Re: Why don't I get random numbers?

2012-10-21 Thread Dima Pasechnik
On 2012-10-21, LFS wrote: > --=_Part_948_19630829.1350808455726 > Content-Type: text/plain; charset=ISO-8859-1 > > Hiya guys! > I have a function: > def GDD(num,P): > D=GeneralDiscreteDistribution(P) > D.reset_distribution() > L=[D.get_random_element() for _ in range(num)] > re

[sage-support] Why don't I get random numbers?

2012-10-21 Thread LFS
Hiya guys! I have a function: def GDD(num,P): D=GeneralDiscreteDistribution(P) D.reset_distribution() L=[D.get_random_element() for _ in range(num)] return L and then commands P=[0.5,0.33, 0.17] L=GDD(num,P) I am definitely not getting random distributions within my lists L (i.e.