Difference between revisions of "RandomPolynomial Command"
From GeoGebra Manual
m (changed CAS syntax description) |
m (Text replace - ";(.*)\[(.*)\]" to ";$1($2)") |
||
Line 1: | Line 1: | ||
<noinclude>{{Manual Page|version=5.0}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude> | <noinclude>{{Manual Page|version=5.0}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude> | ||
{{command|probability}} | {{command|probability}} | ||
− | ;RandomPolynomial | + | ;RandomPolynomial( <Degree> , <Minimum for Coefficients>, <Maximum for Coefficients> ) |
:Returns a randomly generated polynomial in ''x'' of degree ''d'', whose (integer) coefficients are in the range from ''minimum'' to ''maximum'', both included. | :Returns a randomly generated polynomial in ''x'' of degree ''d'', whose (integer) coefficients are in the range from ''minimum'' to ''maximum'', both included. | ||
:{{Examples|1=<div> | :{{Examples|1=<div> | ||
Line 10: | Line 10: | ||
The following command is only available in the [[File:Menu view cas.svg|link=|16px]] [[CAS View]]. | The following command is only available in the [[File:Menu view cas.svg|link=|16px]] [[CAS View]]. | ||
− | ;RandomPolynomial | + | ;RandomPolynomial( <Variable>, <Degree> , <Minimum for Coefficients>, <Maximum for Coefficients> ) |
:Returns a randomly generated polynomial in ''Variable'' of degree ''d'', whose (integer) coefficients are in the range from ''minimum'' to ''maximum'', both included. | :Returns a randomly generated polynomial in ''Variable'' of degree ''d'', whose (integer) coefficients are in the range from ''minimum'' to ''maximum'', both included. | ||
:{{Examples|1=<div> | :{{Examples|1=<div> |
Revision as of 17:17, 7 October 2017
- RandomPolynomial( <Degree> , <Minimum for Coefficients>, <Maximum for Coefficients> )
- Returns a randomly generated polynomial in x of degree d, whose (integer) coefficients are in the range from minimum to maximum, both included.
- Examples:
RandomPolynomial[0, 1, 2]
yields either 1 or 2.RandomPolynomial[2, 1, 2]
yields a random polynomial with a degree of two and only 1 and 2 as coefficients, for example 2x2 + x + 1.
CAS Syntax
The following command is only available in the CAS View.
- RandomPolynomial( <Variable>, <Degree> , <Minimum for Coefficients>, <Maximum for Coefficients> )
- Returns a randomly generated polynomial in Variable of degree d, whose (integer) coefficients are in the range from minimum to maximum, both included.
- Examples:
RandomPolynomial[a, 0, 1, 2]
yields either 1 or 2.RandomPolynomial[a, 2, 1, 2]
yields a random polynomial with a degree of two and only 1 and 2 as coefficients, for example 2a2 + a + 1.
Note: In both cases if minimum or maximum are not integers, round(minimum) and round(maximum) are used instead.