Math formatting question (brackets v. parentheses)

Is there any general rule regarding when to use brackets and when to use parentheses, expecially regarding complex formulas? I’ve been using L[sub]A[/sub]T[sub]e[/sub]X to format my stats homework, and I’m curious.

(NOTE: The actual homework I’m doing fine with…it’s the formatting that’s got me, especially when simplifying the equations.)

For example, go here and copy and paste this code in the hard-to-see white box (it’s just below all the text).


\center{ $$ s^2 = \frac{1}{n - 1} \left[ \sum\limits_{i=1}^nx_i^2 - \frac{ \left( \sum\limits_{i=1}^nx_i \right) ^2}{n}  \right] $$

	$$ s^2 = \frac{1}{6-1} \left[ \left[ \left( \$157 \right) ^2 + \left( \$132 \right) ^2 + \left( \$109 \right) ^2 + \left( \$145 \right) ^2 + \left( \$125 \right) ^2 + \left( \$139 \right) ^2 \right] - \frac{ \left( \sum\limits_{i=1}^nx_i \right) ^2}{n}  \right] $$
	
	$$ s^2 = \frac{1}{5} \left[ 109925 - \frac{ \left( \$157 + \$132 + \$109 + \$145 + \$125 + \$139 \right) ^2}{6}  \right] $$
	
	$$ s^2 = \frac{1}{5} \left[ 109925 - \frac{651249}{6}  \right] $$
	
	$$ s^2 = \frac{1}{5} \left[ 109925 - 108541.5 \right] $$
	
	$$ s^2 = \frac{1}{5} \left[ 1383.5 \right] $$
	
	$$ s^2 = 276.7 $$ }

Should I change those brackets to parentheses in the third or fourth step? Is that a big no-no? Does it really matter, as long as it’s understandable? Or have I got something horribly, horribly wrong here?

No, actually it doesn’t matter. The convention is to use parentheses first on the inside and then brackets if you need to group further on the outside. Beyond that some people use more brackets and others I have seen use curly braces {}, but that is less common from my experience. What you have looks fine to me.

to tell the truth, I wouldn’t have used any of those brackets. Here’s why. In the first three equations, the outer brackets are of a different size from the inner parentheses and therefore can just as well be parentheses. In the second equation, the inner brackets add nothing and should be omitted. (What is a square dollar, by the way?) The last three equations should have parens, not brackets. The general principle is to use parens (and only when needed) unless the reader is going to need help in pairing them off. When necessary, alternate parens and brackets.

Incidentally, you have a bit to learn about TeXcraft. For instance the \center has no effect, since displays are automatically centered anyway.

I agree with Hari Seldon in general, but I’m not sure whether he noticed that the equations in question all follow from one another, so that the reason brackets were used in the last three is because they had started out as brackets in the first three. Changing them would have been confusing. And I don’t see anything wrong with using brackets in the first equation, just that, as Hari Seldon pointed out, parentheses would work fine there.

I also agree with nano8track, who is correct about the convention.

Of course, there are other mathematical concepts besides grouping where it does matter what you use: square brackets vs. round parentheses for closed vs. open intervals, round parentheses for ordered n-tuples, curly braces for unordered sets, etc.

Thanks for the help everyone.

It’s the unit that you get when you multiply two dollar amounts. I’m not mathematically-minded enough to imagine exactly what it means in the real world, but in some areas of math it’s important that you keep your ducks in a row regarding the units you are using. For example, in Statistics, which is what I’m doing, the sample variance is always given in units squared, I believe. This is important because the sample standard deviation is equal to the square root of the sample variance. Another example: The coefficient of variation can be used to compare two populations even if they have different units. This is because it is defined as the standard deviation divided by the mean (multiplied by 100 to get a percentage). The standard deviation and the mean of a population (or a sample) each have the units of the sample (people, inches, dollars, whatever). When you divide them, the units cancel out, giving you a “raw score” and allowing you to compare it with any other population or sample’s raw score without regard to units.

Yeah, I’m aware of that and the \center isn’t in my actual code. For whatever reason, if I took it out in that web renderer, it wasn’t centered. I’m not sure why, as it’s centered just fine in my actual code without it.

There are no hard and fast rules. I, muself, only use brackets instead of parens either when collecting together a particularly interesting subexpression, or when trying to clarify functional notation. That is, if I have an operator T on a space of functions I may write T(f) to emphasize that I mean the value of the transformed function T(f) at the point x.

Oh, and in text we usually just write LaTeX. If you want the positions, ‘A’ and ‘E’ are both capitals, the ‘A’ is up, and the ‘E’ is down: “L[sup]A[/sup]T[sub]E[/sub]X”

And the L, T, and X are italicized: L[sup]A[/sup]T[sub]E[/sub]X. Which still doesn’t get all the relative sizes quite right, either, but that’s beyond my limit.

This is why we need to scrap this MathML stuff and just put TeX support into XML.

That’s fine – some of us can only approach your limit.

(Math humor ha ha!

…and that’s all I got.)