{ localUrl: '../page/5wv.html', arbitalUrl: 'https://arbital.com/p/5wv', rawJsonUrl: '../raw/5wv.json', likeableId: '3404', likeableType: 'page', myLikeValue: '0', likeCount: '3', dislikeCount: '0', likeScore: '3', individualLikes: [ 'EricBruylant', 'JaimeSevillaMolina', 'EvanHicks' ], pageId: '5wv', edit: '7', editSummary: '', prevEdit: '6', currentEdit: '7', wasPublished: 'true', type: 'wiki', title: 'Factorial', clickbait: '', textLength: '6541', alias: '5wv', externalUrl: '', sortChildrenBy: 'likes', hasVote: 'false', voteType: '', votesAnonymous: 'false', editCreatorId: 'PatrickStevens', editCreatedAt: '2016-08-18 07:05:29', pageCreatorId: 'PatrickStevens', pageCreatedAt: '2016-08-17 11:04:27', seeDomainId: '0', editDomainId: 'AlexeiAndreev', submitToDomainId: '0', isAutosave: 'false', isSnapshot: 'false', isLiveEdit: 'true', isMinorEdit: 'false', indirectTeacher: 'false', todoCount: '0', isEditorComment: 'false', isApprovedComment: 'true', isResolved: 'false', snapshotText: '', anchorContext: '', anchorText: '', anchorOffset: '0', mergedInto: '', isDeleted: 'false', viewCount: '44', text: '[summary: The *factorial* of a number $n$ is how we describe "how many different ways we can arrange $n$ objects in a row".]\n\n# Three objects in a line\n\nHow many ways are there to arrange three objects in a line?\n(I'll use numbers $1,2,3$ to represent the objects; pretend I painted the numbers onto the respective objects.)\nFor example, $1,2,3$ is one way to arrange the three objects; $1,3,2$ is another; and so on.\n\nTo be completely concrete, let's say I have three same-sized cubes and I have three same-sized boxes to place them in; the boxes are arranged into one row and can't be moved (they're too heavy), but the cubes are made of balsa wood and can be moved freely.\nThe number $1$ is painted on one cube; $2$ on another; and $3$ on the third.\nHow many ways are there to arrange the cubes into the fixed boxes?\n\nHave a think about this, then reveal the answer and a possible way of getting the answer.\n\n%%hidden(Show solution):\nThe total number of ways is $6$.\nThe complete list of possible options is:\n\n- $1,2,3$\n- $1,3,2$\n- $2,1,3$\n- $2,3,1$\n- $3,1,2$\n- $3,2,1$\n\nI've listed them in an order that hopefully makes it fairly easy to see that there are no more possibilities.\nFirst I listed every possible way $1$ could come at the beginning; then every possible way $2$ could; then every possible way $3$ could.\n\nIf you got the answer $6$ through some *other* method, that's (probably) fine: there are many ways to think about this problem.\n%%\n\nHow about arranging four objects in a line? (That is, four cubes into four fixed boxes.)\n\nThe total number of ways is $24$.\nThe complete list of possible options is:\n\n- $1,2,3,4$\n- $1,2,4,3$\n- $1,3,2,4$\n- $1,3,4,2$\n- $1,4,2,3$\n- $1,4,3,2$\n- $2,1,3,4$\n\n… I got bored.\n\nHow could we do this *without* listing all the possibilities?\nI promise the answer really is $24$, but you should think about this for a bit before continuing.\n\n# How to arrange four objects\n\nThere's an insight that makes everything much easier.\n\n> Once we've placed a cube into the leftmost box, all we have left to do is fit the remaining three cubes into the remaining three boxes.\n\nWe've already seen above that there are $6$ ways to arrange three cubes among three boxes!\n\nSo the total number of ways of doing four cubes among four boxes is:\n\n- $6$ ways where the leftmost box contains cube $1$ (and I actually listed all of those above before I got bored);\n- $6$ ways where the leftmost box contains cube $2$;\n- $6$ ways where the leftmost box contains cube $3$;\n- $6$ ways where the leftmost box contains cube $4$.\n\nThat comes to $24$ in total.\n\n# Interlude: Exercise\n\nCan you work out how many ways there are to arrange *five* cubes into *five* fixed boxes?\nTake a hint from how we did four boxes above.\n\n%%hidden(Show solution):\nThere are $120$ ways to do this.\nRemember, there are $24$ ways to arrange four cubes among four boxes.\n\nThen to arrange five cubes among five boxes:\n\n- $24$ ways where the leftmost box contains cube $1$\n- $24$ ways where the leftmost box contains cube $2$\n- $24$ ways where the leftmost box contains cube $3$\n- $24$ ways where the leftmost box contains cube $4$\n- $24$ ways where the leftmost box contains cube $5$\n\nThat comes to $120$ in total.\n%%\n\n# In general\n\nOK, that was all well and good.\nBut if we didn't already know how to arrange four objects into four boxes, how could we jump straight to arranging five objects into five boxes?\n\nWell, you might have noticed a pattern already.\n\n- To arrange five boxes, we added the four-boxes number to itself five times; that is, we multiplied the four-boxes number by $5$.\n- To arrange four boxes, we added the three-boxes number to itself four times; that is, we multiplied the three-boxes number by $4$.\n\nPerhaps you can see that this will *always* work: to arrange $n$ boxes, we add the $n-1$-boxes number to itself $n$ times. That is, we multiply the $n-1$-boxes number by $n$.\nIndeed, there are $n$ possible ways to fill the leftmost box %%note:We can do it with the number $1$, or the number $2$, or… or the number $n$; that's $n$ ways.%% and once we've done that, there are "the $n-1$-boxes number" ways to fill the remaining $n-1$ boxes.\n\nBut this still doesn't help us jump straight to how to arrange five objects into five boxes.\nHere comes the clever bit.\n\nLet's write $5!$ (with an exclamation mark) for the number that is "how many ways to arrange five objects into five boxes". %%note:We already know this number is actually $120$.%%\nSimilarly, $4!$ is "how many ways to arrange four objects into four boxes", and in general $n!$ is "how many ways to arrange $n$ objects into $n$ boxes".\n\nThen the patterns we noted earlier become:\n\n- $5! = 5 \\times 4!$\n- $4! = 4 \\times 3!$\n\n(Notice how much cleaner that is than "To arrange five boxes, we added the four-boxes number to itself five times; that is, we multiplied the four-boxes number by $5$". This is why mathematicians use notation: to make everything easier to say.)\n\nAnd the general rule is: %%note: Being careful to put $n-1$ in brackets, because otherwise it looks like $n \\times n - 1!$, which means $(n \\times n)-1!$ according to the [-54s].%% $$n! = n \\times (n-1)!$$\n\nOK, we have\n\n- $n! = n \\times (n-1)!$, and \n- $(n-1)! = (n-1) \\times (n-2)!$, and \n- $(n-2)! = (n-2) \\times (n-3)!$, and so on.\n\nSo $$n! = n \\times (n-1)! = n \\times (n-1) \\times (n-2)! = n \\times (n-1) \\times (n-2) \\times (n-3)!$$\nand so on.\n\nIf we just keep going, we'll eventually reach $$n \\times (n-1) \\times (n-2) \\times \\dots \\times 5 \\times 4 \\times 3!$$\nand we already know that $3! = 6$, which I'll write as $3 \\times 2 \\times 1$ for reasons which are about to become obvious.\n\nSo we have the following formula, which is how we define the **factorial**:\n\n$$n! = n \\times (n-1) \\times \\dots \\times 4 \\times 3 \\times 2 \\times 1$$\n\n"$n!$" is read out loud as "$n$ factorial", and it means "the number of ways to arrange $n$ objects into any order".\n\n# Edge cases\n\nWe've seen $3!$, but never $2!$ or $1!$.\n\n- It's easy to see that there are two ways to arrange two objects into an order: $1,2$ or $2,1$.\nSo $2! = 2$.\n- It's also easy (if a bit weird) to see that there is just one way of arranging one object into an order: $1$ is the only possible way. So $1! = 1$.\n- How about arranging *no* objects into an order? This is even weirder, but the answer is $1$. There *is* a way to arrange no objects into an order: just don't put down any objects. This is something which you should just accept without thinking about it too hard, and it almost never crops up. Anyway, $0! = 1$.', metaText: '', isTextLoaded: 'true', isSubscribedToDiscussion: 'false', isSubscribedToUser: 'false', isSubscribedAsMaintainer: 'false', discussionSubscriberCount: '1', maintainerCount: '1', userSubscriberCount: '0', lastVisit: '', hasDraft: 'false', votes: [], voteSummary: 'null', muVoteSummary: '0', voteScaling: '0', currentUserVote: '-2', voteCount: '0', lockedVoteType: '', maxEditEver: '0', redLinkCount: '0', lockedBy: '', lockedUntil: '', nextPageId: '', prevPageId: '', usedAsMastery: 'false', proposalEditNum: '0', permissions: { edit: { has: 'false', reason: 'You don't have domain permission to edit this page' }, proposeEdit: { has: 'true', reason: '' }, delete: { has: 'false', reason: 'You don't have domain permission to delete this page' }, comment: { has: 'false', reason: 'You can't comment in this domain because you are not a member' }, proposeComment: { has: 'true', reason: '' } }, summaries: {}, creatorIds: [ 'PatrickStevens' ], childIds: [], parentIds: [ 'factorial' ], commentIds: [], questionIds: [], tagIds: [ 'c_class_meta_tag' ], relatedIds: [], markIds: [], explanations: [], learnMore: [], requirements: [], subjects: [], lenses: [], lensParentId: 'factorial', pathPages: [], learnMoreTaughtMap: {}, learnMoreCoveredMap: {}, learnMoreRequiredMap: {}, editHistory: {}, domainSubmissions: {}, answers: [], answerCount: '0', commentCount: '0', newCommentCount: '0', linkedMarkCount: '0', changeLogs: [ { likeableId: '3416', likeableType: 'changeLog', myLikeValue: '0', likeCount: '1', dislikeCount: '0', likeScore: '1', individualLikes: [], id: '18811', pageId: '5wv', userId: 'PatrickStevens', edit: '0', type: 'deleteTag', createdAt: '2016-08-18 07:05:41', auxPageId: 'needs_summary_meta_tag', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '18809', pageId: '5wv', userId: 'PatrickStevens', edit: '7', type: 'newEdit', createdAt: '2016-08-18 07:05:29', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '18789', pageId: '5wv', userId: 'EricBruylant', edit: '0', type: 'newTag', createdAt: '2016-08-17 21:58:42', auxPageId: 'c_class_meta_tag', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '18788', pageId: '5wv', userId: 'EricBruylant', edit: '0', type: 'newTag', createdAt: '2016-08-17 21:58:21', auxPageId: 'needs_summary_meta_tag', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '18781', pageId: '5wv', userId: 'PatrickStevens', edit: '6', type: 'newEdit', createdAt: '2016-08-17 11:14:48', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '18780', pageId: '5wv', userId: 'PatrickStevens', edit: '5', type: 'newEdit', createdAt: '2016-08-17 11:11:19', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '18779', pageId: '5wv', userId: 'PatrickStevens', edit: '4', type: 'newEdit', createdAt: '2016-08-17 11:10:48', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '18778', pageId: '5wv', userId: 'PatrickStevens', edit: '3', type: 'newEdit', createdAt: '2016-08-17 11:09:37', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '18777', pageId: '5wv', userId: 'PatrickStevens', edit: '2', type: 'newEdit', createdAt: '2016-08-17 11:08:12', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '18776', pageId: '5wv', userId: 'PatrickStevens', edit: '0', type: 'newParent', createdAt: '2016-08-17 11:04:29', auxPageId: 'factorial', oldSettingsValue: '', newSettingsValue: '' }, { likeableId: '0', likeableType: 'changeLog', myLikeValue: '0', likeCount: '0', dislikeCount: '0', likeScore: '0', individualLikes: [], id: '18774', pageId: '5wv', userId: 'PatrickStevens', edit: '1', type: 'newEdit', createdAt: '2016-08-17 11:04:27', auxPageId: '', oldSettingsValue: '', newSettingsValue: '' } ], feedSubmissions: [], searchStrings: {}, hasChildren: 'false', hasParents: 'true', redAliases: {}, improvementTagIds: [], nonMetaTagIds: [], todos: [], slowDownMap: 'null', speedUpMap: 'null', arcPageIds: 'null', contentRequests: {} }