acer

32587 Reputation

29 Badges

20 years, 35 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

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)));

This is fast.

restart

k := 2; M := 3

2

3

for i while i <= 2^(k-1)*M do t[i] := (i-.5)/(2^(k-1)*M); eqs[i] := [9.797958972*a[1][1]+a[1][2]*(151.7893277*t[i]-37.94733192)+9.797958972*a[2][1]+a[2][2]*(151.7893277*t[i]-113.8419958)+(.3*(1.414213562*a[1][0]+a[1][1]*(9.797958972*t[i]-2.449489743)+a[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+1.414213562*a[2][0]+a[2][1]*(9.797958972*t[i]-7.348469229)+a[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830)))*(1.414213562*b[1][0]+b[1][1]*(9.797958972*t[i]-2.449489743)+b[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+1.414213562*b[2][0]+b[2][1]*(9.797958972*t[i]-7.348469229)+b[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830))-.2828427124*e[1][0]-.2*e[1][1]*(9.797958972*t[i]-2.449489743)-.2*e[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)-.2828427124*e[2][0]-.2*e[2][1]*(9.797958972*t[i]-7.348469229)-.2*e[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830)+.9899494934*a[1][0]+.7*a[1][1]*(9.797958972*t[i]-2.449489743)+.7*a[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+.9899494934*a[2][0]+.7*a[2][1]*(9.797958972*t[i]-7.348469229)+.7*a[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830) = .5, 9.797958972*b[1][1]+b[1][2]*(151.7893277*t[i]-37.94733192)+9.797958972*b[2][1]+b[2][2]*(151.7893277*t[i]-113.8419958)-(.3*(1.414213562*a[1][0]+a[1][1]*(9.797958972*t[i]-2.449489743)+a[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+1.414213562*a[2][0]+a[2][1]*(9.797958972*t[i]-7.348469229)+a[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830)))*(1.414213562*b[1][0]+b[1][1]*(9.797958972*t[i]-2.449489743)+b[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+1.414213562*b[2][0]+b[2][1]*(9.797958972*t[i]-7.348469229)+b[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830))+(.3*(1.414213562*b[1][0]+b[1][1]*(9.797958972*t[i]-2.449489743)+b[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+1.414213562*b[2][0]+b[2][1]*(9.797958972*t[i]-7.348469229)+b[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830)))*(1.414213562*c[1][0]+c[1][1]*(9.797958972*t[i]-2.449489743)+c[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+1.414213562*c[2][0]+c[2][1]*(9.797958972*t[i]-7.348469229)+c[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830))+1.414213562*b[1][0]+1.0*b[1][1]*(9.797958972*t[i]-2.449489743)+1.0*b[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+1.414213562*b[2][0]+1.0*b[2][1]*(9.797958972*t[i]-7.348469229)+1.0*b[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830) = 0, 9.797958972*c[1][1]+c[1][2]*(151.7893277*t[i]-37.94733192)+9.797958972*c[2][1]+c[2][2]*(151.7893277*t[i]-113.8419958)-(.3*(1.414213562*b[1][0]+b[1][1]*(9.797958972*t[i]-2.449489743)+b[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+1.414213562*b[2][0]+b[2][1]*(9.797958972*t[i]-7.348469229)+b[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830)))*(1.414213562*c[1][0]+c[1][1]*(9.797958972*t[i]-2.449489743)+c[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+1.414213562*c[2][0]+c[2][1]*(9.797958972*t[i]-7.348469229)+c[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830))+3.676955261*c[1][0]+2.6*c[1][1]*(9.797958972*t[i]-2.449489743)+2.6*c[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+3.676955261*c[2][0]+2.6*c[2][1]*(9.797958972*t[i]-7.348469229)+2.6*c[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830) = 0, 9.797958972*e[1][1]+e[1][2]*(151.7893277*t[i]-37.94733192)+9.797958972*e[2][1]+e[2][2]*(151.7893277*t[i]-113.8419958)-.5656854248*c[1][0]-.4*c[1][1]*(9.797958972*t[i]-2.449489743)-.4*c[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)-.5656854248*c[2][0]-.4*c[2][1]*(9.797958972*t[i]-7.348469229)-.4*c[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830)+2.969848480*e[1][0]+2.1*e[1][1]*(9.797958972*t[i]-2.449489743)+2.1*e[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+2.969848480*e[2][0]+2.1*e[2][1]*(9.797958972*t[i]-7.348469229)+2.1*e[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830) = 0, 9.797958972*g[1][1]+g[1][2]*(151.7893277*t[i]-37.94733192)+9.797958972*g[2][1]+g[2][2]*(151.7893277*t[i]-113.8419958)-1.697056274*e[1][0]-1.2*e[1][1]*(9.797958972*t[i]-2.449489743)-1.2*e[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)-1.697056274*e[2][0]-1.2*e[2][1]*(9.797958972*t[i]-7.348469229)-1.2*e[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830)+.9899494934*g[1][0]+.7*g[1][1]*(9.797958972*t[i]-2.449489743)+.7*g[1][2]*(4.743416490*(4*t[i]-1)^2-1.581138830)+.9899494934*g[2][0]+.7*g[2][1]*(9.797958972*t[i]-7.348469229)+.7*g[2][2]*(4.743416490*(4*t[i]-3)^2-1.581138830) = 0] end do

myEqs := [eqs[1][], eqs[2][], eqs[3][], eqs[4][], eqs[5][], eqs[6][]]; numelems(myEqs); numelems(indets(myEqs))

30

30

nms := indets(myEqs, And(name, Non(constant)))

{a[1][0], a[1][1], a[1][2], a[2][0], a[2][1], a[2][2], b[1][0], b[1][1], b[1][2], b[2][0], b[2][1], b[2][2], c[1][0], c[1][1], c[1][2], c[2][0], c[2][1], c[2][2], e[1][0], e[1][1], e[1][2], e[2][0], e[2][1], e[2][2], g[1][0], g[1][1], g[1][2], g[2][0], g[2][1], g[2][2]}

Q := {a[1][0], a[2][0], b[1][0], b[2][0], c[1][0], c[2][0], e[1][0], e[2][0], g[1][0], g[2][0]}

K := map(`=`, `minus`(nms, Q), 0)

{a[1][1] = 0, a[1][2] = 0, a[2][1] = 0, a[2][2] = 0, b[1][1] = 0, b[1][2] = 0, b[2][1] = 0, b[2][2] = 0, c[1][1] = 0, c[1][2] = 0, c[2][1] = 0, c[2][2] = 0, e[1][1] = 0, e[1][2] = 0, e[2][1] = 0, e[2][2] = 0, g[1][1] = 0, g[1][2] = 0, g[2][1] = 0, g[2][2] = 0}

fsol := fsolve(myEqs, `union`(nms, K), map(proc (s) options operator, arrow; s = -12 .. 12 end proc, Q))

{a[1][0] = 6.082134329, a[1][1] = 0.1857329281e-17, a[1][2] = -0.3205810176e-18, a[2][0] = -5.577058057, a[2][1] = 0.6258805490e-18, a[2][2] = 0.3205810193e-18, b[1][0] = 1.298305425, b[1][1] = 0.3738920656e-17, b[1][2] = 0.4839615888e-18, b[2][0] = -1.298305425, b[2][1] = -0.7487670954e-17, b[2][2] = -0.4839615925e-18, c[1][0] = 1.254988469, c[1][1] = -0.1644282045e-19, c[1][2] = 0.6623875451e-21, c[2][0] = -1.254988469, c[2][1] = 0.1131198859e-19, c[2][2] = -0.6623875456e-21, e[1][0] = 1.524516194, e[1][1] = 0.5330887545e-20, e[1][2] = -0.5635624424e-22, e[2][0] = -1.524516194, e[2][1] = -0.4894353953e-20, e[2][2] = 0.5635624411e-22, g[1][0] = -2.819211872, g[1][1] = 0.4869251300e-22, g[1][2] = 0., g[2][0] = 2.819211872, g[2][1] = -0.9324345846e-22, g[2][2] = 0.}

eval(map(rhs-lhs, myEqs), fsol)

[0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.3548181684e-18, -0.7652104661e-18, -0.2723049339e-20, 0.1871247963e-21, 0., 0., 0., 0., 0., 0.]

``

Download for_k=2_M=3_ac.mw

restart;

kernelopts(version);

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

conv_VerticalPlate_proc := proc (T__side, T__amb, Area, L, varepsilon, q__i)
 
  local sigma, g, T__s, `T__&infin;`, T__f, k, rho, Cp, Pr, mu, nu, alpha, beta, Ra__L, Nus__L, h, q__h, q__r, q__total;

  uses Units:-Simple, ThermophysicalData;
  
  g := 9.81*Unit('m'/'s'^2); sigma := 5.6703*Unit('W'/('m'^2*'K'^4))/10^8;

  # Return unevaluated if the first argument is not numeric or numeric*Unit(...).
  # You could also do the same for the other arguments.
  if not convert(T__side, unit_free)::numeric then return 'procname'(args); end if;
 
  if type(T__side, with_unit) then
    T__s := convert(T__side, temperature, kelvin)
  elif T__side = 0 then
    T__s := 273.15*Unit('K')
  else
    T__s := T__side*Unit('K')
  end if;
 
  if type(T__amb, with_unit) then
    `T__&infin;` := convert(T__amb, temperature, kelvin)
  elif T__amb = 0 then
    `T__&infin;` := 273.15*Unit('K')
  else
    `T__&infin;` := T__amb*Unit('K')
  end if;
 
  T__f := (1/2)*T__s+(1/2)*`T__&infin;`;
 
  k := Property(thermal_conductivity, temperature = T__f, pressure = Unit('atm'), air);
  rho := Property(density, temperature = T__f, pressure = Unit('atm'), air);
  Cp := Property(Cpmass, temperature = T__f, pressure = Unit('atm'), air);
  Pr := Property(prandtl, temperature = T__f, pressure = Unit('atm'), air);
  mu := Property(viscosity, temperature = T__f, pressure = Unit('atm'), air);
 
  if type(k, with_unit) and type(rho, with_unit) and type(Cp, with_unit) and type(mu, has_unit) then
    nu := mu/rho;
    alpha := k/(rho*Cp);
    beta := 1.0/T__f;
    Ra__L := g*beta*abs(T__s-`T__&infin;`)*L^3/(alpha*nu);
    Nus__L := (.825+.387*(Ra__L^(1/6))/(((1+(.492/Pr)^(9/16))^(8/27))))^2;
    h := Nus__L*k/L; q__h := h*(T__s-`T__&infin;`)*Area;
    q__r := varepsilon*sigma*(T__s^4-`T__&infin;`^4)*Area;
    q__total := q__h+q__r
  else
    0.1e-6*Unit('W')
  end if
 
end proc:

conv_VerticalPlate_proc(31.5*Unit('degC'), 20*Unit('degC'), Unit('m'^2), Unit('m'), .9);

100.8567010*Units:-Unit(W)

# Returns unevaluated for non-numeric x.
conv_VerticalPlate_proc(x*Unit('degC'), 20*Unit('degC'), Unit('m'^2), Unit('m'), .9);

conv_VerticalPlate_proc(x*Units:-Unit(`&deg;C`), 20*Units:-Unit(`&deg;C`), Units:-Unit(m^2), Units:-Unit(m), .9)

fsolve(100*Unit('W')-conv_VerticalPlate_proc(x, 20*Unit('degC'),
                                             Unit('m'^2), Unit('m'), .9),
       x=1*Unit('degC') .. 100*Unit('degC'));

31.41491339*Units:-Unit(`&deg;C`)

fsolve(x->(100*Unit('W')-conv_VerticalPlate_proc(x*Unit('degC'), 20*Unit('degC'),
                                                 Unit('m'^2), Unit('m'), .9))/Unit('W'),
       1 .. 100)*Unit(degC);

31.41491339*Units:-Unit(`&deg;C`)

plot(x->(100*Unit('W')-conv_VerticalPlate_proc(x*Unit('degC'), 20*Unit('degC'),
                                               Unit('m'^2), Unit('m'), .9))/Unit('W'),
     1 .. 100, labels=[Unit(degC),Unit(W)],
     adaptive=false, numpoints=30, size=[500,200], gridlines=false);

 

Download fsolve_Therm_units.mw

restart;

a:=[3,3,1,5,7,8,5,4,4,4,4,3,9];

          a := [3, 3, 1, 5, 7, 8, 5, 4, 4, 4, 4, 3, 9]

subsop(ListTools:-Search(4,a)=NULL,a);

              [3, 3, 1, 5, 7, 8, 5, 4, 4, 4, 3, 9]

Or, as a re-usable procedure,

R:=(N,A)->(NN->`if`(NN>0,subsop(NN=NULL,A),FAIL))(ListTools:-Search(N,A),A):

R(4, a);

              [3, 3, 1, 5, 7, 8, 5, 4, 4, 4, 3, 9]

R(14,a);

                              FAIL
You didn't say what you wanted to happen if the value were not present.

restart;

kernelopts(version);

`Maple 2017.2, X86 64 LINUX, Jul 19 2017, Build ID 1247392`

ee := (x-1)*(x^3-9*x^2+4);

(x-1)*(x^3-9*x^2+4)

evalc([solve(ee,x)]);

[1, 6*cos((1/3)*arctan((2/25)*26^(1/2)))+3, -3*cos((1/3)*arctan((2/25)*26^(1/2)))+3-3*3^(1/2)*sin((1/3)*arctan((2/25)*26^(1/2))), -3*cos((1/3)*arctan((2/25)*26^(1/2)))+3+3*3^(1/2)*sin((1/3)*arctan((2/25)*26^(1/2)))]

evalf(%);

[1., 8.950064702, -.6440222815, .6939575795]

[fsolve(ee,x)];

[-.6440222815, .6939575790, 1., 8.950064703]

[fsolve(ee,x,maxsols=4)];

[-.6440222815, .6939575790, 1., 8.950064703]

Student:-Calculus1:-Roots(ee,x,numeric);

[-.6440222815, .6939575790, 1., 8.950064703]

 

Download rootsqu.mw

Be careful using Calculus1:-Roots with the numeric option, since you may have to supply a range for x in order to get all the roots. (Not this example, since the default range is x=-10..10 for the numeric option.)

Notice also that applying evalf to the exact, symbolic roots can incur roundoff error (in this example, using default precision not all the last digits are correct).

Inside the procedure there is a call to procname. That means the procedure calls itself there. It's not passing itself enough arguments to match its own expected number of parameters.

The call to procname is a recursive call. But Newton's method can be implemented quite simply with an iterative approach (which you mentioned as being part of the assignment), which is what your do-loop is attempting to accomplish.

So, why did you put a call to procname there? What did you hope to accomplish with it?

What version are you using? In my Maple 2018.0 I am seeing the prettyprinted infinity symbol in the Table.

Does it change if you set interface(typesetting=extended): ?

Oh, I see now that the Tabulate command has its own option for that. I'd forgotten that was there. It's there so that you don't have to change that interface setting globally in the worksheet (even if only temporarily).  So try it like so, while retaining your standard typesetting level for the worksheet,

    restart;
    a:=infinity;
    DocumentTools:-Tabulate([a], typesetting=extended):

Why are you using  P*(Q-q) in Fract1 and p*(Q-q) in Fract?

If you're going to try and use a functional programming approach then you might want to start off by building up the inner step(s) and examining the intermediate results. Or use the debugger and stopat...

Take a look at the results from isolve, for your original.

See if you can figure out whether this stands up (and I mean in terms of what it does, not just what it returns).

Fract1 := proc (P::posint, Q::posint)
    local p, q, t1, Z;
    t1 := [isolve({(P-p)*q-p*(Q-q) = 1},Z)];
    t1 := eval(t1, Z=0);
    `~`[`~`[`/`@op]](select(type,
                            map2(eval, [[p,q], [P,Q], [(P-p),(Q-q)]],
                                 t1),
                            [[posint$2]$3]))[][];
end proc;

[edit] Note the use of local name Z for the parameter introduced by isolve. That is there so that the procedure Fract1 doesn't break after side-computations like, say, solve({sin(Pi*n)=1},n,allsolutions) .

Are you trying to say that you want a new table with the entries from both?

If so then I'll let you inject that wherever you want it inside your procedure. You can ignore the fact that I made it return the two tables, and undo that.

socau := proc (sc) local sccl, sccl2, sccl3, nhanbiet, n, td, ii, t, nhanbiet1, kk, bnb, thonghieu, n2, thonghieu2, bth, vandung, n3, vandung3, bvd, bang1; sccl := round((2/5)*sc); sccl2 := round((2/5)*sc); sccl3 := round((1/5)*sc); nhanbiet := [1, 2, 3, 4, 5]; n := nops(nhanbiet); td := rand(0. .. 1.00); for ii to n do t := trunc(n*td()+1); nhanbiet1[ii] := nhanbiet[t]; nhanbiet[t] := nhanbiet[n]; n := n-1 end do; for kk to sccl do bnb[kk] := nhanbiet1[kk] end do; print(nhanbiet1); print(bnb); thonghieu := [6, 7, 8, 9, 10, 11]; n2 := nops(thonghieu); td := rand(0. .. 1.00); for ii to n2 do t := trunc(n2*td()+1); thonghieu2[ii] := thonghieu[t]; thonghieu[t] := thonghieu[n2]; n2 := n2-1 end do; for kk to sccl2 do bth[kk] := thonghieu2[kk] end do; print(thonghieu2); print(bth); return eval(bnb), eval(bth) end proc

T1, T2 := socau(11)

table( [( 1 ) = 2, ( 2 ) = 4, ( 3 ) = 1, ( 4 ) = 5 ] ), table( [( 1 ) = 9, ( 2 ) = 10, ( 3 ) = 7, ( 4 ) = 11 ] )

NULL

convert([entries(T1, 'nolist'), entries(T2, 'nolist')], table)

table( [( 1 ) = 2, ( 2 ) = 4, ( 3 ) = 1, ( 4 ) = 5, ( 5 ) = 9, ( 6 ) = 10, ( 7 ) = 7, ( 8 ) = 11 ] )

``

Download help_table_ac.mw

First 160 161 162 163 164 165 166 Last Page 162 of 338