Here is an example from Ezra Miller's book: *Combinatorial Commutative Algebra*,p26-27


Let $f,g\in k[x\_1,x\_2,x\_3,x\_4]$ be a generic forms of degree $d$ and $e$, the *generic initial ideal* of $I=\langle f,g\rangle$ for both the *lexicographic order* and the *inverse lexicographic order*.  

When $(d,e)=(2,2)$,the ideals $J=\operatorname{gin}\_{\operatorname{lex}}(I)$ are $(x\_2^4,x\_1x\_3^2,x\_1x\_2,x\_1^2)$, 
the ideal $J=\operatorname{gin}\_{\operatorname{revlex}}(I)$ are $(x\_2^3,x\_1x\_2,x\_1^2)$.


How to find it?



How to find the generic initial ideal?
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](http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.4/share/doc/Macaulay2/GenericInitialIdeal/html/_gin.html)


**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.


