Skip to main content

combinatorics

Permutations and combinations




Binomial coefficients

An ordered Set a1a2,…, ar of r distinct objects selected from a set of n objects is called a permutation of n things taken r at a time. The number of permutations is given by nPn = n(n − 1)(n − 2)⋯ (n − r + 1). When r = n, the number nPr = n(n − 1)(n − 2)⋯ is simply the number of ways of arranging n distinct things in a row. This expression is called the factorial  n and is denoted by n!. It follows that nPr = n!/(n − r)!. By convention 0! = 1.

Combinatorics and Pascal’s Triangle

Let’s calculate some values of nCr. We start with 0C0. Then we find 1C0 and 1C1. Next, 2C0, 2C1 and 2C2. Then 3C0, 3C1, 3C2 and 3C3. We can write down all these results in a table:
0C0 = 1
1C0 = 11C1 = 1
2C0 = 12C1 = 22C2 = 1
3C0 = 13C1 = 33C2 = 33C3 = 1
4C0 = 14C1 = 44C2 = 64C3 = 44C4 = 1
5C0 = 15C1 = 55C2 = 105C3 = 105C4 = 55C5 = 1

Comments

Popular posts from this blog

Advanced Structural Modeling

                                                                      Unit II                                                     Advanced Structural Modeling  A relationship is a connection among things. In object-oriented modeling, the four most important relationships are dependencies, generalizations, associations, and realizations.  Graphically, a relationship is rendered as a path, with different kinds of lines used to distinguish the different relationships. Dependency A dependency is a using relationship, specifying that a change in the specification of one thing may affect another thing that uses it, but not necessarily the reverse. Graphically, a dependency is rendered as a dashed line  A plain, unadorned dependency relationship is sufficient for most of the using relationships you'll encounter. However, if you want to specify a shade of meaning, the UML defines a number of stereotypes that may be applied to dependency relationships. There are 17 such stereo

Design Patterns UNIT-2

 A Case Study: Design a Document Editor ¾     This chapter presents a case study in the design of a "What-You-See-Is-What-You-Get" (or "WYSIWYG") document editor called Lexi. ¾     We'll see how design patterns capture solutions to design problems in Lexi. ¾     A WYSIWYG representation of the document occupies the large rectangular area in the center. ¾     The document can mix text and graphics freely in a variety of formatting styles. ¾     Surrounding the document are the usual pull-down menus and scroll bars, and a collection of page icons for jumping to a particular page in the document.    Design Problems: Seven problems in Lexis's design: Document Structure: The choice of internal representation for the document affects nearly every aspect of Lexis's design.    All editing, formatting, displaying, and textual analysis will require traversing the representation.   The way we organize those impacts design information.

Artificial Intelligence

  Chapter 1                                                                                                                                 ( Source: Google) Intelligence What is “Intelligence”? -- Everyone has his own definition but no one has a precise one at that -- Everyone agrees that humans and dogs are intelligent, trees are not What is AI? Two dimensions: 1.Thought processes and reasoning (internal) 2.Behavior (external) Two factors for measuring success along each dimension: 1.Success in terms of fidelity to human performance 2.Success in terms of an ideal performance measure, called rationality. Acting humanly: Turing Test •Turing Test -- Proposed by Alan Turing in 1950 -- Designed to provide a satisfactory operational definition of intelligence -- A computer passes the test if a human interrogator, after posing some written questions, cannot tell whether the written responses come from a person or from a computer -- No physical interaction between the interrogator and the c