Description Usage Arguments Value Examples

Given a distance (kendall, cayley, hamming or ulam), the number of items in the permutations perm.length and distance value d, how many permutations are there at distance d from any permutation? It can be used to count the number of derangements and the permutations with k cycles (Stirling numbers of the first kind)

1 | ```
count.perms(perm.length, dist.value, dist.name = "kendall", disk = FALSE)
``` |

`perm.length` |
number of items in the permutations |

`dist.value` |
the distance |

`dist.name` |
optional. One of: kendall (default), cayley, hamming, ulam |

`disk` |
optional can only be true if counting the permutations at each Ulam distance. Insted of generating the whole set of SYT and count of permutations per distance, it loads the info from a file in the disk |

The number of permutations at the given distance

1 2 3 4 5 6 7 8 9 10 | ```
count.perms(4,2,"kendall")
count.perms(4,2,"ulam")
count.perms(4,2,"hamming")
count.perms(4,2,"cayley")
# The number of derangements of length 6 is computed as follows
len <- 6
count.perms(perm.length = len, dist.value = len, dist.name = "h")
# The number of permutations with one cycle is computed as follows
num.cycles <- 1
count.perms(perm.length = len, dist.value = len - num.cycles, dist.name = "c")
``` |

```
Loading required package: Rcpp
[1] 5
[1] 13
[1] 6
[1] 11
[1] 265
[1] 120
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.