# Discontinuous Galerkin method VS Continuous Galerkin method Degrees of freedom

I was looking into the Book of Riviere " Discontinuous Galerkin Methods for solving Elliptic and Parabolic Equations". In the comparaison of section 2.12 (copied below), the example of rectangular mesh indicated that the DG is more economic (has les DOFs) then the CG when using a certain space of elements. Can any one explain in more details please ? What is the difference between the two spaces Qk and Pk ?

Example :

" Size of problem:For DG, the total number of degrees of freedom is proportional to the number of elements in the mesh. The constant of proportionality is a function of the polynomial degree. For CG, the degrees of freedom depend on the number of vertices and possibly the number of vertices and elements in the mesh. For instance, consider a structured mesh of 5 × 5 rectangular elements. The degrees of freedom for a DG approximation of degree 1, 2, 3, 4 are 75, 150, 250, 375, respectively, whereas the degrees of freedom for a CG approximation of degree 1, 2, 3, 4 are 36, 121, 256, 441, respectively. Thus, on such small mesh, if k ≥ 3, the CG method is more costly than DG. The reason is that we have to use the space Qk on rectangular elements for CG, but we can still use the space Pk on rectangular elements for DG."

The argument is misleading. The different spaces that are used are $P_1=\text{span}\{1,x,y\}$ and $Q_1=\text{span}\{1,x,y,xy\}$. For higher orders, they are $P_2=\text{span}\{1,x,y,x^2,y^2\}$ and $Q_2=\text{span}\{1,x,y,x^2,y^2,xy,x^2y,xy^2,x^2y^2\}$. If you continue this, it is true that the number of basis functions for the $Q_k$ spaces grows faster than the number of basis functions for $P_k$.
But this is not the important quantity. What matters is not how many basis functions you have on a given mesh for a given polynomial degree $k$, but this: *How many $Q_k$ shape functions do you need to reach a certain level of accuracy vs. how many do you need for $P_{k'}$.
In this metric, $Q_k$ spaces typically win because the additional shape functions help you cancel terms in the Taylor expansion of the solution, and consequently the error you get on one quadrilateral cell with a $Q_k$ element is typically substantially smaller than the error you get by splitting this one cell into two triangles and using a $P_k$ element on it.
In other words, while it is true that for the same polynomial degree, $Q_k$ continuous elements have more unknowns than $P_k$ discontinuous elements if $k$ is sufficiently large, this does not matter: You get something for these additional shape functions in terms of error reduction.