20 Reputation

One Badge

2 years, 31 days

MaplePrimes Activity

These are questions asked by Vez96

If I have a procedure that for example produces a list of times it takes to work out the eigenvectors of a random nxn matrix from n=2..9.


If I want to make my data more accurate so that it works out the time it takes to find the eigenvector for each different sized matrix multiple times and then takes an average time (for each n), how would I do that?


Hi I'm trying to make a procedure that will multiply all the diagonal entries of any random matrix together, this is what I have tried so far:


Diag := proc(A)
local aux,V,i,n;

for i from 1 to n do 
aux := 1; 
aux := aux*U2(i,i);
end do:

end proc;

but this just produces the last diagoinal entry of the matrix - how do I make the loop multiply the previous number by the next diagonal entry?

another option I've done is to make a list of the diagonal entries, but then I encounter the same problem with multiplication:

local n, List;
end proc:

any help would be greatly appreciated!

Hi, I'm stuck on how to create a procedure, 'Arrange' that sorts a list of integers so that the numbers go from smallest to largest. So if I have a list such as: [3,6,1,9,0,4] ,

Arrange([3,6,1,9,0,4]) = [0,1,3,4,6,9]

I have a procedure that produces a sequence where we denote 'x' as the first number in the list, and returns: a list of all the numbers in the list less than x, x, a list of all the numbers greater than x.

i.e. returns: [1, 0], 3, [6, 9, 4]

Arrange := proc(L)
local L1,L2,n,x,i;
if n=0 then
elif n=1 then 
return L[1];
elif n>1 then
x:= L[1];

for i from 2 to n do 
if L[i] < x then

end if:
end do:
end if:
return L1,x,L2;

end proc:

could anyone help on how I can expand on this to get the procedure that I want?


p.s. I know that there is already an inbuilt 'sort' function in Maple, but I'm trying to create the procedure myself!

The Question: 

'Produce a list of the primes p between 2000 and 3000 for which both 2 and 3 generate Fpx ' 

I have my code for producing the list of primes between 2000 and 3000:

while p<=3000 do
end do:

I also have  code for finding the order of a number in Fpx

 local gpwr, i;
for i from 1 to p-1 do
  gpwr:=gpwr*g mod p; 
if (gpwr = 1) then:
return i;
end if:
end do:
end proc:


but I don't know how to relate them or how to create the overall code - any advice would be very helpful!!

Page 1 of 1