Introduction to Mathematica: Parentheses, Brackets, and Braces

In mathematics, there is generally no meaningful difference among parentheses, square brackets, and curly braces (see right), and so they are used interchangeably, but often in combination to ease the reader’s task of identifying which open-brace matches with which close-brace. In Mathematica™, however, these three types of braces have fundamentally different meanings, and it is critical to ensure that you are using the correct brace for a particular function.

Parentheses

Parentheses are used in Mathematica™ to group elements of expressions together in order to specify a non-standard order of operations, and can be nested as deeply as you like. This is what we normally think of as the standard behavior of braces.

Square Brackets

Square brackets are used to set off function arguments.

Curly Braces

Curly braces are used to group elements of a list together. There will be a complete separate tutorial concerning lists.

Double Square Brackets

Double Square Brackets are used to select specific elements from a list.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s