Sponsored links: Algebra eBooks
 

Related

arrayinfo-block-cons-if-sort

P [s1,s2,s3,s4,s5] :=...

srt[s1,s2,s3,s4,s5] :...

P [s1,s2,s3,s4,s5] :=...

Calculate

arrayinfo-block-if-sort

P (s1,s2,s3,s4,s5) :=...

foo[sort([3,5,1,5,1])...

if foo[sort([3,5,0,5,...

Calculate

arrayinfo-block-if-sort

P (s1,s2,s3,s4,s5) :=...

foo[sort([3,5,1,5,1])...

foo[sort([3,5,1,5,1])...

Calculate

arrayinfo-block-cons-if-sort

P [s1,s2,s3,s4,s5] :=...

srt[s1,s2,s3,s4,s5] :...

P [s1,s2,s3,s4,s5] :=...

Calculate

arrayinfo-block-if-sort-subvar

P (s1,s2,s3,s4,s5) :=...

foo[sort([3,5,1,5,1])...

if foo[sort([3,5,0,5,...

Calculate

arrayinfo-block-if-sort

P (s1,s2,s3,s4,s5) :=...

foo[sort([3,5,1,5,1])...

if foo[sort([3,5,0,5,...

Calculate

arrayinfo-block-cons-if-sort

P [s1,s2,s3,s4,s5] :=...

srt[s1,s2,s3,s4,s5] :...

P [s1,s2,s3,s4,s5] :=...

Calculate

arrayinfo-load

load(worldmap) ;

arrayinfo(boundaries_...

Calculate

arrayinfo-block-cons-if-sort

P [s1,s2,s3,s4,s5] :=...

srt[s1,s2,s3,s4,s5] :...

P [s1,s2,s3,s4,s5] :=...

Calculate

arrayinfo-block-if-sort

P (s1,s2,s3,s4,s5) :=...

foo[sort([3,5,1,5,1])...

if foo[sort([3,5,1,5,...

Calculate

arrayinfo

Run Example
(%i1)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(s1, s2, s3, s4, s5) := block([tot : s1 + s2 + s3 + s4 + s5], 
s1
--- (if s1 > 1 then P(s1 - 1, s2, s3, s4, s5) else 1)
tot
                           P(s1, s2 - 1, s3, s4, s5) s2
 + (if s2 <= 1 then 0 else ----------------------------)
                                       tot
                           P(s1, s2, s3 - 1, s4, s5) s3
 + (if s3 <= 1 then 0 else ----------------------------)
                                       tot
                           P(s1, s2, s3, s4 - 1, s5) s4
 + (if s4 <= 1 then 0 else ----------------------------)
                                       tot
                           P(s1, s2, s3, s4, s5 - 1) s5
 + (if s5 <= 1 then 0 else ----------------------------))
                                       tot
(%i2) foo[sort([3,5,1,5,1])]:42;
(%o2)                                 42
(%i3) if foo[sort([3,5,0,5,1])] then foo[sort([3,5,0,5,1])]+12;
(%o3)      if foo                then foo                      + 12
                 [0, 1, 3, 5, 5]         sort([3, 5, 0, 5, 1])
(%i4) arrayinfo(foo);
(%o4)                   [hashed, 1, [[1, 1, 3, 5, 5]]]
(%i5) 
Run Example
load(ctensor);
(%o1)          /usr/share/maxima/5.21.1/share/tensor/ctensor.mac
(%i2) ct_coords:[t,r,theta,phi];
(%o2)                         [t, r, theta, phi]
(%i3) lg:matrix([-1,0,0,0],[0,1,0,0],[0,0,r^2,0],[0,0,0,r^2*sin(theta)^2]);
                        [ - 1  0  0         0        ]
                        [                            ]
                        [  0   1  0         0        ]
                        [                            ]
(%o3)                   [          2                 ]
                        [  0   0  r         0        ]
                        [                            ]
                        [              2    2        ]
                        [  0   0  0   r  sin (theta) ]
(%i4) christof(lcs);
(%t4)                           lcs        = r
                                   2, 3, 3

                                            2
(%t5)                     lcs        = r sin (theta)
                             2, 4, 4

(%t6)                          lcs        = - r
                                  3, 3, 2

                                   2
(%t7)                lcs        = r  cos(theta) sin(theta)
                        3, 4, 4

                                             2
(%t8)                    lcs        = - r sin (theta)
                            4, 4, 2

                                    2
(%t9)               lcs        = - r  cos(theta) sin(theta)
                       4, 4, 3

(%o9)                                done
(%i10) arrayinfo(lcs);
(%o10) [hashed, 3, [1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 1, 4], [1, 2, 1], 
[1, 2, 2], [1, 2, 3], [1, 2, 4], [1, 3, 1], [1, 3, 2], [1, 3, 3], [1, 3, 4], 
[1, 4, 1], [1, 4, 2], [1, 4, 3], [1, 4, 4], [2, 1, 1], [2, 1, 2], [2, 1, 3], 
[2, 1, 4], [2, 2, 1], [2, 2, 2], [2, 2, 3], [2, 2, 4], [2, 3, 1], [2, 3, 2], 
[2, 3, 3], [2, 3, 4], [2, 4, 1], [2, 4, 2], [2, 4, 3], [2, 4, 4], [3, 1, 1], 
[3, 1, 2], [3, 1, 3], [3, 1, 4], [3, 2, 1], [3, 2, 2], [3, 2, 3], [3, 2, 4], 
[3, 3, 1], [3, 3, 2], [3, 3, 3], [3, 3, 4], [3, 4, 1], [3, 4, 2], [3, 4, 3], 
[3, 4, 4], [4, 1, 1], [4, 1, 2], [4, 1, 3], [4, 1, 4], [4, 2, 1], [4, 2, 2], 
[4, 2, 3], [4, 2, 4], [4, 3, 1], [4, 3, 2], [4, 3, 3], [4, 3, 4], [4, 4, 1], 
[4, 4, 2], [4, 4, 3], [4, 4, 4]]
(%i11) 
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(s1, s2, s3, s4, s5) := block([tot : s1 + s2 + s3 + s4 + s5], 
s1
--- (if s1 > 1 then P(s1 - 1, s2, s3, s4, s5) else 1)
tot
                           P(s1, s2 - 1, s3, s4, s5) s2
 + (if s2 <= 1 then 0 else ----------------------------)
                                       tot
                           P(s1, s2, s3 - 1, s4, s5) s3
 + (if s3 <= 1 then 0 else ----------------------------)
                                       tot
                           P(s1, s2, s3, s4 - 1, s5) s4
 + (if s4 <= 1 then 0 else ----------------------------)
                                       tot
                           P(s1, s2, s3, s4, s5 - 1) s5
 + (if s5 <= 1 then 0 else ----------------------------))
                                       tot
(%i2) foo[sort([3,5,1,5,1])]:42;
(%o2)                                 42
(%i3) if subvar(foo,sort([3,5,0,5,1]))>
0 then foo[sort([3,5,1,5,1])]+12 else 12;
(%o3) if foo                > 0 then foo                      + 12 else 12
            [0, 1, 3, 5, 5]             sort([3, 5, 1, 5, 1])
(%i4) subvar(foo,sort([3,5,e,5,1]))>
0;
(%o4)                       foo                > 0
                               [1, 3, 5, 5, e]
(%i5) arrayinfo(foo);
(%o5)                   [hashed, 1, [[1, 1, 3, 5, 5]]]
(%i6) 

Related Help

Help for Arrayinfo