“Sample 指令”的版本间的差异

来自GeoGebra Manual
跳转至: 导航搜索
(Autogenerated from properties)
 
(en)
 
(未显示另一用户的1个中间版本)
第1行: 第1行:
<noinclude>{{Manual Page|version=4.0}}</noinclude>{{command|statistics|Sample}}
+
<noinclude>{{Manual Page|version=4.0}}</noinclude>{{command|cas=true|statistics|Sample}}
 
;Sample[ <List>, <Size> ]
 
;Sample[ <List>, <Size> ]
 
:{{translate|Sample Command}}
 
:{{translate|Sample Command}}
第10行: 第10行:
 
;Sample[ <List>, <Size>, <With Replacement> ]
 
;Sample[ <List>, <Size>, <With Replacement> ]
 
:{{translate|Sample Command}}
 
:{{translate|Sample Command}}
 +
;Sample[ <List L>, <Size n> ]
 +
:Returns list of ''n'' randomly chosen elements of ''L''; elements can be chosen several times.
 +
:{{example|1=<div><code><nowiki>Sample[{1, 2, 3, 4, 5}, 5]</nowiki></code> yields for example ''{1, 2, 1, 5, 4}''.</div>}}
 +
;Sample[ <List L>, <Size n>, <Boolean for replacement> ]
 +
:Returns list of ''n'' randomly chosen elements of ''L''. Elements can be chosen several times if and only if the last parameter is true.
 +
:{{example|1=<div><code><nowiki>Sample[{1, 2, 3, 4, 5}, 5, true]</nowiki></code> yields for example ''{2, 3, 3, 4, 5}''.</div>}}
 +
==CAS Syntax==
 +
;Sample[ <List L>, <Size n> ]
 +
:Returns list of ''n'' randomly chosen elements of ''L''; elements can be chosen several times.
 +
:{{example|1=<div><code><nowiki>Sample[{-5, 2, a, 7, c}, 3]</nowiki></code> yields for example ''{a, 7, -5}''.</div>}}
 +
;Sample[ <List L>, <Size n>, <Boolean for replacement> ]
 +
:Returns list of ''n'' randomly chosen elements of ''L''. Elements can be chosen several times if and only if the last parameter is true.
 +
:{{example|1=<div>The list can include lists as well: Let ''List1'' be ''{1, 2, 3}''.<br /><code><nowiki>Sample[{List1, 4, 5, 6, 7, 8}, 3, false]</nowiki></code> yields for example ''{6, {1, 2, 3}, 4}''.</div>}}

2011年10月20日 (四) 03:33的最新版本

Accessories dictionary.png
本頁為官方文件,一般使用者無法修改,若有任何誤謬,請與官方聯絡。如欲編輯,請至本頁的開放版


Sample[ <List>, <Size> ]
UnderConstruction.png
目前本頁中文說明尚未翻譯完成,請先連至英文說明。如果您有權限,請幫忙翻譯本頁的官方手冊
Sample[ <List>, <Size>, <With Replacement> ]
UnderConstruction.png
目前本頁中文說明尚未翻譯完成,請先連至英文說明。如果您有權限,請幫忙翻譯本頁的官方手冊

CAS 視窗

Sample[ <List>, <Size> ]
UnderConstruction.png
目前本頁中文說明尚未翻譯完成,請先連至英文說明。如果您有權限,請幫忙翻譯本頁的官方手冊
Sample[ <List>, <Size>, <With Replacement> ]
UnderConstruction.png
目前本頁中文說明尚未翻譯完成,請先連至英文說明。如果您有權限,請幫忙翻譯本頁的官方手冊
Sample[ <List L>, <Size n> ]
Returns list of n randomly chosen elements of L; elements can be chosen several times.
範例:
Sample[{1, 2, 3, 4, 5}, 5] yields for example {1, 2, 1, 5, 4}.
Sample[ <List L>, <Size n>, <Boolean for replacement> ]
Returns list of n randomly chosen elements of L. Elements can be chosen several times if and only if the last parameter is true.
範例:
Sample[{1, 2, 3, 4, 5}, 5, true] yields for example {2, 3, 3, 4, 5}.

CAS Syntax

Sample[ <List L>, <Size n> ]
Returns list of n randomly chosen elements of L; elements can be chosen several times.
範例:
Sample[{-5, 2, a, 7, c}, 3] yields for example {a, 7, -5}.
Sample[ <List L>, <Size n>, <Boolean for replacement> ]
Returns list of n randomly chosen elements of L. Elements can be chosen several times if and only if the last parameter is true.
範例:
The list can include lists as well: Let List1 be {1, 2, 3}.
Sample[{List1, 4, 5, 6, 7, 8}, 3, false] yields for example {6, {1, 2, 3}, 4}.
© 2024 International GeoGebra Institute