GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javascript-algorithms/src/algorithms/sets/permutations at master · bakbas/javascript-algorithms

Expand file tree

/

permutations

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

permutations

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
__test__
__test__
 
 
README.md
README.md
 
 
permutateWithRepetitions.js
permutateWithRepetitions.js
 
 
permutateWithoutRepetitions.js
permutateWithoutRepetitions.js
 
 

README.md

Outline

Permutations

When the order doesn't matter, it is a Combination.

When the order does matter it is a Permutation.

"The combination to the safe is 472". We do care about the order. 724 won't work, nor will 247. It has to be exactly 4-7-2.

Permutations without repetitions

A permutation, also called an “arrangement number” or “order”, is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with S itself.

Below are the permutations of string ABC.

ABC ACB BAC BCA CBA CAB

Or for example the first three people in a running race: you can't be first and second.

Number of combinations

n * (n-1) * (n -2) * ... * 1 = n!

Permutations with repetitions

When repetition is allowed we have permutations with repetitions. For example the the lock below: it could be 333.

Permutation Lock

Number of combinations

n * n * n ... (r times) = n^r

Cheat Sheets

Permutations cheat sheet

Permutations Cheat Sheet

Combinations cheat sheet

Combinations Cheat Sheet

Permutations/combinations algorithm ideas.

Algorithms Idea

References

  • Math Is Fun
  • Permutations/combinations cheat sheets
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.