Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I know how to type a fraction as you would write a fraction in Mathematica (9). How do you type Binomial[n,k] as $\binom{n}{k}$ in Mathematica? Is there a single reference page that contains all the Mathematica operations like this, that you can type in math notation?

share|improve this question
    
I just realized that this might conflict with typing vector notation (CTRL+Enter), so probably the way to do this is to type $\frac{n!}{(n-k)!k!}$ –  Identity Dec 6 '13 at 1:56
    
What exactly are you trying to achieve? (1) Just display something? (2) Interpret that displayed form as Binomial? (3) Or display Binomial in that form? TraditionalForm will do (3). Use Ron's answer for (1). (2) is not simple and I don't recommend it. When talking to computers it's best to stick to a clear, unambiguous notation (which the usual math notation is not---it always relies on a human reader who understands the problem and the context). –  Szabolcs Dec 6 '13 at 2:05
    
Here's a reason not to force these things. There's a difference between those two inputs but you can't see it. The first one was created by transforming the cell to TraditionalForm. The second one was input directly as a visual form. –  Szabolcs Dec 6 '13 at 2:07
    
@Szabolcs to (2) type that in displayed form and have Mathematica interpret it as Binomial. Yes, a little while after I asked this, I realized why (2) would be a problem. –  Identity Dec 6 '13 at 2:33
add comment

1 Answer

up vote 7 down vote accepted

The possibility to insert operators and functions as you know them from mathematics is not possible for all things. Usually, you find the special input possibilities on the reference page of the function in the Details section. See for instance the documentation of Integrate.

For Binomial there seems to be no such 2d input, because as you already found out, $\binom{n}{k}$ is interpreted as vector.

The 2d input should in general be used with care, because it is sometimes harder to spot errors. And, when you want to copy a nice looking

Mathematica graphics

into a text editor or to this site, you end up with

\[Integral]Sqrt[x + Sqrt[x]] \[DifferentialD]x

which just looks awful.

Edit

Szabolcs came up with the idea that you could make a button for your needs. To see how this is derived, you first look at the TraditionalForm of Binomial

Binomial[n, k] // TraditionalForm

Mathematica graphics

Now you go in the output cell and navigate to Cell->Show Expression

Cell[BoxData[
 FormBox[
  TemplateBox[{"n","k"},
   "Binomial"], TraditionalForm]], "Output",
 CellChangeTimes->{3.5952851298543243`*^9, 3.595285236592402*^9}]

At this point, you see the you need to create the inner TemplateBox and therefore

DisplayForm[
 ButtonBox[
  TemplateBox[{"\[SelectionPlaceholder]", "\[SelectionPlaceholder]"}, 
   "Binomial"], BaseStyle -> "Paste"]]

Mathematica graphics

creates a button which lets you insert Binomial as correct 2d expression.

share|improve this answer
    
Here's a paste button: PasteButton[ RawBoxes@TemplateBox[{"\[SelectionPlaceholder]", "\[SelectionPlaceholder]"}, "Binomial"]]. You could update your answer with it. –  Szabolcs Dec 6 '13 at 2:21
    
@Szabolcs Thanks, I updated the post. –  halirutan Dec 6 '13 at 2:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.