Which one is correct of the two?

157 Views Asked by At

I actually want to know the proper usage of curly brackets and parentheses. I just used the function notation to express my question.

My question is that when using a function notation, we use a first bracket or parenthesis in writing them, like this $f(x)$. Now when I need to use parentheses now for doing some mathematical operations, like multiplying, can I use a parenthesis or do I use curly brackets $\{\}$? I explain it below with an example:-

Now which is of the following is the proper way to write ," 3 is multiplied with the sum of $f(x)$ and 3", here $f(x)$ is any function :-

$3\{f(x) +5\}$ or,

$3(f(x) +5)$

If there's any problem in my question please inform me. Thanks!

1

There are 1 best solutions below

1
On BEST ANSWER

Some teach that one should cycle between $()$, $[]$, and $\{\}$ when grouping expressions. This may sometimes improve legibility and may help prevent unmatched parentheses. But there is truly nothing wrong with always using $()$ for grouping.

One problem of all these symbols is that they already have some "fixed" meaning apart from grouping. Among these are

Round Parentheses:

  • function application to an argument as in $f(x)$
  • tuples, as in $(x,y)$, so in articular $(1+2)$ could be the one-tuple with single component $3$
  • vectors and matrices, so a simple parenthesized expression could be a $1\times 1$-matrix
  • binomial coefficients such as $n\choose k$. These can be confused with a $2\times 1$ matrix or a column vector
  • permutations, as in $(1\,2\,3)$ standing for the permutation mapping $1\mapsto 2$, $2\mapsto 3$, and $3\mapsto 1$; can be confused with a row vector
  • open intervals as in $(0,1)$ for the set of real numbers strictly between $0$ and $1$; can be confused with an ordered pair; some prefer $\left]0,1\right[$ for precisely that reason.

Square Brackets:

  • the floor function, i.e., $[x]$ is the greatest integer $\le x$. Another common and less ambiguous notation is $\lfloor x\rfloor$
  • sometimes function application to sets such as $f[A]:=\{\,f(x)\mid x\in A\,\}$. However, most people just uses $f(A)$ for this as well
  • many write $E[X]$ for the expected value of random variable $X$
  • some use square brackets for matrices
  • $\left[{n\atop k}\right]$ is a Stirlingnumbre of the first kind (or a $2\times 1$ matrix?)
  • closed intervals as in $[0,1]$ for the set of real numbers from $0$ to $1$, inclusive.

Curly braces:

  • Sets (and classes) in various notation patterns, such as $\{a,b,c\}$, $\{\,x\in \Bbb Q\mid x^2<2\,\}$, or $\{\,e^{it}\mid 0<t<\pi\,\}$
  • $\{x\}$ is sometimes used for the fractional part of a number $s$, $\{x\}=x-\lfloor x\rfloor$; of course, syntactically indistinguishable from the set with only element $x$.
  • $\left\{n\atop k\right\}$ is a Stirling number of the second kind

Angle brackets:

  • $\langle a,b\rangle$ for the subgroup, subspace, or other generated by $a$ and $b$
  • $\langle a,b\rangle$ for the scalar product of $a$ and $b$; used especially by authors who want to avoid confusion with anything denoted by round parentheses or the infix middle dot
  • Bra and ket notation in physics is loosely connected to the preceding point

... and I am sure I still have left out many wide-spread notational uses of these. In the light of this, I personally would rather use only one pair of symbols for grouping. While this still leaves a lot of possibly ambiguous cases (that we see already in the above list without grouping), I personally think it is better to at least be (somewhat) sure what is meant by "unusual" parentheses $[]$, $\{\}$, $\langle\rangle$, whereas $()$ can - in the most typical expressions - only be for grouping or function arguments.