```python
from sympy import *
```


```python
y1, y2, y3, y4, z = symbols('y1 y2 y3 y4 z')
```


```python
# Problem equationsal formulation
eqs = [y1 + 2*y2 + 3*y3 + 3*y4 - z , y1 + y2 + 2*y3 + y4 - 3]
eqs = eqs + [x*(x-1) for x in [y1,y2,y3,y4]]
print(eqs)
```

    [y1 + 2*y2 + 3*y3 + 3*y4 - z, y1 + y2 + 2*y3 + y4 - 3, y1*(y1 - 1), y2*(y2 - 1), y3*(y3 - 1), y4*(y4 - 1)]



```python
#Computing Groebner basis
result = groebner(eqs, y1, y2, y3, y4, z, order='lex')
list(result)
```




    [2*y1 + 2*y3 - z**2 + 11*z - 32,
     y2 + y3 + z**2 - 10*z + 23,
     y3**2 - y3,
     y3*z - 6*y3 - z + 6,
     2*y4 - z**2 + 9*z - 20,
     z**3 - 15*z**2 + 74*z - 120]




```python
# Solving the last equation of the Groebner basis
solve(list(result)[-1], z)
```




    [4, 5, 6]




```python

```

da1a0202fd7a26231fb17b78118258f03dad8854
ipynb
Jupyter Notebook
notebooks/unused/Groebner basis simple example.ipynb
bernalde/QuIPML
a4593210b2dffa01561e6aafb01136471a0628cb
MIT
2021-11-08T21:42:27.000Z
2021-11-08T21:42:27.000Z
notebooks/unused/Groebner basis simple example.ipynb
bernalde/QuIPML
a4593210b2dffa01561e6aafb01136471a0628cb
MIT
notebooks/unused/Groebner basis simple example.ipynb
bernalde/QuIPML
a4593210b2dffa01561e6aafb01136471a0628cb
MIT
2021-09-10T06:08:44.000Z
2021-09-10T06:08:44.000Z
Qwen/Qwen-72B
1. YES
2. YES