Sponsored links: Algebra eBooks
 

Related

last-matrix-plot2d-ratsimp-solve-sqrt
plot2d([g(x), [discrete, [o, list_matrix_entries(p), list_matrix_entries(q), list_matrix_entries(r), list_matrix_entries(s)] ]],  [x, -10, 15], [y, -10, 15], [style, lines, lines]);

f(x):= (1/2)*matrix([...

o: [0,0];

p: ratsimp(f(o));

Calculate

last-rhs-solve

f(x):= x^2;

i(y):= rhs(last( solv...

i(2);

Calculate

last-map-plot2d-rhs-solve-sort
plot2d([rhs(Parabel)],[x,0,og]);

A:[0,1000];

B:[50,3000];

C:[80,6000];

Calculate

last-numer-rk

g:10;

ro: rk([v,-g],[x,v],[...

last(ro);

Calculate

last-rhs-solve

f(x):= x^2;

i(y):= rhs(last( solv...

i(2);

Calculate

last

lista:[2,5,-2,1];

last(lista);

Calculate

last-length

koe:[1,2,5,8];

loppukaksi(lista):=[l...

loppukaksi(koe);

Calculate

last-length

koe:[1,2,5,8];

loppukaksi(lista):=[l...

loppukaksi(koe);

Calculate

last-numer-rk

g:10;

ro: rk([v,-g],[x,v],[...

last(ro);

Calculate

last

last([1]);

Calculate

last

Run Example
(%i1)seq(start,stop,stepping,[shift]) := block([                                            n, y:[],                                             shift: (if (not(emptyp(shift)))                                                         then float(first(shift))                                                            else (0.0))                                            ],            (n:floor((float(stop-start)/float(stepping)))),            (if (start <
 stop)            then            (y:flatten(append([y],                                         makelist(float(start+shift+(stepping*(i-start))),                                         i, start, n+start))))            else            (y:flatten(append([y],                                         makelist(-(float(stop-shift-(stepping*(i-stop)))),                                         i, -(n+stop), stop)))))            (if (n>
1.0)                then return(y)                else return([])));
(%o1) seq(start, stop, stepping, [shift]) := 
block([n, y : [], shift : if not emptyp(shift) then float(first(shift))
                      float(stop - start)
 else 0.0], n : floor(-------------------), 
                        float(stepping)
if start < stop then y : flatten(append([y], 
makelist(float(start + shift + stepping (i - start)), i, start, n + start)))
 else y : flatten(append([y], makelist(- float(stop - shift
 - stepping (i - stop)), i, - (n + stop), stop)))(if n > 1.0 then return(y)
 else return([])))
(%i2) kill(pairs);
(%o2)                                done
(%i3) pairs(items):=block([result],result:if (emptyp(items)) then [] elseif (listp(items)) then     if(emptyp(rest(items))) then cons(last(items), []) else    cons(cons(first(items),  [second(items)]),                     [pairs(rest(rest(items)))]));
(%o3) pairs(items) := block([result], result : 
if emptyp(items) then [] elseif listp(items)
 then (if emptyp(rest(items)) then cons(last(items), [])
 else cons(cons(first(items), [second(items)]), [pairs(rest(rest(items)))])))
(%i4) pairs([1, 2, 3, 4, 5]);
(%o4)                       [[1, 2], [[3, 4], [5]]]
(%i5) kill(pairs);
(%o5)                                done
(%i6) pairs(items):=block([result],result:if (emptyp(items)) then [] elseif (listp(items)) then     if(emptyp(rest(items))) then [last(items), []] else    cons(cons(first(items),  [second(items)]),                     [pairs(rest(rest(items)))]));
(%o6) pairs(items) := block([result], result : 
if emptyp(items) then [] elseif listp(items)
 then (if emptyp(rest(items)) then [last(items), []]
 else cons(cons(first(items), [second(items)]), [pairs(rest(rest(items)))])))
(%i7) pairs([1, 2, 3, 4, 5]);
(%o7)                     [[1, 2], [[3, 4], [5, []]]]
(%i8) first(pairs(seq(1, 10, 1)));
(%o8)                             [1.0, 2.0]
(%i9) test([list]):=map(lambda([x], [first(x), second(x)]),list);
(%o9)    test([list]) := map(lambda([x], [first(x), second(x)]), list)
(%i10) find_root(sin(x), x, 0, %pi);
(%o10)                                0.0
(%i11) 
Run Example
elim(l,m,k, [p]):=block([ans], ans:subst([0="_"], l*subst([m=0, k=0], makelist(n, n, 1, length(l)))/makelist(n, n,1,length(l))), if(not(emptyp(p))) then return(delete("_", ans)) else return(ans));
(%o1) elim(l, m, k, [p]) := block([ans], 
                       l subst([m = 0, k = 0], makelist(n, n, 1, length(l)))
ans : subst([0 = "_"], -----------------------------------------------------), 
                                   makelist(n, n, 1, length(l))
if not emptyp(p) then return(delete("_", ans)) else return(ans))
(%i2) elimcc(l,m,k, [p]):=block([ans], ans:subst([0="_"],l*map(lambda([x], if(x=0) then 1 else 0), subst([m=0, k=0], makelist(n, n, 1, length(l)))/makelist(n, n,1,length(l)))), if(not(emptyp(p))) then return(delete("_", ans)) else return(ans));
(%o2) elimcc(l, m, k, [p]) := block([ans], 
ans : subst([0 = "_"], l map(lambda([x], if x = 0 then 1 else 0), 
subst([m = 0, k = 0], makelist(n, n, 1, length(l)))
---------------------------------------------------)), 
           makelist(n, n, 1, length(l))
if not emptyp(p) then return(delete("_", ans)) else return(ans))
(%i3) M:[A,T,G,C,A,T,C];
(%o3)                        [A, T, G, C, A, T, C]
(%i4) elim(M, 1, 7);
(%o4)                        [_, T, G, C, A, T, _]
(%i5) elim(M, 1, 7, t);
(%o5)                           [T, G, C, A, T]
(%i6) elimcc(M, 1, 7);
(%o6)                        [A, _, _, _, _, _, C]
(%i7) elimcc(M, 1, 7, t);
(%o7)                               [A, C]
(%i8) elimn(l,[index]):=block([ans, indi:map("=", index, delete([], makelist(0, n, 1, length(index))))], ans:subst([0="_"], l*subst(indi, makelist(n, n, 1, length(l)))/makelist(n, n,1,length(l))), if(is(last(index)=t)) then return(delete("_", ans)) else return(ans));
(%o8) elimn(l, [index]) := block([ans, 
indi : map("=", index, delete([], makelist(0, n, 1, length(index))))], 
                       l subst(indi, makelist(n, n, 1, length(l)))
ans : subst([0 = "_"], -------------------------------------------), 
                              makelist(n, n, 1, length(l))
if is(last(index) = t) then return(delete("_", ans)) else return(ans))
(%i9) M:[A,T,G,C,A,T,C];
(%o9)                        [A, T, G, C, A, T, C]
(%i10) elimn(M, 1, 3, 7);
(%o10)                       [_, T, _, C, A, T, _]
(%i11) elimn(M, 1, 3, 7, t);
(%o11)                           [T, C, A, T]
(%i12) elimn(l,index):=block([ans, indi:map("=", index, delete([], makelist(0, n, 1, length(index))))], ans:subst([0="_"], l*subst(indi, makelist(n, n, 1, length(l)))/makelist(n, n,1,length(l))), if(is(last(index)=t)) then return(delete("_", ans)) else return(ans));
(%o12) elimn(l, index) := block([ans, indi : 
map("=", index, delete([], makelist(0, n, 1, length(index))))], 
                       l subst(indi, makelist(n, n, 1, length(l)))
ans : subst([0 = "_"], -------------------------------------------), 
                              makelist(n, n, 1, length(l))
if is(last(index) = t) then return(delete("_", ans)) else return(ans))
(%i13) segment(l,m,k):=block(elimn(l,index):=block([ans, indi:map("=", index, delete([], makelist(0, n, 1, length(index))))], ans:subst([0="_"], l*subst(indi, makelist(n, n, 1, length(l)))/makelist(n, n,1,length(l))), if(is(last(index)=t)) then return(delete("_", ans)) else return(ans)), elimn(l, makelist(n, n, m, k)));
(%o13) segment(l, m, k) := block(elimn(l, index) := 
block([ans, indi : map("=", index, delete([], 
makelist(0, n, 1, length(index))))], ans : 
                 l subst(indi, makelist(n, n, 1, length(l)))
subst([0 = "_"], -------------------------------------------), 
                        makelist(n, n, 1, length(l))
if is(last(index) = t) then return(delete("_", ans)) else return(ans)), 
elimn(l, makelist(n, n, m, k)))
(%i14) segment(M, 2, 5);
(%o14)                       [A, _, _, _, _, T, C]
(%i15) elim_segment(l,m,k,[p]):=block(elimn(l,index):=block([ans, indi:map("=", index, delete([], makelist(0, n, 1, length(index))))], ans:subst([0="_"], l*subst(indi, makelist(n, n, 1, length(l)))/makelist(n, n,1,length(l))), if(not(emptyp(p))) then return(delete("_", ans)) else return(ans)), elimn(l, makelist(n, n, m, k)));
(%o15) elim_segment(l, m, k, [p]) := block(elimn(l, index) := 
block([ans, indi : map("=", index, delete([], 
makelist(0, n, 1, length(index))))], ans : 
                 l subst(indi, makelist(n, n, 1, length(l)))
subst([0 = "_"], -------------------------------------------), 
                        makelist(n, n, 1, length(l))
if not emptyp(p) then return(delete("_", ans)) else return(ans)), 
elimn(l, makelist(n, n, m, k)))
(%i16) elim_segment(M, 2, 5);
(%o16)                       [A, _, _, _, _, T, C]
(%i17) elim_segment(M, 2, 5, t);
(%o17)                             [A, T, C]
(%i18) retain_segment(l,m,k,[p]):=block(elimn(l,index):=block([ans, indi:map("=", index, delete([], makelist(0, n, 1, length(index))))], ans:subst([0="_"], l*map(lambda([x], if(x=0) then 1 else 0), subst(indi, makelist(n, n, 1, length(l)))/makelist(n, n,1,length(l)))), if(not(emptyp(p))) then return(delete("_", ans)) else return(ans)), elimn(l, makelist(n, n, m, k)));
(%o18) retain_segment(l, m, k, [p]) := 
block(elimn(l, index) := block([ans, indi : 
map("=", index, delete([], makelist(0, n, 1, length(index))))], 
ans : subst([0 = "_"], l map(lambda([x], if x = 0 then 1 else 0), 
subst(indi, makelist(n, n, 1, length(l)))
-----------------------------------------)), 
      makelist(n, n, 1, length(l))
if not emptyp(p) then return(delete("_", ans)) else return(ans)), 
elimn(l, makelist(n, n, m, k)))
(%i19) retain_segment(M, 2, 5);
(%o19)                       [_, T, G, C, A, _, _]
(%i20) retain_segment(M, 2, 5, t);
(%o20)                           [T, G, C, A]
(%i21) cut(l,m,k,h,[p]):=block( cut_segment(l, m, k, [p]):=block( elimn(l,index):=block([ans, indi:map("=", index, makelist(0, n, 1, length(index)))], ans:subst([0="_"], l*subst(indi, makelist(n, n, 1, length(l)))/makelist(n, n, 1, length(l))), if(not(emptyp(p))) then return(delete("_", ans)) else return(ans)), elimn(l, makelist(n, n, m, k))), cut_flanks(l, m, k, [p]):=block(elimn(l,index):=block([ans, indi:map("=", index, makelist(0, n, 1, length(index)))], ans:subst([0="_"], l*map(lambda([x], if(x=1) then 0 else 1), subst(indi, makelist(n, n, 1, length(l)))/makelist(n, n, 1, length(l)))), if(not(emptyp(p))) then return(delete("_", ans)) else return(ans)), elimn(l, makelist(n, n, m, k))), if(h=s and emptyp(p)) then return(cut_flanks(l,m,k)) else if(h=s and not(emptyp(p))) then return(cut_flanks(l,m,k,t)) else if(h=f and emptyp(p)) then return(cut_segment(l,m,k)) else if(h=f and not(emptyp(p))) then return(cut_segment(l,m,k,t)));
(%o21) cut(l, m, k, h, [p]) := block(cut_segment(l, m, k, [p]) := 
block(elimn(l, index) := block([ans, indi : 
map("=", index, makelist(0, n, 1, length(index)))], 
                       l subst(indi, makelist(n, n, 1, length(l)))
ans : subst([0 = "_"], -------------------------------------------), 
                              makelist(n, n, 1, length(l))
if not emptyp(p) then return(delete("_", ans)) else return(ans)), 
elimn(l, makelist(n, n, m, k))), cut_flanks(l, m, k, [p]) := 
block(elimn(l, index) := block([ans, indi : 
map("=", index, makelist(0, n, 1, length(index)))], 
ans : subst([0 = "_"], l map(lambda([x], if x = 1 then 0 else 1), 
subst(indi, makelist(n, n, 1, length(l)))
-----------------------------------------)), 
      makelist(n, n, 1, length(l))
if not emptyp(p) then return(delete("_", ans)) else return(ans)), 
elimn(l, makelist(n, n, m, k))), if (h = s) and emptyp(p)
 then return(cut_flanks(l, m, k)) else (if (h = s) and (not emptyp(p))
 then return(cut_flanks(l, m, k, t)) else (if (h = f) and emptyp(p)
 then return(cut_segment(l, m, k)) else (if (h = f) and (not emptyp(p))
 then return(cut_segment(l, m, k, t))))))
(%i22) 
Run Example
lista:[2,5,-2,1];
(%o1)                           [2, 5, - 2, 1]
(%i2) last(lista);
(%o2)                                  1
(%i3) 
[addrow,last,length,matrix] [append,block,buildq,declare,delete,do,false,first,floor,if,last,length,map,not,return,show,simp,true,while] [append,block,buildq,do,first,last,length,map,return,show,simp,true] [append,block,buildq,emptyp,ev,find_root,first,flatten,floor,kill,last,listp,makelist,not,rest,second,sin] [append,block,buildq,emptyp,find_root,first,flatten,floor,kill,lambda,last,listp,makelist,not,rest,second,sin] [append,block,buildq,emptyp,find_root,first,flatten,floor,kill,last,listp,makelist,not,rest,second,sin] [append,block,charlist,delete,last,length,makelist,map,next_prime,string] [append,block,cons,delete,do,emptyp,first,float,lambda,last,listp,load,makelist,numberp,ratprint,rest,return,reverse] [append,block,cons,delete,do,emptyp,first,float,lambda,last,listp,load,map,ratprint,rest,return,reverse] [append,block,cons,delete,do,emptyp,first,float,last,listp,ratprint,rest,return] [append,block,cons,delete,do,emptyp,first,float,last,listp,ratprint,rest] [append,block,cons,emptyp,find_root,first,flatten,floor,if,kill,last,listp,makelist,not,rest,second,sin] [append,block,cons,emptyp,first,flatten,floor,if,kill,last,listp,makelist,not,rest,second] [append,block,do,emptyp,errcatch,find_root,first,flatten,floor,if,last,listp,makelist,not,rest,second,sin] [append,block,emptyp,errcatch,find_root,first,flatten,floor,if,last,listp,makelist,not,rest,second,sin] [append,block,emptyp,errcatch,find_root,first,flatten,floor,kill,last,listp,makelist,not,rest,second,sin] [append,block,emptyp,find_root,first,flatten,floor,kill,lambda,last,listp,makelist,map,not,rest,second,sin] [append,block,emptyp,find_root,first,flatten,floor,kill,last,length,listp,makelist,not,rest,second,sin] [append,block,emptyp,find_root,first,flatten,floor,kill,last,listp,makelist,not,print,rest,second,sin] [append,block,emptyp,find_root,first,flatten,floor,kill,last,listp,makelist,not,rest,second,sin] [append,block,emptyp,first,flatten,floor,kill,lambda,last,listp,makelist,map,not,rest,second] [append,block,emptyp,first,flatten,floor,kill,last,listp,makelist,not,rest,second] [apply,cons,lambda,last,let,sum] [apply,cons,lambda,last,let] [bftorat,block,cons,delete,do,emptyp,first,float2bf,fpprec,lambda,last,listp,map,maplist,mod,ratepsilon,ratprint,rest,return,second] [bftorat,block,cons,delete,do,emptyp,first,float2bf,fpprec,lambda,last,listp,map,maplist,mod,ratepsilon,ratprint,rest,return] [bftorat,block,cons,delete,do,emptyp,first,float2bf,fpprec,lambda,last,listp,map,mod,ratepsilon,ratprint,rest,return] [block,compile,emptyp,first,if,kill,last,let,listp,rest,second] [block,cons,delete,do,emptyp,first,float,if,last,length,listp,ratprint,rem,rest] [block,delete,emptyp,if,lambda,last,length,makelist,map,not,subst] [block,delete,if,last,length,makelist,map,subst,true] [block,delete,if,last,length,makelist,map,subst] [block,emptyp,errcatch,find_root,first,if,last,listp,makelist,rest,second,sin] [block,emptyp,first,if,kill,last,listp,rest,second] [block,emptyp,first,if,last,listp,makelist,rest,second] [divide,factor,last,num] [ev,first,kill,last,length,numer,plot2d,rhs,second,solve,sqrt,sum] [exp,last,length,sum] [false,first,inf,last,limit,lsum,makelist,second,sqrtdispflag,subst] [false,first,inf,last,limit,lsum,makelist,sqrtdispflag,subst] [first,kill,last,length,plot2d,rhs,second,solve,sum] [float,last,matrix,plot2d,ratsimp,solve,sqrt] [float,last,matrix,plot2d,ratsimp,solve] [float,last,matrix,ratsimp,solve,sqrt] [float,last,matrix,ratsimp,solve] [last,length,makelist,rk] [last,length] [last,matrix,plot2d,ratsimp,solve,sqrt] [last,numer,rk] [last]

Related Help

Help for Last