A matter of style? Algebra, Arithmetic, Variables

In summary, the conversation discusses the use of variables in solving numeric problems and how it can be beneficial in providing flexibility and self-documentation. The topic is also applied to computer programming and the advantages of using named variables or constants. The conversation also touches on conventions and guidelines for variable naming.
  • #1
symbolipoint
Homework Helper
Education Advisor
Gold Member
7,404
1,875
TL;DR Summary
Different people like to or are forced to choose variables and some do not. I wonder if this is a matter of style or how a person was taught.
When people graduate and have their degrees in engineering or physics or mathematics or what they may have done, some of these people will use some mathematics, very often which is some-what complicated (or not) arithmetic. Why will some people choose to strictly avoid using variables in the numeric problems they solve? Why would these people not choose variables for what they are looking for? Further, why so rarely anyone give variables to all numbers involved in a problem situation (assuming only rational or linear or maybe quadratic relationships) and solve for what is wanted, all in variables like to have a formula as a result; and then to use that formula for any example which fits the situation? Seems strange to me that a person would go through their courses Algebra 1 through Calc&AnalyticGeometry 3, several different science or engineering courses, and then later when on the job never use some variables to solve some multi-step numeric problems. Did anybody of the group recall like in first learning Physics: Assign variables to everything, and then solve all in variables, and to substitute the values last?
 
Mathematics news on Phys.org
  • #2
symbolipoint said:
Did anybody of the group recall like in first learning Physics: Assign variables to everything, and then solve all in variables, and to substitute the values last?
I heard it. Did not always agree w/ it.
 
  • #3
Yes, I tended to work that way anyway because I would make simple arithmetic mistakes and doing it at the end made it easier to find.

In programming you get a lot more flexibility using variables over literal constants. Choosing the right variable names can self-document your expressions and help you spot errors before they drive you crazy.

I know the time I've used the quick expedient of a literal constant I'd regret it later when I had to locate usages and change them struggling over whether the constant I'm looking at with the same value is the one I need to change.
 
  • Like
Likes Stephen Tashi and symbolipoint
  • #4
Emphasis added
symbolipoint said:
Further, why so rarely anyone give variables to all numbers involved in a problem situation
I have a problem with 'all' in the sentence above. The generalization here should not be taken to extremes, as in the following example.
Problem:
I have a small garden whose dimensions are 10 ft. by 20 ft. How much fencing do I need to buy to fully enclose this garden.
Solution:
Let two = 2
Let width = 10
Let length = 20
Perimeter = two * (width + length) = 2 * (10 + 20) = 60

Because it is not likely that the formula for the perimeter of a rectangle is likely to change in the next few years, there is need to define a variable for the constant 2 in this formula.
 
  • Like
Likes SammyS
  • #5
Mark44 said:
Emphasis added
I have a problem with 'all' in the sentence above. The generalization here should not be taken to extremes, as in the following example.
Problem:
I have a small garden whose dimensions are 10 ft. by 20 ft. How much fencing do I need to buy to fully enclose this garden.
Solution:
Let two = 2
Let width = 10
Let length = 20
Perimeter = two * (width + length) = 2 * (10 + 20) = 60

Because it is not likely that the formula for the perimeter of a rectangle is likely to change in the next few years, there is need to define a variable for the constant 2 in this formula.
Understood.
The intent of the question is about more involved number-situations, using or needing ratios, rational expressions, volumes, compositions of mixtures.
 
  • #6
One other thing folks can do with variables is to carry the units of measure (UoM) so that once again you've self documented the data in a way to at least spot a UoM error. In my field, we are constantly worried about converting english to metric and back again or radian measure to degrees and back. The scientific side prefers the metric units by the enduser prefers english measure.

There are guidelines for variable naming that some folks use or used to use. One such example was Symonyi notation where variable prefixes told you the datatype or usage of the variable. It was kind of cool to use until you realized that each programmer might extend it using their own personal conventions and then it got harder to read.

Early FORTRAN had some builtin conventions where variables starting with the letters I thru N where considered INTEGERs and anything else was a REAL. FORTRAN did allow you to override the convention but then that would confuse other programmers maintaining your code.
 
  • #7
symbolipoint said:
Did anybody of the group recall like in first learning Physics: Assign variables to everything, and then solve all in variables, and to substitute the values last?

I don't recall being taught it explicitly, but it's probably the approach my professors used and certainly the approach I prefer myself. The symbols give the equation meaning, and it's much easier to see at a glance what's going on.

I definitely use this approach in computer programming as well, and I think that's recommended in computer science. That is, to use named variables or constants rather than numerical values. For instance if you are writing code for something that uses 72 pixels per inch you'd define a constant PIXELSPERINCH to be 72. There may be other constants that depend on that value, so they'd be given as formulas in terms of PIXELSPERINCH.

In coding this has the practical advantage that you can change PIXELSPERINCH to be a different value and it automatically corrects all code that depends on that value. But it also includes the readability when values have a meaningful name, not just a number.
 

FAQ: A matter of style? Algebra, Arithmetic, Variables

1. What is the difference between algebra and arithmetic?

Algebra and arithmetic are both branches of mathematics, but they differ in their approach and focus. Arithmetic deals with the basic operations of addition, subtraction, multiplication, and division on numbers, while algebra uses symbols and variables to represent unknown quantities and solve equations.

2. What are variables in algebra?

Variables are symbols used to represent unknown quantities in algebraic equations. They can take on different values and are usually represented by letters such as x, y, or z. Variables allow us to solve equations and find the value of unknown quantities.

3. How do I solve an algebraic equation?

To solve an algebraic equation, you need to isolate the variable on one side of the equation by performing the same operation on both sides. This will help you find the value of the variable. Remember to follow the order of operations and simplify the equation as much as possible.

4. What is the importance of learning algebra?

Algebra is an essential tool for problem-solving and critical thinking in many fields, including science, engineering, and economics. It helps us understand patterns and relationships between quantities and provides a foundation for more advanced mathematical concepts.

5. How can I improve my algebra skills?

The best way to improve your algebra skills is through practice. Start with basic concepts and gradually move on to more challenging problems. You can also seek help from teachers, tutors, or online resources. Remember to review and reinforce your understanding of algebra regularly.

Similar threads

Replies
9
Views
2K
Replies
5
Views
2K
Replies
1
Views
2K
Replies
1
Views
1K
Replies
1
Views
946
Replies
44
Views
4K
Back
Top