build_info(version="branch_5_44_base_231_g5c411f69f",timestamp="2021-01-12 23:51:42",host="x86_64-w64-mingw32",lisp_name="SBCL",lisp_version="2.0.0",maxima_userdir="C:/Users/zmth1/maxima",maxima_tempdir="C:/Users/zmth1/AppData/Local/Temp",maxima_objdir="C:/Users/zmth1/maxima/binary/branch_5_44_base_231_g5c411f69f/sbcl/2_0_0",maxima_frontend="wxMaxima",maxima_frontend_version="20.12.2-DevelopmentSnapshot_MSW_OpenMP201511+Locks")build_info(version="branch_5_44_base_231_g5c411f69f",timestamp="2021-01-12 23:51:42",host="x86_64-w64-mingw32",lisp_name="SBCL",lisp_version="2.0.0",maxima_userdir="C:/Users/zmth1/maxima",maxima_tempdir="C:/Users/zmth1/AppData/Local/Temp",maxima_objdir="C:/Users/zmth1/maxima/binary/branch_5_44_base_231_g5c411f69f/sbcl/2_0_0",maxima_frontend="wxMaxima",maxima_frontend_version="20.12.2-DevelopmentSnapshot_MSW_OpenMP201511+Locks")(version="branch_5_44_base_231_g5c411f69f",timestamp="2021-01-12 23:51:42",host="x86_64-w64-mingw32",lisp_name="SBCL",lisp_version="2.0.0",maxima_userdir="C:/Users/zmth1/maxima",maxima_tempdir="C:/Users/zmth1/AppData/Local/Temp",maxima_objdir="C:/Users/zmth1/maxima/binary/branch_5_44_base_231_g5c411f69f/sbcl/2_0_0",maxima_frontend="wxMaxima",maxima_frontend_version="20.12.2-DevelopmentSnapshot_MSW_OpenMP201511+Locks")
(fl:true,fp:binomial(n+1,k)^2/ binomial(2*n+2,n+1),f: binomial(n,k)^2/binomial(2*n,n), dg:(-3*n+2*k-1)*n!^2/(2*n+1)/k!^2/(n-k)!^2/binomial(2*n,n)/2 -(-3*n+2*k-3)*n!^2/(2*n+1)/(k-1)!^2/(n-k+1)!^2/binomial(2*n,n)/2,for n:2 thru 4 do for k thru n-1 do(t:fp-f-dg,if t#0 then(fl:false,disp(["n",n,"k",k,t]))),fl);
gives the result without evaluation but just using symbols - how ignorant can u get ?
if change to
(fl:true,fp:binomial(n+1,k)^2/ binomial(2*n+2,n+1),f: binomial(n,k)^2/binomial(2*n,n), dg:(-3*n+2*k-1)*n!^2/(2*n+1)/k!^2/(n-k)!^2/binomial(2*n,n)/2 -(-3*n+2*k-3)*n!^2/(2*n+1)/(k-1)!^2/(n-k+1)!^2/binomial(2*n,n)/2,for n:2 thru 4 do for k thru n-1 do(t:ev(fp-f-dg,numer),if t#0 then(fl:false,disp(["n",ns,"k",ks,t]))),fl);
then it does evaluate but in floating point when did not want floating point
(fl:true,fp:binomial(n+1,k)^2/ binomial(2*n+2,n+1),f: binomial(n,k)^2/binomial(2*n,n), dg:(-3*n+2*k-1)*n!^2/(2*n+1)/k!^2/(n-k)!^2/binomial(2*n,n)/2 -(-3*n+2*k-3)*n!^2/(2*n+1)/(k-1)!^2/(n-k+1)!^2/binomial(2*n,n)/2,for n:2 thru 4 do for k thru n-1 do(t:lratsubst([n=n,k=k],fp-f-dg) ,if t#0 then(fl:false,disp(["n",n,"k",k,t]))),fl);
now it gives ridiculous not evaluated but general symbols again
(fl:true,fp:binomial(n+1,k)^2/ binomial(2*n+2,n+1),f: binomial(n,k)^2/binomial(2*n,n), dg:(-3*n+2*k-1)*n!^2/(2*n+1)/k!^2/(n-k)!^2/binomial(2*n,n)/2 -(-3*n+2*k-3)*n!^2/(2*n+1)/(k-1)!^2/(n-k+1)!^2/binomial(2*n,n)/2,for ns:2 thru 4 do for ks thru ns-1 do(t:lratsubst([n=ns,k=ks],fp-f-dg) ,if t#0 then(fl:false,disp(["n",ns,"k",ks,t]))),fl);
NOw this does work as it should but with the ridiculous requirement that had to use ns,ks rather than just the obvious n,k symbols
now the next is truly a bug as again give bogus error messages which DO NOT IN any way apply.
(fl:true,fp:binomial(n+1,k)^2/ binomial(2*n+2,n+1),f: binomial(n,k)^2/binomial(2*n,n), dg:(-3*n+2*k-1)*n!^2/(2*n+1)/k!^2/(n-k)!^2/binomial(2*n,n)/2 -(-3*n+2*k-3)*n!^2/(2*n+1)/(k-1)!^2/(n-k+1)!^2/binomial(2*n,n)/2,for n':2 thru 4 do for k' thru n'-1 do(t:lratsubst([n=n',k=k'],fp-f-dg) ,if t#0 then(fl:false,disp(["n",n',"k",k',t]))),fl);
**also gives bogus error messages if replace ' by . Though surprisingy it works if replace the ' by _ eg as in n_ , k_
sorry there was one repeat but since there is no way to edit a post will have to keep it as is. That is a feature request would like to have: the ability to edit ones post.
a) There is a way of editing posts. Try the "Edit" button.
b) Your examples are unnecessarily elaborate. For your first example, I think this shows the issue:
This prints
k
two times, and not`1
and2
. That is,ex
is not re-evaluated in this context.c) Your last example, with
n'
, can't work, since Maxima treats'
as an operator, but it is not defined as a postfix operator.Closing as user error.
This "bug" report shows that the author has not understood how Maxima works.
An statement such as
associates the expression n-k to the symbol f, but if the symbols n and k are later associated to numbers, the expression associated to f continues to be n-k, and not the "value" of n minus the value of k.
Try something such as:
(and please use the "preview" button before posting your messages)
For this example:
then it does evaluate but in floating point when did not want floating point
It evaluates the variables because you used
ev
. It evaluates in floating-point because you used thenumer
argument toev
. This is all as documented. If you remove thenumer
flag and just writeev(...)
you will get what you expected, though in general it's better to usesubst
or defined functions (as Villate suggested) rather thanev
.