Computing Betti numbers using Macaulay2 Let $k$ be a field and $R=k[x,y,z]$, let $M=R/\langle x^2,xy,yz^2,y^4\rangle$ be $R$-module, how can we compute the left free resolution of $M$, and also the Betti numbers of this resolution? 
 A: The first step is to plug your module into Macaulay2. As far as I understand from the official tutorial on modules in Macaulay2, the way to make modules is as kernels or cokernels of linear maps given by matrices. Thus, for example you get:
R=QQ[x,y,z]
m=matrix{{x^2,x*y,y*z^2,y^4}}
M=cokernel m
C=resolution M
B=betti C

The first three commands are self-explanatory. The fourth computes a free resolution of the R-module M, and its output looks like:
       1      4      4      1
o19 = R  <-- R  <-- R  <-- R  <-- 0

      0      1      2      3      4

So in partiuclar, we have that the resolution is $M\leftarrow R\leftarrow R^{\oplus 4}\leftarrow R^{\oplus 4}\leftarrow R\leftarrow 0$. If you want to see what the individual maps (differentials) are in terms of matrices, you call the .dd method on the stored resolution to get:
i20 : C.dd

           1                        4
o20 = 0 : R  <-------------------- R  : 1
                | x2 xy yz2 y4 |

           4                              4
      1 : R  <-------------------------- R  : 2
                {2} | -y 0   0   0   |
                {2} | x  -z2 -y3 0   |
                {3} | 0  x   0   -y3 |
                {4} | 0  0   x   z2  |

           4                   1
      2 : R  <--------------- R  : 3
                {3} | 0   |
                {4} | y3  |
                {5} | -z2 |
                {6} | x   |

           1
      3 : R  <----- 0 : 4
                0

The last command, betti, outputs something called a betti talli, which looks something like this:
         0 1 2 3
  total: 1 4 4 1
      0: 1 . . .
      1: . 2 1 .
      2: . 1 1 .
      3: . 1 1 .
      4: . . 1 1

The first row are the indices of a free resolution $M\leftarrow F_0\leftarrow F_1\leftarrow F_2\leftarrow F_3\leftarrow 0$, where the $F_i$ are free modules. The second row are the total betti numbers, that is, the ranks of the free modules. Further, we have matrix $(\gamma_{ij})$ with a column for each module in the resolution, and as many rows are necessary to encode the graded betti numbers according to the scheme $\gamma_{ik}=\beta_{i,i+k}$ where $\beta_{ij}$ is the degree $j$ graded betti number for the $i^\text{th}$ free module.
