Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 重复排列_R_Permutation - Fatal编程技术网

R 重复排列

R 重复排列,r,permutation,R,Permutation,在R中,如何生成一个群的所有置换,但在这个群中有一些重复的元素 例如: A = {1,1,2,2,3} 解决方案: 1,1,2,2,3 1,1,2,3,2 1,1,3,2,2 1,2,1,2,3 1,2,2,1,3 1,2,2,3,1 . . 只需使用combinat软件包: A = c(1,1,2,2,3) library(combinat) permn(A) x <- c(1,1,2,2,3) require(permute) allPerms(x, observed = TR

在R中,如何生成一个群的所有置换,但在这个群中有一些重复的元素

例如:

A = {1,1,2,2,3} 
解决方案:

1,1,2,2,3
1,1,2,3,2
1,1,3,2,2
1,2,1,2,3
1,2,2,1,3
1,2,2,3,1
.
.

只需使用
combinat
软件包:

A = c(1,1,2,2,3)
library(combinat)
permn(A)
x <- c(1,1,2,2,3)
require(permute)
allPerms(x, observed = TRUE)

只需使用
combinat
软件包:

A = c(1,1,2,2,3)
library(combinat)
permn(A)
x <- c(1,1,2,2,3)
require(permute)
allPerms(x, observed = TRUE)

使用
gtools
软件包

library(gtools)

x <- c(1,1,2,2,3)

permutations(5, 5, x, set = FALSE)
库(gtools)

x使用
gtools
软件包

library(gtools)

x <- c(1,1,2,2,3)

permutations(5, 5, x, set = FALSE)
库(gtools)

x使用
permute
包:

A = c(1,1,2,2,3)
library(combinat)
permn(A)
x <- c(1,1,2,2,3)
require(permute)
allPerms(x, observed = TRUE)

x使用
permute
包:

A = c(1,1,2,2,3)
library(combinat)
permn(A)
x <- c(1,1,2,2,3)
require(permute)
allPerms(x, observed = TRUE)

x如果要使用内置的R:

permute <- function(vec,n=length(vec)) {
  permute.index <- sample.int(length(vec),n)
  return(vec[permute.index])
}

permute(A)

permute如果您想使用内置的R:

permute <- function(vec,n=length(vec)) {
  permute.index <- sample.int(length(vec),n)
  return(vec[permute.index])
}

permute(A)

permute我对组合和置换做了广泛的研究。我发现这个结果写在一本叫做“连接”的书上(一种计算组合和排列的艺术)

我也为你的问题找到了解决方案。我还发现了一种多对象排列。这种多对象排列我称之为(MSNO的CON),意思是多个相同数量对象的组合顺序号

要查看此订购方法,请访问网站
在这个网站的底部,我附上了一些word文档。您需要的解决方案写在word文档12-Proof(MSNO的CON)和13-Proof(MSNO的CON)上下载此word文档,以便正确查看书面内容。

我对组合和排列进行了广泛的研究。我发现这一结果写在一本名为“连接”(计算组合和排列的艺术)的书上。要查看我的网站,请登录

我也为你的问题找到了解决方案。我还发现了一种多对象排列。这种多对象排列我称之为(MSNO的CON),意思是多个相同数量对象的组合顺序号

要查看此订购方法,请访问网站 在这个网站的底部,我附上了一些word文档。您所需的解决方案写在word文档12证明(MSNO的CON)和13证明(MSNO的CON的相反)。下载这个word文档以正确查看书面内容