acer

32343 Reputation

29 Badges

19 years, 327 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

restart;

kernelopts(version);

`Maple 2018.0, X86 64 LINUX, Mar 9 2018, Build ID 1298750`

G := solve(sin(x*Pi/180)=sin(x),x,allsolutions);

180*Pi*(2*_Z2+_B2)/(Pi+360*_B2-180)

b := select(is,indets(G,name),OrProp(0,1)); # 0,1 valued

{_B2}

r := select(is,indets(G,name) minus b,integer); # integer valued

{_Z2}

S:=[seq(seq(eval(G,[b[1]=i,r[1]=j]),i=[0,1]),j=[-2,-1,0,1,2])];

[-720*Pi/(Pi-180), -540*Pi/(180+Pi), -360*Pi/(Pi-180), -180*Pi/(180+Pi), 0, 180*Pi/(180+Pi), 360*Pi/(Pi-180), 540*Pi/(180+Pi), 720*Pi/(Pi-180), 900*Pi/(180+Pi)]

evalf(S);

[12.78959109, -9.263106254, 6.394795546, -3.087702085, 0., 3.087702085, -6.394795546, 9.263106254, -12.78959109, 15.43851042]

Student:-Calculus1:-Roots(sin(x*Pi/180) = sin(x), x=-4*Pi .. 4*Pi);

Warning, some roots are returned as numeric approximations

[-9.263106254, -6.394795546, -3.087702085, 0, 3.087702085, 6.394795546, 9.263106254]

fsolve(sin(x*Pi/180) = sin(x), x, -4*Pi .. 4*Pi, maxsols=20);

-9.263106258, -6.394795545, -3.087702086, 0., 3.087702085, 6.394795544, 9.263106257

 

Download solve_example.mw

You can get closer to the exact form you requested.

Be careful about the multiplication signs in the definition of Gc. Notice them in the terms k*(-b*s+1) and s*(t*c+b) .

restart;

Gc := (s^2*t^2+2*s*t*x+1)*(-b*s+1)/(k*(-b*s+1)*s*(t*c+b));

(s^2*t^2+2*s*t*x+1)/(k*s*(c*t+b))

new := expand(convert(Gc,parfrac,s));

t^2*s/(k*(c*t+b))+2*t*x/(k*(c*t+b))+1/(k*s*(c*t+b))

temp := sort(collect(new,s,u->u/coeff(new,s,0)),
             order=plex(s),ascending);

1+(1/2)/(t*x*s)+(1/2)*t*s/x

new2 := coeff(new,s,0)*temp;

2*t*x*(1+(1/2)/(t*x*s)+(1/2)*t*s/x)/(k*(c*t+b))

coeff(new,s,0); # A

2*t*x/(k*(c*t+b))

1/coeff(temp,s,-1); # B

2*t*x

coeff(temp,s,1); # C

(1/2)*t/x

new3 := `%*`(coeff(new,s,0), temp):
InertForm:-Display(new3, inert=false);

2*t*x*(1+1/(2*t*x*s)+t*s/(2*x))/(k*(c*t+b))

simplify(Gc-new);
simplify(Gc-new2);
simplify(Gc-expand(new3));

0

0

0

 

Download form.mw

The problem seems to be that the backend MapleNet server of this site cannot handle the new default rtablesize="[10, 10]" attribute in the MapleNet-Properties section of the XML format .mw file.

If I execute the interface command using the older form (a single value) then the worksheet gets saved in Maple 2019.0 with that form in the .mw XML file's MapleNet-Properties. A subsequent upload to this site then succeeds.

#
# Recursive Fibonacci generator
#
  myFib:= proc(n::integer)
               option remember;
               if   n=1
               then return 1
               elif n=0
               then return 0
               else return myFib(n-1)+myFib(n-2):
               fi:
          end proc:

  seq(myFib(j), j=0..20);

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765

(1)

interface(rtablesize=10):

 


Download fibon2019_rtablesize.mw

I can even delete that input line (as long as I've executed it). And it still uploads OK here.

#
# Recursive Fibonacci generator
#
  myFib:= proc(n::integer)
               option remember;
               if   n=1
               then return 1
               elif n=0
               then return 0
               else return myFib(n-1)+myFib(n-2):
               fi:
          end proc:

  seq(myFib(j), j=0..20);

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765

(1)

Download fibon2019_rtablesize_deleted.mw

I can even put interface(rtablesize=10) inside my personal ~/.mapleinit file on Linux, launch the Maple 2019.0 GUI without the -s option, and save and upload OK here.

#
# Recursive Fibonacci generator
#
  myFib:= proc(n::integer)
               option remember;
               if   n=1
               then return 1
               elif n=0
               then return 0
               else return myFib(n-1)+myFib(n-2):
               fi:
          end proc:

  seq(myFib(j), j=0..20);

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765

(1)

 

Download fibon2019_rtablesize_mapleinit.mw

So for now I suppose that a last step before saving/uploading could be to execute the interface command with the older syntax of a single value for rtablesize. And delete that line if you choose.

It's a bit of an effort, but not nearly as much of an extra effort as having to execute all 2D plots under gridlines=false just so that the back-end server doesn't render with grid-lines by default (another, much older bug here).

I would really like to see the back-end server of this site updated, so that it would handle default 2D plot grid-lines properly, not have this rtablesize issue, and also allow inlining of Task regions as embedded by Explore, PlotBuilderImageTools:-Embed, DocumentTools:-Tabulate, etc.

How would applying Grid:-Seq to the call to f (for each M[i,j] ) improve via parallelization? I dont see how the syntax you gave makes any sense.

How about using Grid:-Map to apply f to the Matrix M? There's no guarantee it will always improve performance but that seems like the natural syntax for the job as you've described it.

Or (slightly less direct to code) how about using Grid-Seq to generate the n*m results of f(M[i,j]) but with a range argument supplied to Grid:-Seq itself.

Why don't you show us your f and your Matrix M, in a complete working example as an uploaded worksheet?

Just for fun. If you really want to generate the frames with their own calls to plot with colorscheme then the key is to have the end-points of the curve's parametrization depend on the animating variable and to use the "linear" color scheme.

restart;
N:=75:

S := [seq(plot([t + N/10*(1 + cos(a)), N/10*(1 + sin(a)),
                a = 0 - Pi/2 - t/(N-1)*2*Pi .. 2*Pi - Pi/2 - t/(N-1)*2*Pi],
               thickness=3,
               colorscheme = ["linear", ["Blue", "Yellow"]]),
          t=0..N)]:

plots:-display(S, gridlines=false, size=[700, 200],
               scaling=constrained, insequence=true);

In Maple 2018 you could call solve without the restrictive option [lambda[1]], and get a more full picture.

This call to isolate works in Maple 16.02, and perhaps it does in your Maple 13 as well.

Calling simplify and collect on the original makes the result pretty straightforward to obtain (you wouldn't really even need isolate).

restart;

ee := lambda[2]*mu[2]^2*(lambda[2]+mu[2])*lambda[1]/(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)+lambda[2]*mu[2]*(mu[2]^2+mu[2]*lambda[2]+lambda[2]^2)*lambda[1]/(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)+mu[2]^4*lambda[2]*lambda[1]/((lambda[1]+mu[2])*(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4))+(1/2)*(mu[2]^3*lambda[1]+mu[2]^3*lambda[2]+lambda[1]*lambda[2]*mu[2]^2+mu[2]^2*lambda[2]^2+mu[2]*lambda[2]^3+mu[2]*lambda[1]*lambda[2]^2+lambda[1]*lambda[2]^3)*lambda[2]*lambda[1]/((lambda[1]+mu[2])*(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4))+3*mu[2]^4*lambda[1]/(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)+mu[1]*mu[2]^4*lambda[1]/((4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)*(lambda[2]+mu[1]))+mu[2]^4*lambda[2]*lambda[1]/((4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)*(lambda[2]+mu[1]))+mu[2]^3*lambda[2]*lambda[1]/(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)+(1/2)*(mu[2]^3*lambda[1]+mu[2]^3*lambda[2]+lambda[1]*lambda[2]*mu[2]^2+mu[2]^2*lambda[2]^2+mu[2]*lambda[2]^3+mu[2]*lambda[1]*lambda[2]^2+lambda[1]*lambda[2]^3)*lambda[2]*lambda[1]/(4*mu[2]^5+4*mu[2]^4*lambda[1]+4*mu[2]^4*lambda[2]+4*mu[2]^3*lambda[1]*lambda[2]+3*mu[2]^3*lambda[2]^2+3*lambda[1]*lambda[2]^2*mu[2]^2+2*mu[2]^2*lambda[2]^3+2*lambda[1]*lambda[2]^3*mu[2]+mu[2]*lambda[2]^4+lambda[1]*lambda[2]^4)-3*mu[1]*mu[2]^4/(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)+mu[1]*mu[2]^4*lambda[2]/((4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)*(lambda[2]+mu[1]))+mu[1]^2*mu[2]^4/((4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)*(lambda[2]+mu[1])):

isolate(ee < 0, lambda[1]);

lambda[1] < 3*mu[1]*mu[2]^4/(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)-mu[1]*mu[2]^4*lambda[2]/((4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)*(lambda[2]+mu[1]))-mu[1]^2*mu[2]^4/((4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)*(lambda[2]+mu[1]))

(1)

simplify(%);

lambda[1] < 2*mu[1]*mu[2]^4/(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)

(2)

new := collect(simplify(ee),lambda[1]);

lambda[1]-2*mu[1]*mu[2]^4/(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)

(3)

isolate(new < 0, lambda[1]);

lambda[1] < 2*mu[1]*mu[2]^4/(4*mu[2]^4+4*mu[2]^3*lambda[2]+3*mu[2]^2*lambda[2]^2+2*mu[2]*lambda[2]^3+lambda[2]^4)

(4)

 

ineq_16.02.mw

Please check that I got the Support right, for pdf and cdf being zero for x<=m.  And, well, check it all.

[edit: The option remember on the ModuleApply is not crucial. Remove if it causes any funny business related to invoking Levy with the same parameter values at different Digits -- I didn't check.]

(As usual, sigh, the plots look much nicer in Maple itself.)

restart:

plots:-setoptions(gridlines=false):

Levy := module()
  local pdf, cdf, samplingMethod, ModuleApply;
  ModuleApply := proc(m,s)
    option remember;
    Statistics:-Distribution(
      ':-PDF'=(x->pdf(m,s,x)),
      ':-CDF'= (x->cdf(m,s,x)),
      ':-RandomSample' = proc(N::nonnegint)
                           # optionally throw error if m,s not numeric
                           samplingMethod(m,s,N);
                         end proc
                            );
  end proc:
  pdf := proc(m,s,x)
    piecewise(x<=m, 0, sqrt(s/2/Pi)*exp(-s/2/(x-m))/(x-m)^(3/2));
  end proc;
  cdf := proc(m,s,x)
    piecewise(x<=m, 0, erfc(sqrt(s/2/(x-m))));
  end proc;
  samplingMethod := proc(m,s,N)
    uses ST=Statistics;
    m +~ s /~ ( ST:-Quantile~(':-Normal'(0, 1),
                              ST:-Sample(':-Uniform'(1/2, 1), N)) )^~2
  end proc;
end module:

 

Levy(0,1);

_m140015542866272

# test without loading Statistics at top level
X := Statistics:-RandomVariable(Levy(m,s)):
Statistics:-PDF(X, x);
Statistics:-CDF(X, x);
Statistics:-Sample(X, 5); # could have this throw an error, see comment in defn

piecewise(x <= m, 0, sqrt(2)*sqrt(s/Pi)*exp(-s/(2*(x-m)))/(2*(x-m)^(3/2)))

piecewise(x <= m, 0, erfc((1/2)*sqrt(2)*sqrt(s/(x-m))))

Vector[row](%id = 18446884089173118974)

# test without loading Statistics at top level
X := Statistics:-RandomVariable(Levy(0,1)):
Statistics:-PDF(X, x);
Statistics:-CDF(X, x);
Statistics:-Sample(X, 5);
Statistics:-Probability(X<40);
evalf(%), Statistics:-Probability(X<40, numeric);
plot(Statistics:-PDF(X,x), x=0..5, size=[400,200]);
plot(Statistics:-PDF(X,x), x=0..1000, axis[2]=[mode=log], size=[400,200]);
plot(Statistics:-CDF(X,x), x=0..100, size=[400,200]);
Statistics:-Histogram(Statistics:-Sample(X, 10^3),
          binbounds=[seq(j+1/2,j=0..1000)],
          axis[2]=[mode=log], size=[400,200]);

piecewise(x <= 0, 0, sqrt(2)*exp(-1/(2*x))/(2*sqrt(Pi)*x^(3/2)))

piecewise(x <= 0, 0, erfc((1/2)*sqrt(2)*sqrt(1/x)))

Vector[row](%id = 18446884089173114998)

erfc((1/20)*5^(1/2))

.8743670612, .8743670612

with(Statistics):
X := RandomVariable(Levy(0,10^(-1))):
PDF(X, x);
CDF(X, x);
Probability(X<40);
evalf(%), Probability(X<40, numeric);
plot(PDF(X,x), x=0..1, size=[400,200]);
plot(PDF(X,x), x=0..100, axis[2]=[mode=log], size=[400,200]);
plot(CDF(X,x), x=0..10, size=[400,200]);
Histogram(Sample(X, 10^3),
          binbounds=[seq(j+1/2,j=0..100)],
          axis[2]=[mode=log], size=[400,200]);

piecewise(x <= 0, 0, sqrt(5)*exp(-1/(20*x))/(10*sqrt(Pi)*x^(3/2)))

piecewise(x <= 0, 0, erfc((1/10)*5^(1/2)*(1/x)^(1/2)))

erfc((1/40)*2^(1/2))

.9601223883, .9601223883

X := RandomVariable(Levy(100,1)):
PDF(X, x);
CDF(X, x);
Probability(X<100);
Probability(X<140);
evalf(%), Probability(X<140, numeric);
plot(PDF(X,x), x=100..105, size=[400,200]);
plot(PDF(X,x), x=0..1000, axis[2]=[mode=log], size=[400,200]);
plot(CDF(X,x), x=0..1000, size=[400,200]);
Histogram(Sample(X, 10^3),
          binbounds=[seq(j+1/2,j=0..500)],
          axis[2]=[mode=log], size=[400,200]);

piecewise(x <= 100, 0, sqrt(2)*exp(-1/(2*(-100+x)))/(2*sqrt(Pi)*(-100+x)^(3/2)))

piecewise(x <= 100, 0, erfc((1/2)*2^(1/2)*(1/(-100+x))^(1/2)))

0

erfc((1/20)*5^(1/2))

.8743670612, .8743670612

Ldist := Distribution(Levy(0,1)):
PDF(Ldist, x);
CDF(Ldist, x);
Support(Ldist);

piecewise(x <= 0, 0, sqrt(2)*exp(-1/(2*x))/(2*sqrt(Pi)*x^(3/2)))

piecewise(x <= 0, 0, erfc((1/2)*2^(1/2)*(1/x)^(1/2)))

RealRange(Open(0), infinity)

Ldist := Distribution(Levy(m,s)):
PDF(Ldist, x);
CDF(Ldist, x);
Support(Ldist, output=range);

piecewise(x <= m, 0, sqrt(2)*sqrt(s/Pi)*exp(-s/(2*(x-m)))/(2*(x-m)^(3/2)))

piecewise(x <= m, 0, erfc((1/2)*2^(1/2)*(s/(x-m))^(1/2)))

m .. infinity

plot([seq(PDF(RandomVariable(Levy(0,c)),x), c=[1/2,1,2,4,8])],
     x=0..3, view=0..1, size=[500,400],
     legend=[seq('c'=c,c=[0.5,1,2,4,8])],
     legendstyle=[location=right],
     color=[red,black,cyan,blue,green]);

 

Download My-own-random-variable_ac.mw

This is an example of premature evaluation.

The argument passed to plot is evaluated up front. But that produces an error since xi does not yet have a numeric value and so the conditional test fails.

Two common ways to deal with this are:
1) delay the evalauation of the first argument to plot, using single right-quotes (unevaluation quotes).
2) use the operator form calling sequence of the plot command.

I also corrected your procedure to have its first parameter be xi rather than xih , and to return an expression instead of an operator.

restart

with(linalg):

FS := proc (xi, m0, `&xi;wp`, `&mu;v`) local f; if abs(xi) <= 1 then f := xi*m0*(1-abs(xi))^2+xi*abs(xi)*(3-2*abs(xi)) else f := signum(xi)*((`&xi;wp`-1)^2+`&mu;v`*(abs(xi)-1)^2)/((`&xi;wp`-1)^2+(abs(xi)-1)^2) end if end proc:

 

FS(xi, 1.5, 2, .8)

Error, (in FS) cannot determine if this expression is true or false: abs(xi) <= 1

 

``

plot(('FS')(xi, 1.5, 2, .8), xi = 0 .. 1.5);

 

plot(proc (xi) options operator, arrow; FS(xi, 1.5, 2, .8) end proc, 0 .. 1.5);

 

``

Download plottestac.mw

If your Maple-browser connection is set up correctly then in modern Maple you can click on the purple error message and get sent to this webpage, which happens to cover this issue with a similar example.

You can use the so-called 2-argument calling sequence of the eval command, to pick off one or more of the p[i] values.  Basically, this evaluates the first argument using the list of equations as the second argument.

And the list of equations is obtained as the second entry of the original expression (list).

Remove any of the plotting options that you don't like (gridlines, tickmarks).

restart;

ee :=  [.358700275060090779,
        [p[0] = .192413186080606, p[1] = 0.906594292940704e-1,
         p[2] = 0.677108912885780e-1, p[3] = 0.609551830556988e-1,
         p[4] = 0.589744573790909e-1, p[5] = 0.585737058072817e-1,
         p[6] = 0.589744573787748e-1, p[7] = 0.609551830550955e-1,
         p[8] = 0.677108912877626e-1, p[9] = 0.906594292931833e-1,
         p[10] = .192413186079858]]:

eval(p[4],ee[2] );

0.589744573790909e-1

L := eval([seq(p[i],i=0..10)],ee[2]);

[.192413186080606, 0.906594292940704e-1, 0.677108912885780e-1, 0.609551830556988e-1, 0.589744573790909e-1, 0.585737058072817e-1, 0.589744573787748e-1, 0.609551830550955e-1, 0.677108912877626e-1, 0.906594292931833e-1, .192413186079858]

K := [seq(i=p[i-1],i=1..11)]:
Statistics:-LineChart(L,
                      #view=0..max(L),
                      axis[2]=[gridlines=L,
                               #tickmarks=[0, seq(min(L)..max(L),(max(L)-min(L))/6)]
                               tickmarks=[0,op(L)]
                              ],
                      axis[1]=[gridlines=K, tickmarks=K]
                      );

 

Download listplot.mw

As far as I know there is no part of stock Maple other than the very limited CUDA linear-algebra package that uses the GPU for doing any (mathematical) computation other than plot rendering.

I'm not aware of any publicly available, 3rd party add-on that does so either.

[edit. I added mention of the very limited CUDA package, since Carl asked about it.]

Your main problem here is not how parse works withing a module, but rather it is that you're mixing up how you utilize uses . (You also forgot to call parse in the module, but that's not why GetProperty wasn't working.)

If you are going to utilize the syntax  uses DT=DocumentTools;   then you need to accompancy that with DT:-GetProperty(...) .

You were mixing up your usage styles.

Composition_of_Functions_Doubt_ac.mw

 

You can parse the string to obtain a math expression for the MathContainer. Ie,

SetProperty("MathContainer0","expression",parse(GetProperty("TextArea0","value")));

Download MathContainerEntry_Doubt_ac.mw

Using the DocumentTools:-Tabulate command you can get an effect something like an animation, but with the Sample and Histogram generated on the fly. You may find it a bit easier than setting up a whole "App" with Embedded Components.

Adjust to taste.

restart:

with(Statistics):

Dice1 := RandomVariable(DiscreteUniform(1, 6)):
Dice2 := RandomVariable(DiscreteUniform(1, 6)):

 

F := proc(f, minp::posint, maxp::posint, hi,
          {delay::And(numeric,nonnegative):=0.0})
  local j, meanf, N, S;
  uses DocumentTools, Statistics, Threads;
  meanf := Mean(f(Dice1,Dice2));
  for N from minp to maxp do
    S := Sample(f(Dice1,Dice2), 2^N);
    Tabulate(':-exterior'=':-none', ':-interior'=':-none',
             ':-widthmode'=':-pixels', ':-width'=800,
             [[''f(Dice1,Dice2)'' = f(''Dice1'',''Dice2''),
               ''Mean(f(Dice1,Dice2))'' = meanf],
              Histogram(S, ':-binbounds'=[seq( j+1/2, j=min(S)-1..max(S))],
                        ':-view'=0..hi/36.0,
                        ':-title'=:-typeset(`#mtext("sample size")`=2^N),
                        ':-axis[2]'=[':-tickmarks'=[0=0,
                                                    seq(i/36=sprintf("%a/36",i),i=1..hi-1)],
                                     ':-gridlines'=[seq(i/36,i=1..hi-1)]])
             ]);
    Sleep(delay);
  end do;
  NULL;
end proc:

 

f1 := (a,b) -> a + b:

F(f1, 5, 17, 7, delay=0.25);

 

 

 

 

 

f1(Dice1, Dice2) = Dice1+Dice2

Mean(f1(Dice1, Dice2)) = 7

 

 

 

 

 

K := (a,b) -> piecewise( Or(a=1, b=1), -4, abs(b-a) ):

F(K, 5, 17, 12, delay=0.25);

 

 

K(Dice1, Dice2) = piecewise(Dice1 = 1 or Dice2 = 1, -4, abs(-Dice2+Dice1))

Mean(K(Dice1, Dice2)) = -1/9

 

 

 

 

 

histo_fun.mw

Have you tried relerr=10.0^(-x-7)  ?

restart

Chargement Statistics

NULL

with(plots)

nu := 3

X := RandomVariable(ChiSquare(nu))

PDF(X, x)

f := proc (x) options operator, arrow; PDF(X, x) end proc

NULL

plot(f(x), x = 0 .. 10, thickness = 3, gridlines = true, size = [300, 300], title = Typesetting:-mrow(Typesetting:-mtext("Fonction densité de ", color = red), Typesetting:-msup(Typesetting:-mi("chi"), Typesetting:-mn("2"), mathcolor = red), Typesetting:-mtext("\navec 3. d.d.l", color = red)), font = [title, "ARIAL", 12, BOLD])

``

Download PDFColorTitle_ac.mw

You may find this kind of step useful in construction of such things:

foo := chi^2;
sprintf("%a", Typesetting:-Typeset(Typesetting:-EV(foo)));
First 157 158 159 160 161 162 163 Last Page 159 of 336