Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Number System and Arithmetic
  • Algebra
  • Set Theory
  • Probability
  • Statistics
  • Geometry
  • Calculus
  • Logarithms
  • Mensuration
  • Matrices
  • Trigonometry
  • Mathematics
Open In App
Next Article:
Mathematics | Graph theory practice questions
Next article icon

Problem on permutations and combinations | Set 2

Last Updated : 25 May, 2018
Comments
Improve
Suggest changes
Like Article
Like
Report
Prerequisite : Permutation and Combination Given a polygon of m sides, count number of triangles that can be formed using vertices of polygon.
Answer : [m (m - 1)(m - 2) / 6] Explanation : There are m vertices in a polygon with m sides. We need to count different combinations of three points chosen from m. So answer is mC3 = m * (m - 1) * (m - 2) / 6 Examples : Input: m = 3 Output: 1 We put value of m = 3, we get required no. of triangles = 3 * 2 * 1 / 6 = 1 Input : m = 6 output : 20
Given a polygon of m sides, count number of diagonals that can be formed using vertices of polygon.
Answer : [m (m - 3)] / 2. Explanation : We need to choose two vertices from polygon. We can choose first vertex m ways. We can choose second vertex in m-3 ways (Note that we can not choose adjacent two vertices to form a diagonal). So total number is m * (m - 3). This is twice the total number of combinations as we consider an diagonal edge u-v twice (u-v and v-u) Examples: Input m = 4 output: 2 We put the value of m = 4, we get the number of required diagonals = 4 * (4 - 3) / 2 = 2 Input: m = 5 Output: 5
Count the total number rectangles that can be formed using m vertical lines and n horizontal lines
Answer : (mC2*nC2). We need to choose two vertical lines and two horizontal lines. Since the vertical and horizontal lines are chosen independently, we multiply the result. Examples: Input: m = 2, n = 2 Output: 1 We have the total no of rectangles = 2C2*2C2 = 1 * 1 = 1 Input: m = 4, n = 4 Output: 36
There are ‘n’ points in a plane, out of which ‘m’ points are co-linear. Find the number of triangles formed by the points as vertices ?
Number of triangles = nC3 - mC3 Explanation : Consider the example n = 10, m = 4. There are 10 points, out of which 4 collinear. A triangle will be formed by any three of these ten points. Thus forming a triangle amounts to selecting any three of the 10 points. Three points can be selected out of the 10 points in nC3 ways. Number of triangles formed by 10 points when no 3 of them are co-linear = 10C3......(i) Similarly, the number of triangles formed by 4 points when no 3 of them are co-linear = 4C3........(ii) Since triangle formed by these 4 points are not valid, required number of triangles formed = 10C3 - 4C3 = 120 - 4 = 116
There are 'n' points in a plane out of which 'm' points are collinear, count the number of distinct straight lines formed by joining two points.
Answer : nC2 - mC2 + 1 Explanation : Number of straight lines formed by n points when none of them are col-linear = nC2 Similarly, the number of straight lines formed by m points when none of them collinear = mC2 m points are collinear and reduce in one line. Therefore we subtract mC2 and add 1. Hence answer = nC2 - mC2 +1 Examples: Input : n = 4, m = 3 output : 1 We apply this formula Answer = 4C2 - 3C2 +1 = 3 - 3 + 1 = 1
More practice questions on permutation and combination : Quiz on Permutation and Combination Combination and Permutation Practice Questions

Next Article
Mathematics | Graph theory practice questions

V

vt_m
Improve
Article Tags :
  • Combinatorial
  • Engineering Mathematics
  • GATE CS
  • Mathematics
  • DSA
  • Permutation and Combination
Practice Tags :
  • Combinatorial

Similar Reads

    Engineering Mathematics Tutorials
    Engineering mathematics is a vital component of the engineering discipline, offering the analytical tools and techniques necessary for solving complex problems across various fields. Whether you're designing a bridge, optimizing a manufacturing process, or developing algorithms for computer systems,
    3 min read

    Matrix and Determinants

    Matrices
    Matrices are key concepts in mathematics, widely used in solving equations and problems in fields like physics and computer science. A matrix is simply a grid of numbers, and a determinant is a value calculated from a square matrix.Example: \begin{bmatrix} 6 & 9 \\ 5 & -4 \\ \end{bmatrix}_{2
    3 min read
    Different Operations on Matrices
    For an introduction to matrices, you can refer to the following article: Matrix Introduction In this article, we will discuss the following operations on matrices and their properties: Matrices AdditionMatrices SubtractionMatrices MultiplicationMatrices Addition: The addition of two matrices A m*n a
    11 min read
    Representation of Relation in Graphs and Matrices
    Understanding how to represent relations in graphs and matrices is fundamental in engineering mathematics. These representations are not only crucial for theoretical understanding but also have significant practical applications in various fields of engineering, computer science, and data analysis.
    8 min read
    Determinant of Matrix with Solved Examples
    The determinant of a matrix is a scalar value that can be calculated for a square matrix (a matrix with the same number of rows and columns). It serves as a scaling factor that is used for the transformation of a matrix.It is a single numerical value that plays a key role in various matrix operation
    15+ min read
    Properties of Determinants
    Properties of Determinants are the properties that are required to solve various problems in Matrices. There are various properties of the determinant that are based on the elements, rows, and columns of the determinant. These properties help us to easily find the value of the determinant. Suppose w
    10 min read
    Row Echelon Form
    Row Echelon Form (REF) of a matrix simplifies solving systems of linear equations, understanding linear transformations, and working with matrix equations. A matrix is in Row Echelon form if it has the following properties:Zero Rows at the Bottom: If there are any rows that are completely filled wit
    4 min read
    Eigenvalues and Eigenvectors
    Eigenvectors are the directions that remain unchanged during a transformation, even if they get longer or shorter. Eigenvalues are the numbers that indicate how much something stretches or shrinks during that transformation. These ideas are important in many areas of math and engineering, including
    15+ min read
    System of Linear Equations
    In mathematics, a system of linear equations consists of two or more linear equations that share the same variables. These systems often arise in real-world applications, such as engineering, physics, economics, and more, where relationships between variables need to be analyzed. Understanding how t
    8 min read
    Matrix Diagonalization
    Matrix diagonalization is the process of reducing a square matrix into its diagonal form using a similarity transformation. This process is useful because diagonal matrices are easier to work with, especially when raising them to integer powers.Not all matrices are diagonalizable. A matrix is diagon
    8 min read
    LU Decomposition
    LU decomposition or factorization of a matrix is the factorization of a given square matrix into two triangular matrices, one upper triangular matrix and one lower triangular matrix, such that the product of these two matrices gives the original matrix. It was introduced by Alan Turing in 1948, who
    7 min read
    Finding Inverse of a Square Matrix using Cayley Hamilton Theorem in MATLAB
    Matrix is the set of numbers arranged in rows & columns in order to form a Rectangular array. Here, those numbers are called the entries or elements of that matrix. A Rectangular array of (m*n) numbers in the form of 'm' horizontal lines (rows) & 'n' vertical lines (called columns), is calle
    4 min read

    Sequence and Series

    Binomial Theorem
    Binomial theorem is a fundamental principle in algebra that describes the algebraic expansion of powers of a binomial. According to this theorem, the expression (a + b)n where a and b are any numbers and n is a non-negative integer. It can be expanded into the sum of terms involving powers of a and
    15+ min read
    Sequences and Series
    A sequence is an ordered list of numbers following a specific rule. Each number in a sequence is called a "term." The order in which terms are arranged is crucial, as each term has a specific position, often denoted as an​, where n indicates the position in the sequence.For example:2, 5, 8, 11, 14,
    10 min read
    Finding nth term of any Polynomial Sequence
    Given a few terms of a sequence, we are often asked to find the expression for the nth term of this sequence. While there is a multitude of ways to do this, In this article, we discuss an algorithmic approach which will give the correct answer for any polynomial expression. Note that this method fai
    4 min read
    Mathematics | Sequence, Series and Summations
    Sequences, series, and summations are fundamental concepts of mathematical analysis and it has practical applications in science, engineering, and finance.Table of ContentWhat is Sequence?Theorems on SequencesProperties of SequencesWhat is Series?Properties of SeriesTheorems on SeriesSummation Defin
    8 min read

    Calculus

    Limits in Calculus
    In mathematics, a limit is a fundamental concept that describes the behaviour of a function or sequence as its input approaches a particular value. Limits are used in calculus to define derivatives, continuity, and integrals, and they are defined as the approaching value of the function with the inp
    12 min read
    Indeterminate Forms
    Assume a function F(x)=\frac{f(x)}{g(x)} which is undefined at x=a but it may approach a limit as x approaches a. The process of determining such a limit is known as evaluation of indeterminate forms. The L' Hospital Rule helps in the evaluation of indeterminate forms. According to this rule- \lim_{
    3 min read
    Limits, Continuity and Differentiability
    Limits, Continuity, and Differentiation are fundamental concepts in calculus. They are essential for analyzing and understanding function behavior and are crucial for solving real-world problems in physics, engineering, and economics.Table of ContentLimitsKey Characteristics of LimitsExample of Limi
    10 min read
    Cauchy's Mean Value Theorem
    Cauchy's Mean Value theorem provides a relation between the change of two functions over a fixed interval with their derivative. It is a special case of Lagrange Mean Value Theorem. Cauchy's Mean Value theorem is also called the Extended Mean Value Theorem or the Second Mean Value Theorem.According
    7 min read
    Lagrange's Mean Value Theorem
    Lagrange's Mean Value Theorem (LMVT) is a fundamental result in differential calculus, providing a formalized way to understand the behavior of differentiable functions. This theorem generalizes Rolle's Theorem and has significant applications in various fields of engineering, physics, and applied m
    9 min read
    Rolle's Mean Value Theorem
    Rolle's theorem one of the core theorem of calculus states that, for a differentiable function that attains equal values at two distinct points then it must have at least one fixed point somewhere between them where the first derivative of the function is zero.Rolle's Theorem and the Mean Value Theo
    8 min read
    Taylor Series
    A Taylor series represents a function as an infinite sum of terms, calculated from the values of its derivatives at a single point.Taylor series is a powerful mathematical tool used to approximate complex functions with an infinite sum of terms derived from the function's derivatives at a single poi
    8 min read
    Maclaurin series
    Prerequisite - Taylor theorem and Taylor series We know that formula for expansion of Taylor series is written as: f(x)=f(a)+\sum_{n=1}^{\infty}\frac{f^n(a)}{n!}(x-a)^n Now if we put a=0 in this formula we will get the formula for expansion of Maclaurin series. T hus Maclaurin series expansion can b
    2 min read
    Euler's Formula
    Euler's formula holds a prominent place in the field of mathematics. It aids in establishing the essential link between trigonometric functions and complex exponential functions. It is a crucial formula used for solving complicated exponential functions. It is also known as Euler's identity. It has
    5 min read
    Chain Rule: Theorem, Formula and Solved Examples
    The Chain Rule is a way to find the derivative of composite functions. It is one of the basic rules used in mathematics for solving differential equations. It helps us to find the derivative of composite functions such as (3x2 + 1)4, (sin 4x), e3x, (ln x)2, and others. Only the derivatives of compos
    8 min read
    Inverse functions and composition of functions
    Inverse Functions - In mathematics a function, a, is said to be an inverse of another, b, if given the output of b a returns the input value given to b. Additionally, this must hold true for every element in the domain co-domain(range) of b. In other words, assuming x and y are constants, if b(x) =
    3 min read
    Definite Integral | Definition, Formula & How to Calculate
    A definite integral is an integral that calculates a fixed value for the area under a curve between two specified limits. The resulting value represents the sum of all infinitesimal quantities within these boundaries. i.e. if we integrate any function within a fixed interval it is called a Definite
    8 min read
    Mathematics | Indefinite Integrals
    Antiderivative - Definition :A function ∅(x) is called the antiderivative (or an integral) of a function f(x) of ∅(x)' = f(x). Example : x4/4 is an antiderivative of x3 because (x4/4)' = x3. In general, if ∅(x) is antiderivative of a function f(x) and C is a constant.Then, {∅
    4 min read
    Application of Derivative - Maxima and Minima
    Derivatives have many applications, like finding rate of change, approximation, maxima/minima and tangent. In this section, we focus on their use in finding maxima and minima.Note: If f(x) is a continuous function, then for every continuous function on a closed interval has a maximum and a minimum v
    6 min read
    Summation Formulas
    In mathematics, the summation is the basic addition of a sequence of numbers, called addends or summands; the result is their sum or total. The summation of an explicit sequence is denoted as a succession of additions. For example, the summation of (1, 3, 4, 7) can be written as 1 + 3 + 4 + 7, and t
    6 min read

    Statistics and Numerical Methods

    Mean, Variance and Standard Deviation
    Mean, Variance and Standard Deviation are fundamental concepts in statistics and engineering mathematics, essential for analyzing and interpreting data. These measures provide insights into data's central tendency, dispersion, and spread, which are crucial for making informed decisions in various en
    10 min read
    Mathematics - Law of Total Probability
    Probability theory is the branch of mathematics concerned with the analysis of random events. It provides a framework for quantifying uncertainty, predicting outcomes, and understanding random phenomena. In probability theory, an event is any outcome or set of outcomes from a random experiment, and
    12 min read
    Probability Distribution - Function, Formula, Table
    A probability distribution is a mathematical function or rule that describes how the probabilities of different outcomes are assigned to the possible values of a random variable. It provides a way of modeling the likelihood of each outcome in a random experiment.While a frequency distribution shows
    15+ min read
    Bayes' Theorem
    Bayes' Theorem is a mathematical formula that helps determine the conditional probability of an event based on prior knowledge and new evidence.It adjusts probabilities when new information comes in and helps make better decisions in uncertain situations.Bayes' Theorem helps us update probabilities
    12 min read
    Conditional Probability
    Conditional probability defines the probability of an event occurring based on a given condition or prior knowledge of another event. Conditional probability is the likelihood of an event occurring, given that another event has already occurred. In probability, this is denoted as A given B, expresse
    12 min read

    Probability Distribution

    Uniform Distribution in Data Science
    Uniform Distribution also known as the Rectangular Distribution is a type of Continuous Probability Distribution where all outcomes in a given interval are equally likely. Unlike Normal Distribution which have varying probabilities across their range, Uniform Distribution has a constant probability
    5 min read
    Exponential Distribution
    The Exponential Distribution is one of the most commonly used probability distributions in statistics and data science. It is widely used to model the time or space between events in a Poisson process. In simple terms, it describes how long you have to wait before something happens, like a bus arriv
    3 min read
    Normal Distribution in Data Science
    Normal Distribution also known as the Gaussian Distribution or Bell-shaped Distribution is one of the widely used probability distributions in statistics. It plays an important role in probability theory and statistics basically in the Central Limit Theorem (CLT). It is characterized by its bell-sha
    6 min read
    Binomial Distribution in Data Science
    Binomial Distribution is used to calculate the probability of a specific number of successes in a fixed number of independent trials where each trial results in one of two outcomes: success or failure. It is used in various fields such as quality control, election predictions and medical tests to ma
    7 min read
    Poisson Distribution in Data Science
    Poisson Distribution is a discrete probability distribution that models the number of events occurring in a fixed interval of time or space given a constant average rate of occurrence. Unlike the Binomial Distribution which is used when the number of trials is fixed, the Poisson Distribution is used
    7 min read
    Covariance and Correlation
    Covariance and correlation are the two key concepts in Statistics that help us analyze the relationship between two variables. Covariance measures how two variables change together, indicating whether they move in the same or opposite directions. Relationship between Independent and dependent variab
    5 min read

    Engineering Math Practice Problems

    Mathematics | Problems On Permutations | Set 1
    Permutations are a fundamental concept in combinatorics, dealing with the arrangement of objects in a specific order. In mathematical terms, a permutation is an arrangement of a set of elements in a particular sequence or order. Understanding permutations is crucial not only in mathematics but also
    6 min read
    Problem on permutations and combinations | Set 2
    Prerequisite : Permutation and Combination Given a polygon of m sides, count number of triangles that can be formed using vertices of polygon. Answer : [m (m - 1)(m - 2) / 6] Explanation : There are m vertices in a polygon with m sides. We need to count different combinations of three points chosen
    4 min read
    Mathematics | Graph theory practice questions
    Problem 1 - There are 25 telephones in Geeksland. Is it possible to connect them with wires so that each telephone is connected with exactly 7 others. Solution - Let us suppose that such an arrangement is possible. This can be viewed as a graph in which telephones are represented using vertices and
    4 min read
    Last Minute Notes - Engineering Mathematics
    GATE CSE is a national-level engineering entrance exam in India specifically for Computer Science and Engineering. It's conducted by top Indian institutions like IISc Bangalore and various IITs. In GATE CSE, engineering mathematics is a significant portion of the exam, typically constituting 15% of
    15+ min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences