Forgot password?
 Register account
View 263|Reply 8

n choose k

[Copy link]

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2025-1-21 19:31 |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
对比:

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

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

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

kuing Posted 2025-1-21 20:32
Last edited by kuing 2025-1-21 20:38n \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\]

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

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

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

kuing Posted 2025-1-21 23:24
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
结果是

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

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

768

Threads

4685

Posts

310K

Credits

Credits
35004

Show all posts

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

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

 Author| hbghlyj Posted 2025-1-30 20:39
  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 2025-1-30 20:45

Mobile version|Discuz Math Forum

2025-6-4 17:10 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit