Sponsored links: Algebra eBooks
 

Related

cons-first-length-rest

_last_(A) := first(re...

_append_(A, B) := if ...

endcons2(A, x) := _ap...

Calculate

cons-if-lambda-let-or-unless

:lisp (defun lottery ...

:lisp (lottery);

:lisp (lottery t);

Calculate

cons-if-labels-let

:lisp (defun r (n) (l...

Calculate

cons-let

:lisp (defun pairs (i...

:lisp (pairs '(1 2 3 ...

:lisp (let ((seq '(1 ...

Calculate

cons-if

:lisp (defun nodes-de...

Calculate

cons-lambda-let

:lisp (setf expr '(* ...

:lisp (member-if 'lis...

:lisp (mapcar (lambda...

Calculate

cons-expand-factor-map-plot2d-rat-realroots-resultant-solve
plot2d(cons(-2*A-7, map(rhs, solve(r, B))),[A, -12, 4],[y, -25,30], [legend, false], [color, red] );

f: x^3-(A+2)*x^2+B*x-A;

g: 2*x^2+B*x-A*(B+2*A...

r:resultant(f,g,x);

Calculate

cons-first-length-rest

_last_(A) := first(re...

_append_(A, B) := if ...

endcons2(A, x) := _ap...

Calculate

cons-lambda-let-subst

:lisp (defun pairs (i...

:lisp (defun separate...

:lisp (setf a (pairs ...

Calculate

cons-do-floor-mod

n : 12;

b : 2;

floor(n/16);

Calculate

cons

Run Example
(%i1):lisp (defun r (n) (labels ((f (k l z) (let ((ln (+ (* 1.003 l) (* 0.006 z))) (zn (+ (* 0.0069 l) (* 1.026 z)))) (if (<
 k n) (f (1+ k) ln zn) (cons (/ ln l) (/ zn z)))) (f 0 10 1000))))) (print (r 100));

NIL 
NIL
(%i1) 
Run Example
P [s1,s2,s3,s4,s5] := block ( [tot: s1+s2+s3+s4+s5] , s1/tot*(if (s1>
1) then P [s1-1,s2,s3,s4,s5] else 1)+(if s2<
=1 then 0 else P [s1,s2-1,s3,s4,s5]*s2/tot)+(if s3<
=1 then 0 else P [s1,s2,s3-1,s4,s5]*s3/tot)+(if s4<
=1 then 0 else P [s1,s2,s3,s4-1,s5]*s4/tot)+(if s5<
=1 then 0 else P [s1,s2,s3,s4,s5-1]*s5/tot) );
(%o1) P                   := block([tot : s1 + s2 + s3 + s4 + s5], 
       s1, s2, s3, s4, s5
s1
--- (if s1 > 1 then P                       else 1)
tot                  s1 - 1, s2, s3, s4, s5
                           P                       s2
                            s1, s2 - 1, s3, s4, s5
 + (if s2 <= 1 then 0 else --------------------------)
                                      tot
                           P                       s3
                            s1, s2, s3 - 1, s4, s5
 + (if s3 <= 1 then 0 else --------------------------)
                                      tot
                           P                       s4
                            s1, s2, s3, s4 - 1, s5
 + (if s4 <= 1 then 0 else --------------------------)
                                      tot
                           P                       s5
                            s1, s2, s3, s4, s5 - 1
 + (if s5 <= 1 then 0 else --------------------------))
                                      tot
(%i2) srt[s1,s2,s3,s4,s5] := cons(s1, sort([s2,s3,s4,s5]));
(%o2)      srt                   := cons(s1, sort([s2, s3, s4, s5]))
              s1, s2, s3, s4, s5
(%i3) P [s1,s2,s3,s4,s5] := block ( [tot: s1+s2+s3+s4+s5] , s1/tot*(if (s1>
1) then arrayapply(P, srt[s1-1,s2,s3,s4,s5]) else 1)+(if s2<
=1 then 0 else arrayapply(P, srt[s1,s2-1,s3,s4,s5])*s2/tot)+(if s3<
=1 then 0 else arrayapply(P, srt[s1,s2,s3-1,s4,s5])*s3/tot)+(if s4<
=1 then 0 else arrayapply(P, srt[s1,s2,s3,s4-1,s5])*s4/tot)+(if s5<
=1 then 0 else arrayapply(P, srt[s1,s2,s3,s4,s5-1])*s5/tot) );
(%o3) P                   := block([tot : s1 + s2 + s3 + s4 + s5], 
       s1, s2, s3, s4, s5
s1
--- (if s1 > 1 then arrayapply(P, srt                      ) else 1)
tot                                  s1 - 1, s2, s3, s4, s5
                           arrayapply(P, srt                      ) s2
                                            s1, s2 - 1, s3, s4, s5
 + (if s2 <= 1 then 0 else -------------------------------------------)
                                               tot
                           arrayapply(P, srt                      ) s3
                                            s1, s2, s3 - 1, s4, s5
 + (if s3 <= 1 then 0 else -------------------------------------------)
                                               tot
                           arrayapply(P, srt                      ) s4
                                            s1, s2, s3, s4 - 1, s5
 + (if s4 <= 1 then 0 else -------------------------------------------)
                                               tot
                           arrayapply(P, srt                      ) s5
                                            s1, s2, s3, s4, s5 - 1
 + (if s5 <= 1 then 0 else -------------------------------------------))
                                               tot
(%i4) P[11,12,12,12,12];
                                    497664
(%o4)                               -------
                                    2232265
(%i5) 
Run Example
srt[s1,s2,s3,s4,s5] := cons(s1, sort([s2,s3,s4,s5]));
(%o1)      srt                   := cons(s1, sort([s2, s3, s4, s5]))
              s1, s2, s3, s4, s5
(%i2) P [s1,s2,s3,s4,s5] := block ( [tot: s1+s2+s3+s4+s5] , s1/tot*(if (s1>
1) then arrayapply(P, srt[s1-1,s2,s3,s4,s5]) else 1)+(if s2<
=1 then 0 else arrayapply(P, srt[s1,s2-1,s3,s4,s5])*s2/tot)+(if s3<
=1 then 0 else arrayapply(P, srt[s1,s2,s3-1,s4,s5])*s3/tot)+(if s4<
=1 then 0 else arrayapply(P, srt[s1,s2,s3,s4-1,s5])*s4/tot)+(if s5<
=1 then 0 else arrayapply(P, srt[s1,s2,s3,s4,s5-1])*s5/tot) );
(%o2) P                   := block([tot : s1 + s2 + s3 + s4 + s5], 
       s1, s2, s3, s4, s5
s1
--- (if s1 > 1 then arrayapply(P, srt                      ) else 1)
tot                                  s1 - 1, s2, s3, s4, s5
                           arrayapply(P, srt                      ) s2
                                            s1, s2 - 1, s3, s4, s5
 + (if s2 <= 1 then 0 else -------------------------------------------)
                                               tot
                           arrayapply(P, srt                      ) s3
                                            s1, s2, s3 - 1, s4, s5
 + (if s3 <= 1 then 0 else -------------------------------------------)
                                               tot
                           arrayapply(P, srt                      ) s4
                                            s1, s2, s3, s4 - 1, s5
 + (if s4 <= 1 then 0 else -------------------------------------------)
                                               tot
                           arrayapply(P, srt                      ) s5
                                            s1, s2, s3, s4, s5 - 1
 + (if s5 <= 1 then 0 else -------------------------------------------))
                                               tot
(%i3) udskriv (n) := [n,n*100.0];
(%o3)                     udskriv(n) := [n, n 100.0]
(%i4) udskriv(P[1,3,3,3,3]);
                            243
(%o4)                      [---, 53.40659340659341]
                            455
(%i5) 
[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,cons,emptyp,first,flatten,floor,if,kill,listp,makelist,not,rest,second] [append,block,cons,equal,if,not,return] [append,block,cons,equal,if,return] [append,block,cons,return] [append,cons,if,let,quotient] [append,cons,if,let,reverse] [append,cons,if,let] [append,cons,lambda,let,string,values] [append,cons,lambda,let] [apply,at,block,cons,flatten,if,listp,piece] [apply,block,ceiling,cons,do,fpprec,rationalize,ratnump,reverse,sin] [apply,cons,lambda,last,let,sum] [apply,cons,lambda,last,let] [apply,cons,lambda,let,values] [apply,cons,lambda,let] [arrayapply,arrayinfo,block,cons,if,sort] [arrayinfo,block,cons,if,sort] [assume,cons,eliminate,ev,fpprintprec,map,plot2d,solve] [at,block,cons,if,listp,piece] [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] [bftorat,block,cons,delete,emptyp,false,first,float2bf,fpprec,if,integerp,kill,lambda,listp,map,mod,ratdenom,ratepsilon,ratprint,rest,return] [block,cons,delete,do,emptyp,first,float,if,last,length,listp,not,ratprint,rem,rest] [block,cons,delete,do,emptyp,first,float,if,last,length,listp,ratprint,rem,rest] [block,cons,emptyp,first,if,kill,listp,makelist,rest,second] [block,cons,if,sort,xreduce] [block,cons,if,sort] [block,cons,lambda,scanmap] [block,cons,linsolve,simp] [col,cons,endcons,genmatrix,kill,min,permanent,print,random,row,sort,sqrt,transpose] [cons,do,mod] [cons,eliminate,ev,fpprintprec,map,plot2d,solve] [cons,first,length,rest] [cons,first,rest] [cons,if,labels,let] [cons,if,lambda,length,rest,reverse] [cons,if,lambda,let,or,unless] [cons,if,lambda,let,unless] [cons,if] [cons,lambda,let,subst] [cons,lambda,let] [cons,let] [cons]

Related Help

Help for Cons