Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 27 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@tuGUTS 

Most of what you say makes some sense, but I have a lot of trouble understanding your English. However, what you start off with is utter nonsense: A matrix is not a group. A matrix can be a member of a group, but it is not by itself a group. A group is a set together with a binary operation on that set that satisfies certain properties.

The thing that stands out to me based on a "mental compile" of the code (meaning that I'm just reading it, not running it until you upload it) is the same loop that Acer mentions. It looks to me like you're just throwing away the first 999 Arrays A. You're doing that 1000 times, and each A contains 3000 random numbers. So you're throwing away close to 3 billion random numbers. And Maple's algorithm for generating those numbers is not trivial.

@Markiyan Hirnyk Without randomize(), you will get the same sequence of random numbers every time. For example, I run your code on my computer...

restart: with(Statistics):
X := RandomVariable(Uniform(0, 10)):
seq(Sample(X, 1 .. 5), j = 1 .. 3):
lprint(%);
Array(1 .. 5, {1 = HFloat(8.14723686393178959), 2 = HFloat(9.05791937075619202), 3 = HFloat(1.26986816293506055), 4 = HFloat(9.13375856139019326), 5 = HFloat(6.32359246225409510)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(8.14723686393178959), 2 = HFloat(9.05791937075619202), 3 = HFloat(1.26986816293506055), 4 = HFloat(9.13375856139019326), 5 = HFloat(6.32359246225409510)}, datatype = float[8], storage = rectangular, order = Fortran_order)]), Array(1 .. 5, {1 = HFloat(.975404049994095246), 2 = HFloat(2.78498218867048397), 3 = HFloat(5.46881519204983846), 4 = HFloat(9.57506835434297621), 5 = HFloat(9.64888535199276554)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(.975404049994095246), 2 = HFloat(2.78498218867048397), 3 = HFloat(5.46881519204983846), 4 = HFloat(9.57506835434297621), 5 = HFloat(9.64888535199276554)}, datatype = float[8], storage = rectangular, order = Fortran_order)]), Array(1 .. 5, {1 = HFloat(1.57613081677548283), 2 = HFloat(9.70592781760615608), 3 = HFloat(9.57166948242945637), 4 = HFloat(4.85375648722841202), 5 = HFloat(8.00280468888800200)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(1.57613081677548283), 2 = HFloat(9.70592781760615608), 3 = HFloat(9.57166948242945637), 4 = HFloat(4.85375648722841202), 5 = HFloat(8.00280468888800200)}, datatype = float[8], storage = rectangular, order = Fortran_order)])

...and you can see that I got exactly the same random numbers as you. Sometimes that type of reproducibility is desirable. Certainly it is desirable for debugging. But if you want independent results in separate executions, then you want a different sequence of random numbers, and for that you need to use randomize().

@Markiyan Hirnyk Without randomize(), you will get the same sequence of random numbers every time. For example, I run your code on my computer...

restart: with(Statistics):
X := RandomVariable(Uniform(0, 10)):
seq(Sample(X, 1 .. 5), j = 1 .. 3):
lprint(%);
Array(1 .. 5, {1 = HFloat(8.14723686393178959), 2 = HFloat(9.05791937075619202), 3 = HFloat(1.26986816293506055), 4 = HFloat(9.13375856139019326), 5 = HFloat(6.32359246225409510)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(8.14723686393178959), 2 = HFloat(9.05791937075619202), 3 = HFloat(1.26986816293506055), 4 = HFloat(9.13375856139019326), 5 = HFloat(6.32359246225409510)}, datatype = float[8], storage = rectangular, order = Fortran_order)]), Array(1 .. 5, {1 = HFloat(.975404049994095246), 2 = HFloat(2.78498218867048397), 3 = HFloat(5.46881519204983846), 4 = HFloat(9.57506835434297621), 5 = HFloat(9.64888535199276554)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(.975404049994095246), 2 = HFloat(2.78498218867048397), 3 = HFloat(5.46881519204983846), 4 = HFloat(9.57506835434297621), 5 = HFloat(9.64888535199276554)}, datatype = float[8], storage = rectangular, order = Fortran_order)]), Array(1 .. 5, {1 = HFloat(1.57613081677548283), 2 = HFloat(9.70592781760615608), 3 = HFloat(9.57166948242945637), 4 = HFloat(4.85375648722841202), 5 = HFloat(8.00280468888800200)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(1.57613081677548283), 2 = HFloat(9.70592781760615608), 3 = HFloat(9.57166948242945637), 4 = HFloat(4.85375648722841202), 5 = HFloat(8.00280468888800200)}, datatype = float[8], storage = rectangular, order = Fortran_order)])

...and you can see that I got exactly the same random numbers as you. Sometimes that type of reproducibility is desirable. Certainly it is desirable for debugging. But if you want independent results in separate executions, then you want a different sequence of random numbers, and for that you need to use randomize().

Please upload a worksheet containing the code that you showed. In the form that you showed it, it cannot be cut-and-pasted.

@erik10 I'm just confirming that you understand perfectly what I said.

@erik10 I'm just confirming that you understand perfectly what I said.

@tuGUTS The x and y are members of a finite group. Yes, every finite group can be represented as a permutation group. (Finding the permutation representation of minimal degree can be difficult (NP-hard I believe--not sure).) That is not the same thing as being a permutation matrix. An n x n permutation matrix represents a permutation on n elements.

A permutation is a member of a permutation group; the permutation is not itself the group.

@tuGUTS The x and y are members of a finite group. Yes, every finite group can be represented as a permutation group. (Finding the permutation representation of minimal degree can be difficult (NP-hard I believe--not sure).) That is not the same thing as being a permutation matrix. An n x n permutation matrix represents a permutation on n elements.

A permutation is a member of a permutation group; the permutation is not itself the group.

@tuGUTS Could you say that again please, using full sentences? I don't understand the connection between the title and the body of your Reply.

@tuGUTS Could you say that again please, using full sentences? I don't understand the connection between the title and the body of your Reply.

@Markiyan Hirnyk 

A randomize() is required if you want different random numbers after a restart. This is what happens if you don't use it:

restart: rand();
                          395718860534
restart: rand();
                          395718860534
restart: randomize(): rand();
                          953915355483

You wrote:

Also I don't see any repetition of randomize() in the code under consideration.

But I know that he is repeating it because that is the only way that he could be having the problem that he describes.

@Markiyan Hirnyk 

A randomize() is required if you want different random numbers after a restart. This is what happens if you don't use it:

restart: rand();
                          395718860534
restart: rand();
                          395718860534
restart: randomize(): rand();
                          953915355483

You wrote:

Also I don't see any repetition of randomize() in the code under consideration.

But I know that he is repeating it because that is the only way that he could be having the problem that he describes.

@jschulzb You wrote:

What does that mean? Is there something wrong with my code, or maple?

A lost kernel connection means that the mathematical "engine" or "kernel" or "server" of Maple has crashed but the GUI continues to run. This always indicates a serious bug in Maple and not a fault in the user's code.

@skullte

First read into the single Matrix M, then break out the columns. It's probably best to avoid using I and as variable names in Maple as they represent the imaginary unit and the differentiation operator respectively. So I'll use II and DD. (But if you really want to use I and D, there are ways to do that.) Then

InputT, II, DD, Ta:= M[.., 1], M[.., 2], M[.., 3], M[.., 4];

First 644 645 646 647 648 649 650 Last Page 646 of 709