ModuloSteps - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Student[Basics]

  

ModuloSteps

  

generate steps for evaluating modulos

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

ModuloSteps( expr )

ModuloSteps( expr, implicitmultiply = true )

Parameters

expr

-

string or expression

implicitmultiply

-

(optional) truefalse

output = ...

-

(optional) option to control the return value

displaystyle = ...

-

(optional) option to control the layout of the steps

Description

• 

The ModuloSteps command accepts an expression that is expected to contain modulos and displays the steps required to evaluate each modulo given.

• 

If expr is a string, then it is parsed into an expression using InertForm:-Parse so that no automatic simplifications are applied, and thus no steps are missed.  

• 

The implicitmultiply option is only relevant when expr is a string.  This option is passed directly on to the InertForm:-Parse command and will cause things like 2x to be interpreted as 2*x, but also, xyz to be interpreted as x*y*z.

• 

The output and displaystyle options are described in Student:-Basics:-OutputStepsRecord. The return value is controlled by the output option.  

• 

This function is part of the Student:-Basics package.

Examples

withStudent:-Basics:

ModuloSteps4 mod 7

4mod7Evaluate modulo, which is the remainder of4divided by74

(1)

ModuloSteps((3 + 5 + 6) mod 4) + ((5*6*7) mod 3)

3+5+6mod4+567mod3Examine term3+5+6mod4Apply theadditionmod rule:a+bmodm=amodm+bmodmmodm3+5mod4+6mod4mod4Examine term5mod4Evaluate modulo, which is the remainder of5divided by41This gives:3+1+6mod4mod4Examine term6mod4Evaluate modulo, which is the remainder of6divided by42This gives:3+1+2mod4Simplify6mod4Evaluate modulo, which is the remainder of6divided by42This gives:2+567mod3Examine term567mod3Apply theproductmod rule:abmodm=amodmbmodmmodm5mod36mod37mod3mod3Examine term5mod3Evaluate modulo, which is the remainder of5divided by32This gives:26mod37mod3mod3Examine term6mod3Evaluate modulo, which is the remainder of6divided by30This gives:207mod3mod3Examine term7mod3Evaluate modulo, which is the remainder of7divided by31This gives:201mod3Simplify0mod3Evaluate modulo, which is the remainder of0divided by30This gives:2+0Simplify2

(2)

ModuloSteps(2^200 mod 24) + (2^201 mod 24)

2200mod24+2201mod24Examine term2200mod24Apply exponent rule:anm+c=anmac272824mod24Evaluate inside exponents1282816mod24Apply theproductmod rule:abmodm=amodmbmodmmodm12828mod2416mod24Examine term12828mod24Apply thepowermod rule:abmodm=amodmbmodm128mod2428mod24Examine term128mod24Evaluate modulo, which is the remainder of128divided by248This gives:828mod24Apply exponent rule:anm+c=anmac8398mod24Evaluate inside exponents51298mod24Apply theproductmod rule:abmodm=amodmbmodmmodm5129mod248mod24Examine term5129mod24Apply thepowermod rule:abmodm=amodmbmodm512mod249mod24Examine term512mod24Evaluate modulo, which is the remainder of512divided by248This gives:89mod24Apply exponent rule:anm=anm833mod24Evaluate inside exponents5123mod24Apply thepowermod rule:abmodm=amodmbmodm512mod243mod24Examine term512mod24Evaluate modulo, which is the remainder of512divided by248This gives:83mod24Evaluate inside exponents512mod24Evaluate modulo, which is the remainder of512divided by248This gives:88mod24Simplify64mod24Evaluate modulo, which is the remainder of64divided by2416This gives:1616mod24Simplify256mod24Evaluate modulo, which is the remainder of256divided by2416This gives:16+2201mod24Examine term2201mod24Apply exponent rule:anm+c=anmac272825mod24Evaluate inside exponents1282832mod24Apply theproductmod rule:abmodm=amodmbmodmmodm12828mod2432mod24mod24Examine term12828mod24Apply thepowermod rule:abmodm=amodmbmodm128mod2428mod24Examine term128mod24Evaluate modulo, which is the remainder of128divided by248This gives:828mod24Apply exponent rule:anm+c=anmac8398mod24Evaluate inside exponents51298mod24Apply theproductmod rule:abmodm=amodmbmodmmodm5129mod248mod24Examine term5129mod24Apply thepowermod rule:abmodm=amodmbmodm512mod249mod24Examine term512mod24Evaluate modulo, which is the remainder of512divided by248This gives:89mod24Apply exponent rule:anm=anm833mod24Evaluate inside exponents5123mod24Apply thepowermod rule:abmodm=amodmbmodm512mod243mod24Examine term512mod24Evaluate modulo, which is the remainder of512divided by248This gives:83mod24Evaluate inside exponents512mod24Evaluate modulo, which is the remainder of512divided by248This gives:88mod24Simplify64mod24Evaluate modulo, which is the remainder of64divided by2416This gives:1632mod24mod24Examine term32mod24Evaluate modulo, which is the remainder of32divided by248This gives:168mod24Simplify128mod24Evaluate modulo, which is the remainder of128divided by248This gives:16+8Simplify24

(3)

Compatibility

• 

The Student:-Basics:-ModuloSteps command was introduced in Maple 2024.

• 

For more information on Maple 2024 changes, see Updates in Maple 2024.

See Also

Student:-Basics

Student:-Basics:-ExpandSteps

Student:-Basics:-SimplifySteps