# Reading materials needed about permutations?

**URL:** <https://community.wolfram.com/t/reading-materials-needed-about-permutations/16616>\
**Category:** Questions\
**Tags:** algebra, discrete-mathematics\
**Created:** [August 23, 2020, 10:18pm UTC](https://community.wolfram.com/t/reading-materials-needed-about-permutations/16616 "2020-08-23T22:18:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shokutaku](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@shokutaku](https://community.wolfram.com/u/shokutaku)\
**Post date:** [August 23, 2020, 10:18pm UTC](https://community.wolfram.com/t/reading-materials-needed-about-permutations/16616/1 "2020-08-23T22:18:03Z")

</div>

After 20 years of Mathematica I must confess to having no clue about anything involving permutations, cycles or groups. I would like to find some information in English, because documentation assumes too much background for a high school grad like me. For example, playing with toy NK landscape models, I can construct a k=1 list of four elements as follows, but it seems crude.

```
With[{x = {1, 2, 3, 4}}, 
 Union[Partition[x, 2, 1], {{x[[Length@x]], x[[1]]}}]] (* for k>1, this could become messy *)

```

I assume such cyclic patterns would be used quite often in discrete applications. How do knowledgable people accomplish such things?

---

<div class="post-metadata">

**Author:** ![hansmilton](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hansmilton/32/8656_2.png) [@hansmilton](https://community.wolfram.com/u/hansmilton)\
**Post date:** [August 24, 2020, 6:56pm UTC](https://community.wolfram.com/t/reading-materials-needed-about-permutations/16616/2 "2020-08-24T18:56:14Z")

</div>

This is one way:

```
r = Range@5

Partition[PadRight[r, Length@r + 1, First@r], 2, 1]
(* {{1,2},{2,3},{3,4},{4,5},{5,1}} *)

```

---

<div class="post-metadata">

**Author:** ![shokutaku](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@shokutaku](https://community.wolfram.com/u/shokutaku)\
**Post date:** [August 24, 2020, 9:01pm UTC](https://community.wolfram.com/t/reading-materials-needed-about-permutations/16616/3 "2020-08-24T21:01:31Z")

</div>

Wow, that was simple… never thought about padding right or left. Thanks a lot!  
I just figured out how to treat other neighborhood sizes: With[{r = Range@5, n = 4},  
Partition[PadRight[r, Length@r + n - 1, r], n, 1]]  
Any idea about introductory texts?  
I had all of Trott’s books out could never follow two consecutive pages. Guess I need the groups for dummies book.

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [August 24, 2020, 10:35pm UTC](https://community.wolfram.com/t/reading-materials-needed-about-permutations/16616/4 "2020-08-24T22:35:33Z")

</div>

Using `Join` and `Take`

```
With[{r = Range@5, n = 4}, Partition[Join[r, Take[r, n - 1]], n, 1]]
(* {{1, 2, 3, 4}, {2, 3, 4, 5}, {3, 4, 5, 1}, {4, 5, 1, 2}, {5, 1, 2, 3}} *)

```
