You should apply a generic linear coordinate transform to the ideal and then compute the initial ideal. The matrices for which the result is the generic initial ideal is a (Zariski) open subset (Lemma 2.6, in the book). In particular the complement is of lower dimension.

Leaving distribution issues aside, if you 'pick a random coordinate transform', then you'll always find the generic initial ideal. In practice you'll find it with high probability.
There is also an implementation in Macaulay2

**Edit:** Here is one way to computer-prove the statements from the book. To do this I make a ring in which the coefficients of $f,g$ are extra variables. There are 10 degree 2 monomials in four variables, therefore we need a ring with 10+10+4 variables. Here is the Macaulay2 code:

```
S = QQ[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10, x1,x2,x3,x4]
ba = {x1^2, x1*x2, x1*x3, x1*x4, x2^2, x2*x3, x2*x4, x3^2, x3*x4, x4^2}
a={a1,a2,a3,a4,a5,a6,a7,a8,a9,a10} -- coefficients of f
b={b1,b2,b3,b4,b5,b6,b7,b8,b9,b10} -- coefficients of g
f = sum (for i to 9 list a#i*ba#i)
g = sum (for i to 9 list b#i*ba#i)
I = ideal (f,g)
monomialIdeal I -- returns the initial ideal
```

Running it computes the revlex initial ideal because revlex is the default order. The output is $(a_1 x_1^2,b_1 x_1^2,a_2 b_1x_1 x_2,a_5 b_1 x_1 x_2^2,a_1 a_5 b_2 x_1 x_2^2,a_5^2 b_1^2 x_2^3)$ and thus making the $a_i$ and $b_i$ invertible we find the claimed result. For lex you have to change the variable and monomial order on $S$. One has to be a bit careful with the ordering of the variables, because M2 does not know that the $a_i$ and $b_i$ are invertible. Putting the $x_1$ last does the right thing for revlex(this needs a quick check). The Macaulay2 package that I linked is for a concrete ideal (not the generic complete intersection) like in the example.

and Bernd Sturmfels. $\endgroup$ – Sam Hopkins Jan 13 '15 at 7:40