For a sample of ideals stored as a list, this function computes some basic Betti table statistics of the sample. Namely, it computes the average shape of the Betti tables (where 1 is recorded in entry (ij) for each element if betaij is not zero), and it also computes the average Betti table (that is, the table whose (ij) entry is the mean value of betaij for all ideals in the sample).
i1 : R = ZZ/101[a..e]; |
i2 : L={monomialIdeal"a2b,bc", monomialIdeal"ab,bc3",monomialIdeal"ab,ac,bd,be,ae,cd,ce,a3,b3,c3,d3,e3"} 2 3 3 3 3 3 3 o2 = {monomialIdeal (a b, b*c), monomialIdeal (a*b, b*c ), monomialIdeal (a , a*b, b , a*c, c , b*d, c*d, d , a*e, b*e, c*e, e )} o2 : List |
i3 : (meanBettiShape,meanBetti,stdDevBetti) = bettiStats L; |
i4 : meanBettiShape 0 1 2 3 4 5 o4 = total: 1 2 2 1.33333 1.33333 .333333 0: 1 . . . . . 1: . 1 .333333 .333333 .333333 . 2: . .666667 .666667 .333333 .333333 . 3: . .333333 .666667 .333333 .333333 . 4: . . .333333 .333333 .333333 .333333 o4 : BettiTally |
i5 : meanBetti 0 1 2 3 4 5 o5 = total: 1 5.33333 10.3333 10 5 1 0: 1 . . . . . 1: . 3 3.66667 2 .333333 . 2: . 2 5 4.33333 1.33333 . 3: . .333333 .666667 .666667 .333333 . 4: . . 1 3 3 1 o5 : BettiTally |
i6 : stdDevBetti 1 2 3 4 5 o6 = total: 5.46008 13.4481 14.1421 7.07107 1.41421 1: 2.82843 5.18545 2.82843 .471405 . 2: 2.16025 6.37704 6.12826 1.88562 . 3: .471405 .471405 .942809 .471405 . 4: . 1.41421 4.24264 4.24264 1.41421 o6 : BettiTally |
For sample size N, the average Betti table shape considers nonzero Betti numbers. It is to be interpreted as follows: entry (i,j) encodes the following sum of indicators: ∑all ideals 1betaij>0 / N; that is, the proportion of ideals with a nonzero betaij. Thus an entry of 0.33 means 33% of ideals have a non-zero Betti number there.
i7 : apply(L,i->betti res i) 0 1 2 0 1 2 0 1 2 3 4 5 o7 = {total: 1 2 1, total: 1 2 1, total: 1 12 29 30 15 3} 0: 1 . . 0: 1 . . 0: 1 . . . . . 1: . 1 . 1: . 1 . 1: . 7 11 6 1 . 2: . 1 1 2: . . . 2: . 5 14 13 4 . 3: . 1 1 3: . . 1 2 1 . 4: . . 3 9 9 3 o7 : List |
i8 : meanBettiShape 0 1 2 3 4 5 o8 = total: 1 2 2 1.33333 1.33333 .333333 0: 1 . . . . . 1: . 1 .333333 .333333 .333333 . 2: . .666667 .666667 .333333 .333333 . 3: . .333333 .666667 .333333 .333333 . 4: . . .333333 .333333 .333333 .333333 o8 : BettiTally |
For sample size N, the average Betti table is to be interpreted as follows: entry (i,j) encodes ∑I∈idealsbetaij(R/I) / N:
i9 : apply(L,i->betti res i) 0 1 2 0 1 2 0 1 2 3 4 5 o9 = {total: 1 2 1, total: 1 2 1, total: 1 12 29 30 15 3} 0: 1 . . 0: 1 . . 0: 1 . . . . . 1: . 1 . 1: . 1 . 1: . 7 11 6 1 . 2: . 1 1 2: . . . 2: . 5 14 13 4 . 3: . 1 1 3: . . 1 2 1 . 4: . . 3 9 9 3 o9 : List |
i10 : meanBetti 0 1 2 3 4 5 o10 = total: 1 5.33333 10.3333 10 5 1 0: 1 . . . . . 1: . 3 3.66667 2 .333333 . 2: . 2 5 4.33333 1.33333 . 3: . .333333 .666667 .666667 .333333 . 4: . . 1 3 3 1 o10 : BettiTally |