Forgot password?
 Create new account
View 130|Reply 8

n choose k

[Copy link]

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2025-1-21 19:31:03 |Read mode
  1. n \choose k
  2. \binom n k
  3. \left(^n_k\right)
  4. \begin{pmatrix}n\\k\end{pmatrix}
Copy the Code

对比:

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2025-1-21 19:40:08
  1. \tbinom n k
  2. \left(^n_k\right)
  3. \left(\smallmatrix n \\ k \endsmallmatrix\right)
Copy the Code

对比:

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2025-1-21 20:32:16
Last edited by kuing at 2025-1-21 20:38:00n \choose k 是旧语法,且两边应加 { }
\binom n k 是 amsmath 提供的,推荐使用
\left(^n_k\right) 是错误用法,因为如果是 \left(^{n+1}_k\right) 就变成 `\left(^{n+1}_k\right)`
pmatrix 环境是用于矩阵,不推荐用来输入组合数

另外,无论在真 latex 还是 mathjax 中,{n \choose k} 和 \binom nk 也是与 \frac 一样,在行内公式中的显示是小的,行间公式才是大的,所以一般不需要用 \tbinom nk。

我不知道你为啥不用 mathjax 来做对比测试而去用 upmath?

行内公式:
  1. ${n \choose k}$
  2. $\binom nk$
Copy the Code

得:
${n \choose k}$
$\binom nk$

行间公式:
  1. \[{n \choose k}\]
  2. \[\binom nk\]
Copy the Code

得:
\[{n \choose k}\]
\[\binom nk\]

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2025-1-21 22:58:34
kuing 发表于 2025-1-21 12:32
我不知道你为啥不用 mathjax 来做对比测试而去用 upmath?
因为 upmath 是使用 LaTeX

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2025-1-21 23:24:28
hbghlyj 发表于 2025-1-21 22:58
因为 upmath 是使用 LaTeX
但它似乎默认是行间公式?用
  1. [tikz]{n \choose k}[/tikz]
Copy the Code
直接就是出来大的


而如果加美元符试图变成行内公式,又会出问题,如
  1. [tikz]${n \choose k}$[/tikz]
Copy the Code
结果是

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2025-1-21 23:50:44

801

Threads

4889

Posts

310K

Credits

Credits
36169

Show all posts

isee Posted at 2025-1-24 21:26:13
推荐:\binom nk
isee=freeMaths@知乎

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2025-1-30 20:39:29
  1. \genfrac(){0pt}0{n}{k}
  2. \genfrac(){0pt}1{n}{k}
  3. \genfrac(){0pt}2{n}{k}
  4. \genfrac(){0pt}3{n}{k}
Copy the Code

Comment

0123 代表 \displaystyle \textstyle \scriptstyle \scriptscriptstyle  Posted at 2025-1-30 20:45

手机版Mobile version|Leisure Math Forum

2025-4-20 12:11 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list