# Package sagbi/SB.RandomPoly

From ApCoCoAWiki

< Package sagbi

Revision as of 13:22, 29 October 2020 by AndraschkoBot (talk | contribs) (replaced <quotes> tags by real quotes)

This article is about a function from ApCoCoA-2. |

## SB.RandomPoly

This function returns a random polynomial of a given subalgebra.

### Syntax

SB.RandomPoly(S: TAGGED("$apcocoa/sagbi.Subalgebra"), d: INT): POLY

### Description

This function computes a random polynomial of degree `d` from `S`.

*Warning:* Very inefficient!

@param

`S`A subalgebra@param

`d`An integer@return A random polynomial of degree

`d`in the subalgebra`S`

#### Example

Use P ::= QQ[x,y,z]; S := SB.Subalgebra(CurrentRing,[x^2,y^2,x+y]); SB.RandomPoly(S,3); -- -2*x^3 -10*x^2*y +3*x*y^2 +11*y^3 +2*x^2 +4*x*y -4*y^2 +3*x +3*y -- (if you just started ApCoCoA)

### See also