Deadstar

192 Reputation

6 Badges

15 years, 341 days

MaplePrimes Activity


These are questions asked by Deadstar

K heres my problem.

Say i have a function, for example y=(1-x) and i want to find out which values of x will give me a real answer (i.e. no complex numbers!)

Preferrable i would like the output to be something along the lines of... "y is real for a<x<b..."

Hi folks, i'm ttrying to create an nxn array with n going as high as possibly 1000 to test the speed of a procedure i wrote.

Problem is, each row in the array has to have the numbers 1 to n arranged in a random order, with no number repeated.

Is there anyway to do this? Preferably using the Array command (think thats different from array...).

 

Cheers!

Write a procedure rsum that sums the reciprocals of the elements of a list.  So rsum( [a,b,c] ) should return 1/a + 1/b + 1/c.

How would i modify my code so that it does this... I know theres a much simpler way (rsum := L -> add( 1/x, x in L ):) but i would like to know how to edit the one ive done.

Heres my code so far...

rsum := proc(L)
local n;
    for n in L do
      1/n
    end do;
end proc;

 

Q: Write a procedure OddEven that takes a list L of integers and returns a list of the odd-numbered entries followed by the even-numbered entries.  So, for example,
OddEven([1,3,5,7,9,11]);
should return [1,5,9,3,7,11].  (Note: unless you find a clever solution you will need a several-line procedure using proc..end proc.   You will perhaps need an if statement so that you can deal with the case where the list has an odd number of elements and where it has an even number of elements separately.)

 

 

My ideas...

1 2 3 4 5 Page 5 of 5