# Difference between revisions of "RandomPolynomial Command"

From GeoGebra Manual

Line 1: | Line 1: | ||

− | <noinclude>{{Manual Page|version=4.2}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude>{{betamanual|version=4.2}} | + | <noinclude>{{Manual Page|version=4.2}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude>{{betamanual|version=4.2}} |

+ | {{command|probability}} | ||

;RandomPolynomial[ <Degree d> , <Minimum for Coefficients min>, <Maximum for Coefficients max> ] | ;RandomPolynomial[ <Degree d> , <Minimum for Coefficients min>, <Maximum for Coefficients max> ] | ||

:Returns a randomly generated polynomial in ''x'' of degree ''d'', whose (integer) coefficients are in the range from ''min'' to ''max'', both included. | :Returns a randomly generated polynomial in ''x'' of degree ''d'', whose (integer) coefficients are in the range from ''min'' to ''max'', both included. |

## Revision as of 09:20, 9 July 2012

This page is about a feature that is supported only in GeoGebra 4.2. |

- RandomPolynomial[ <Degree d> , <Minimum for Coefficients min>, <Maximum for Coefficients max> ]
- Returns a randomly generated polynomial in
*x*of degree*d*, whose (integer) coefficients are in the range from*min*to*max*, both included. **Example:**`RandomPolynomial[0, 1, 2]`

yields either*1*or*2*and`RandomPolynomial[2, 1, 2]`

yields a random polynomial with a degree of two and only*1*and*2*as coefficients, for example*2x*.^{2}+ x + 1

- RandomPolynomial[ <Variable Var>, <Degree d> , <Minimum for Coefficients min>, <Maximum for Coefficients max> ]
- Returns a randomly generated polynomial in
*Var*of degree*d*, whose (integer) coefficients are in the range from*min*to*max*, both included. **Example:**`RandomPolynomial[a, 0, 1, 2]`

yields either*1*or*2*and`RandomPolynomial[a, 2, 1, 2]`

yields a random polynomial with a degree of two and only*1*and*2*as coefficients, for example*2a*.^{2}+ a + 1

**Note:**In both cases if

*min*or

*max*are not integers,

*round(min)*and

*round(max)*are used instead.