- 例如母集合為{A, B, C},其子集合可由下列語法列出:
- 語法
{{#invoke:Combination|subset| A=1 | B=1 | C=1 | format = *{{{1}}}\n }}
- 語法
- 將顯示為:
- 空集合
- A
- B
- C
- AB
- AC
- BC
- ABC
- 若母集合某元素出現不止一次{A, B, B, C},例如B出現2次,其子集合可由下列語法列出:
- 語法
{{#invoke:Combination|subset| A=1 | B=2 | C=1 |format=*{{{1}}}\n}}
- 語法
- 將顯示為:
- 空集合
- A
- B
- C
- AB
- AC
- BB
- BC
- ABB
- ABC
- BBC
- ABBC
- 而參數format控制的是輸出格式,也可以將其改為表格輸出
- 例如語法:
{| class=wikitable style="border-collapse: collapse;table-layout: fixed;width: 80%; text-align:center;"
{{#invoke:Combination|subset|A=1|B=1|C=1| format = {{!}}{{{1}}}\n }}
|}
- 將顯示為:
- 另可用參數empty_set控制空集合的輸出
- 例如語法:
{| class=wikitable style="border-collapse: collapse;table-layout: fixed;width: 80%; text-align:center;"
{{#invoke:Combination|subset|A=1|B=1|C=1| empty_set = <math>\varnothing</math> |format={{!}}{{{1}}}\n}}
|}
- 將顯示為:
集合{A, B, C}的子集合 A B C AB AC BC ABC
Wikiwand in your browser!
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.