Macaulay2 » Documentation
Packages » Macaulay2Doc :: VirtualTally + VirtualTally
next | previous | forward | backward | up | index | toc

VirtualTally + VirtualTally -- union of tallies

Synopsis

Description

x + y -- produces the union of two tallies.

One of the arguments may be a Set.

i1 : x = tally {a,b,b,c,c,c,d,d,d}

o1 = Tally{a => 1}
           b => 2
           c => 3
           d => 3

o1 : Tally
i2 : y = tally {a,a,a,b,b,c,d}

o2 = Tally{a => 3}
           b => 2
           c => 1
           d => 1

o2 : Tally
i3 : x' = new VirtualTally from x

o3 = VirtualTally{a => 1}
                  b => 2
                  c => 3
                  d => 3

o3 : VirtualTally
i4 : y' = new VirtualTally from y

o4 = VirtualTally{a => 3}
                  b => 2
                  c => 1
                  d => 1

o4 : VirtualTally
i5 : z' = y' - x'

o5 = VirtualTally{a => 2 }
                  c => -2
                  d => -2

o5 : VirtualTally
i6 : z' + x'

o6 = VirtualTally{a => 3}
                  b => 2
                  c => 1
                  d => 1

o6 : VirtualTally
i7 : z' + y'

o7 = VirtualTally{a => 5 }
                  b => 2
                  c => -1
                  d => -1

o7 : VirtualTally

Ways to use this method: