maplenoob

189 Reputation

2 Badges

17 years, 13 days

MaplePrimes Activity


These are answers submitted by maplenoob

ah ok......what a bad luck to choose such digits :)

thx for your help, for other numbers it really takes longer.....

but where did you find the information about igcd ? i tried to google the name Weber but i found just pages where it is mentiond that this guy made a gcd implementation but i couldn't find a pseudocode (or a real implementation).......

do you have info why maple use this (slow) algo?

i use a 2.4 GHz system (core duo, does maple 11 take advantage of multi-core systems?).

the implementation i used for the euklid algo is the one that is written on wikipedia. here a link to my worksheet with my code. at the end the runtime of each algo is printed:
http://rapidshare.com/files/160992265/mp_upload.mw.html

btw.
where did you find the information on igcd ? maple help didn't give me clue ???

for example:

igcd(150000!, 250000!)

(real big numbers), this example needs on my maschine for example 7 seconds do be solved. my euklid-implementation needs just 0.3 seconds !

 

. if i use tallyInto with the "default" value maple splits my values in 5 groups like i wanted it, but i don't unterstand why my first attempt was wrong.

Regarding the frequency function: I need to know the function itself not a table of it nor a Plot how do i get the function?

thank you so far, i still have a problem. i would like to have an ouput that tells me the binary code for the single letters i use for example e= 00 f= 010 d=100 g=110 and so on
I tried to solve that problem by adding the 0 and 1 to an listlist and record my binary code for each letter. but whatever i am doing it doesn't seems to be fine with the maple syntax.

compare := proc(a::list,b::list) #Sortieren
    evalb(a[2] > b[2])
end proc:

ShannonFano := proc(L :: listlist, Q :: listlist)
local n,k,i,q,v,tot,cumul;
    n := nops(L);  

    if n < 2 then  
    print(Q);
        return L[];
    end if;

    tot := add(v[2], v in L);  
    cumul := 0;                

    for k to nops(L) while cumul < tot/2 do   
       cumul := cumul + L[k,2];  
    end do;

    print("New Node: ", L);

   if nops(L[1..k-1]) = 1 then
       print("Leaf");
   end if;
   print("0",L[1..k-1]);
   
   for i from 1 to nops(L[1..k-1]) do        #add 0 to the letters that are reached with 0 
      for q from 1 to nops(L[1..k-1]) do
      if Q[i,1] = L[q,1] then
        Q[1,2] := cat(Q[1,2], "0");
        print(Q);
      end if;
    end do;
   end do;


   if nops(L[k..n]) = 1 then
       print("Leaf");
   end if;
   print("1",L[k..n]);

   for i from 1 to nops(L[k..n]) do            #add 1 to the letters that are reached with 1   
    for q from 1 to nops(L[1..k-1]) do
      if Q[i,1] = L[q,1] then
        Q[1,2] := cat(Q[1,2], "1");
        print(Q);
      end if;
    end do;
   end do;
  
   [procname(L[1..k-1],Q), procname(L[k..n],Q)];  

end proc:


listA :=[[a,41],[b,33],[c,23],[d,25],[e,100]]:
listB := sort(listA, compare);
listC := [[a,{}],[b,{}],[c,{}],[d,{}],[e,{}]]:
ShannonFano(listB,listC);

Maple tells me that i use formal parameters wrong. what am i doing wrong with the listlist syntax?

thank you for your help
looks like it work, just one question
 

    tot := add(v[2], v in L);          #1
    cumul := 0;
    for k to nops(L) while cumul < tot/2 do       #2
        cumul := cumul + L[k,2];
    end do;
 

what exactly does command #1 do? why do you access v with an index ? i suppose you just count the total amount of elements in my listlist?

in the for-loop you split up the list in 2 parts, but what does L[k,2] do? you take the list at position k in length 2 ? until you reach the half list of the whole list (tot/2) ? is that right?

(i am unsure about the maple commands you used the help function didn't give me satisfying answers...)

 

 

i uploaded my worksheet, the forum messed up my posting

http://www.mapleprimes.com/files/6941_shano.mw

thx.

i've to solve the this exercise on paper too. But i have problems to getting started with my function "a*exp(-x)+b*t"

till now i only solved linear functions on paper, so i don't know how to start with this one? can you help me?

thx so far.

i used the result i get from Exponentialfit to check whether the values i get fits to the plot i created

x := <0.0, 1.0, 2.0, 3.0, 4.0, 5.00, 6.00, 7.00, 8.00, 9.0>:
y := <4.1, 1.3, 0.4, 0.3, 0.1, 0.08, 0.07, 0.06, 0.08, 0.1>:

rtn := Statistics:-ExponentialFit(x,y,t);
u := op(1,rtn);
v := op(2,rtn);
evalf(u*exp(-x[1])+v*x[1]); ~1.309987037 (should be close to the original value(4.1) but 1.3 is far away)
 

what am i doing wrong?

ok thank you.

if've another exercise with a exponential-funktion

f (x) = ue^(-x)+vx

i tried it like that:

x := <0.0, 1.0, 2.0, 3.0, 4.0, 5.00, 6.00, 7.00, 8.00, 9.0>:
y := <4.1, 1.3, 0.4, 0.3, 0.1, 0.08, 0.07, 0.06, 0.08, 0.1>:

p1 :=plots:-pointplot([seq([x[i],y[i]],i=1..9)]): ##Plot points(Measured values )
sol2 := CurveFitting:-LeastSquares(x,y,t); ## get optimal val

so far so good but how do i get maple to draw the "new" optimized line ?

i tried but i didn't figured out how to make it.

btw.

how does maple know which function should be used? i just use "LeastSquare" and get the (right?) result.


 

 

 

it is a homerwork exercise and have to solve this on paper without maple, my problem is that i don't know how to get started with this function y = f(x) = k * 2^(bx)

my prof gave the advice to do "something" with ln/lg/ld with this function but i didn't get what i ve to do with it.

thanks.

but i suppose i didn't understand this "least square"-topic

i expected that maple would give me new points which would represent the "best" line that proceed closest to all my measure points.

what exactly is the result maple gave me?

hm....

don't get it. where do you see 2 - 5/4 ?

>" polynomial does not read 1/4*(x - 5), but only 1/4*x."

its f(x) + (f'(x)/1!)(x-xo)^1 + (f''(x)/2!)(x-xo)^2 + (f'''(x)/3!)(x-xo)^3, isn't it?!

my vector is b := Vector([10,20,30]); i want to rotate my vector 10 degrees on x-axis. my x-axis rotation matrix: a:= 10*(2*pi/360); # 10 degrees Rx := Matrix([[1,0,0],[0,cos(a),-sin(a)],[0,sin(a),cos(a)]]); Rx.b my result looks like this: http://i105.photobucket.com/albums/m239/souljumper/Clipboard02-3.jpg i suppose the result displays my rotated vector, but how do i force maple to display the result as a normal float-point vector. i don't like how the result looks now with the whole cos() and sin() .....(even it is more precisely).
ah, ok. thx. another question. i have a point/vector which i have to rotate 10 degree on the x-axis but i don't know how to key in the vector matrix multiplication to get my rotated vector. what command do i have to use and what order(vector first or matrix first)? thx for help
1 2 Page 1 of 2