Writing Out Equations with a Modulo Function

  • Context: High School 
  • Thread starter Thread starter drogerssolar
  • Start date Start date
  • Tags Tags
    Function Writing
Click For Summary

Discussion Overview

The discussion revolves around how to properly express a modulo function mathematically, particularly in the context of translating an Excel formula into mathematical notation. Participants explore various representations and clarify the use of mathematical symbols related to the modulo operation.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks to convert an Excel formula using the MOD function into a mathematical expression, questioning the use of commas in such notation.
  • Another participant suggests using vertical bars to denote the floor function but is corrected that they represent absolute value, while the floor function should be denoted differently.
  • A participant proposes writing the expression followed by "(mod n)" as a way to denote the modulo operation.
  • There is a discussion about whether the two expressions involving the floor function and modulo are equivalent, with one participant expressing doubt about their equality.
  • One participant emphasizes that the modulo operation is typically defined for integers, while another mentions that some applications allow for real numbers in the mod function.
  • Clarifications are made regarding the distinction between assignment in Excel and equality in mathematical equations.
  • Participants express differing views on whether the output of the modulo operation needs to be an integer or can include fractional parts.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the proper representation of the modulo function or whether it can be applied to non-integer values. Multiple competing views remain regarding the use of mathematical notation and the definition of the modulo operation.

Contextual Notes

There are unresolved assumptions about the definitions of mathematical functions and the context in which the modulo operation is applied. The discussion highlights the potential for different interpretations based on the mathematical framework being used.

drogerssolar
Messages
23
Reaction score
0
Hi,

I'm trying to write out a set of equations I was using in an excel worksheet and am unsure how to represent a modulo function.

For example, is there a proper way to write out the following excel formula in mathematical terms?

=MOD(280.4+X*(36000.7 + X*0.0003032),360) *Where X is a cell containing the variable

Sorry if my question is a bit confusing. I am unsure of how to write this out because typically I wouldn't expect to write a comma in a mathematical equation. Maybe this is a bad assumption.

Thanks for any help.
 
Mathematics news on Phys.org
So I took a stab at it. I think that the two vertical bars around a variable or expression means the floor integer. Is this correct?

Z = 280.4+X*(36000.7 + X*0.0003032)

= z - (|z/360| * 360)



or all in one equation:

= z - (|(280.4+X*(36000.7 + X*0.0003032))/360| * 360)
 
drogerssolar said:
Hi,

I'm trying to write out a set of equations I was using in an excel worksheet and am unsure how to represent a modulo function.

For example, is there a proper way to write out the following excel formula in mathematical terms?

=MOD(280.4+X*(36000.7 + X*0.0003032),360) *Where X is a cell containing the variable
I believe the conventions is to write the expression and then put '(mod n)' after it, eg
280.4+X*(36000.7 + X*0.0003032) (mod 360)

Sorry if my question is a bit confusing. I am unsure of how to write this out because typically I wouldn't expect to write a comma in a mathematical equation. Maybe this is a bad assumption.
It depends where and how, but commas are typically used to separate arguments in multi-parameter functions or indices in matrix subscripts.
 
drogerssolar said:
So I took a stab at it. I think that the two vertical bars around a variable or expression means the floor integer. Is this correct?
No, | | means absolute value. What you want is the greatest integer function, AKA "floor" function, written in LaTeX like this:

\lfloor 512.3 \rfloor

##\lfloor 512.3\rfloor##, which evaluates to 512.
drogerssolar said:
Z = 280.4+X*(36000.7 + X*0.0003032)

= z - (|z/360| * 360)
The above doesn't make sense. The first line sets Z to the expression on the right. The second line claims that the right side of the previous equation is somehow equal to the expression after '=', which is not true.
drogerssolar said:
or all in one equation:

= z - (|(280.4+X*(36000.7 + X*0.0003032))/360| * 360)

This is not an equation. An equation is a statement that two quantities have the same value. All you're showing here is one quantity. Keep in mind that Excel formulas always start with '=' but mathematical equations have the form <expression1> = <expression2>.

The '=' that starts an Excel formula is a shorthand assignment statement, where the thing that's being set (the cell in which the formula is written) is not shown. It is probably a bit confusing that '=' is also used in Excel to test for equality. Most programming languages use different symbols for assignment and equality.
 
So than is this:

Y = (280.46646 + (X * 36) + (X * (0.0003032^2)))
- (⌊(280.46646 + (X * 36) + (X * (0.0003032^2))) / 360⌋ * 360)


the same as writing this...

Y = (280.46646 + (X * 36) + (X * (0.0003032^2))) (mod 360)

Any idea what the typical method would be in a scientific style report?
 
drogerssolar said:
So than is this:

Y = (280.46646 + (X * 36) + (X * (0.0003032^2)))
- (⌊(280.46646 + (X * 36) + (X * (0.0003032^2))) / 360⌋ * 360)


the same as writing this...

Y = (280.46646 + (X * 36) + (X * (0.0003032^2))) (mod 360)
I haven't checked your numbers, but I doubt that the two values are the same. I'm guessing that you want an integer value for Y in the range 0 ... 359. The argument to a modulus expression in mathematics is defined only for integer numbers, at least I've never seen it being used on numbers with fractional parts. That's the reason for the greatest integer function in your first equation above.

To cut to the chase, what I think you're trying to do is to take a number such as 645.783 (for example), strip off the fractional part (.783) to get 645, and then find the remainder mod 360, which would be 285.
drogerssolar said:
Any idea what the typical method would be in a scientific style report?
 
Thanks for your help Mark.

In your example you are describing what I am trying to do; however, the value of Y does not need to be an integer.

Basically my main equation is Y = (280.46646 + (X * 36) + (X * (0.0003032^2)))
and if this gave us a result of Y=645.783; I would want to use the modulo function to give me the result of 285.783.

If the equation gave a result of Y=3525.783; I would want to use modulo to give a result of 285.783.

So yes you are correct in saying I want a number between 0-359; however, that number does not need to be an integer.
 
Mark44 said:
The argument to a modulus expression in mathematics is defined only for integer numbers, at least I've never seen it being used on numbers with fractional parts.
Several 'mathematical' applications define the mod function to take congruences of real numbers, eg Mathcad, Matlab and Mathematica.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 18 ·
Replies
18
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K