Ask Your Question

# Random polynomial of degree 1

Having defined

• the finite field K of size 4 in a
• a polynomial ring R1 over K

one can ask for a random element using the random_element method.

The random polynomial I obtained that way was of degree two:

sage: K.<a> = FiniteField(4)
sage: R1 = PolynomialRing(K, ['z%s' % p for p in range(1, 3)])
sage: R1.random_element()
(a)*z1*z2 + (a + 1)*z2^2 + z1 + (a)*z2


If I only want a random linear polynomial from this ring, how can I get one?

edit retag close merge delete

## 1 Answer

Sort by » oldest newest most voted

You can get the documentation of the random_element method by typing:

sage: R1.random_element?


As you can see, you can specify the degree, so the following should work:

sage: R1.random_element(degree=1)

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2021-01-19 07:00:12 +0200

Seen: 52 times

Last updated: Jan 19