Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Applications of Sum rule, Product rule,

Permutations, and Combinations in AI and Data


Science
Hima Bindu Dubba, Jugunta Prakash, , Siri M ,Dinesh Somisetty
Computer Science and Engineering (Artificial Intelligence)

Amrita School Of Engineering, Bengaluru, India

bl.en.u4aie23006@bl.students.amrita.edu
bl.en.u4aie230011@bl.students.amrita.edu

bl.en.u4aie23029@bl.students.amrita.edu

bl.en.u4aie23030@bl.students.amrita.edu

I.INTRODUCTION

Combinatorics,or combinatorial theory,is a solving application problems. The


major mathematics branch that has generation of combinatorial sequences has
extensive applications in many fields.They been studied extensively because of its
include engineering,computer fundamental nature and importance in
science,natural and social sciences,bio practical applications,However,most
medicine,operations research,and combinatorics algorithms and programs
business.Particular areas that have extensive have employed classical,non-intelligent
applications of combinatorics such as approaches.For advanced combinatorics
permutations and combinations include problems,intelligent computing becomes
communication networks, cryptography and necessary,and this is the major focus of this
network security; computer paper.Logic programming has been playing
architecture;electrical engineering; an important role in intelligent
computational molecular biology;languages computing.With much simplification,an
both natural and computer;pattern abstraction of the human intelligence
analysis;scientific discovery; databases and process is logic,and its computer realization
data mining; scheduling problems in is logic programming.
operations research; and simulation.Other
areas of applications include complexity Logic programming has been applied widely
analysis,recursion,games,statistical to every domain of intelligent
mechanics. computing,including knowledge: based
systems,machine learning,data
The most common scenario is that many mining,scientific discovery,natural language
real world problems are mathematically processing,compiler writing,symbolic
intractable.In these cases,combinatorics algebra,circuit analysis,relational
techniques are needed to count, databases,image processing,and molecular
enumerate,or represent possible solutions in biology.It is one of the best tools to work on
any form of intelligent computing,and this is
why we integrate logic programming with
combinatorics problems .In the following,we Applications of Sum Rule in Artificial
discuss how the basic generating problems Intelligence and Data Science
in combinatorics can be implemented in
logic programming, especially in Prolog. Sum rule has many applications in artificial
Real-world hard combinatorics problems are intelligence and data science,one of the
discussed to illustrate the usefulness of the most important application is Natural
logic programming approach. Language Processing(NLP)
Natural language Processing(NLP) is a
II.SUM RULE subfield of artificial intelligence(AI) that
focuses on the interaction between
The rule of sum is a basic counting computers and human languages.The goal
approach in combinatorics.A basic of NLP is to enable the machines to
statement of the rule is that if there are n understand, interpret, and generate human
choices for one action and m choices for language in a way that is both meaningful
another action ,and the two actions cannot and contextually relevant.NLP involves a
be done simultaneously,then there are n+m wide range of tasks and applications,and it
ways to choose one. plays a crucial role in various fields such as
If E1 and E2 are two events and if we want machine translation,speech
to perform event 1 or event 2,we use sum recognition,sentiment analysis,text
rule. summarization,and more.
Example: Suppose we have to write an
article and we have two lists of topics.First
list contains 10 topics and second list
contain 20 topics,total number of choices to
select a topic is 10+20=30 topics

 Named Entity Recognition:NER is the


task of identifying and classifying
entities within a text. It is crucial for
applications like information
extraction and knowledge graph
construction.The sum rule can be
applied when combining predictions
from multiple NER models trained
on different types of data or using  Speech Recognition:Speech
different feature representations. Recognition systems use NLP
techniques to convert spoken
language into written text.This
technology is employed in voice
assistants(e.g.,Siri,Alexa)and
transcription services.In speech
recognition systems,the sum rule can
be applied when considering
different combinations of acoustic
features or models to improve
overall accuracy.For ensembling
multiple acoustic models or
language models can lead to better
transcription results.

 Machine Translation: NLP is


fundamental to machine
translation,where systems
automatically translate text or
speech from one language to
another.Examples include Google
Translate and neural machine
translation models.In machine
translation tasks,where the goal is to
translate text from one language to
another,the sum rule can be applied
when combining translations from
multiple models or ensembling
models trained on different parallel
corpora.The combination can be
done using techniques such as  Question Answering: Question
voting or averaging. Answering systems use NLP to
understand natural language
questions and provide relevant
answers. This is employed in virtual
assistants, search engines, and chat
bots. Question-answering systems
often use multiple models or
components for different aspects,
such as passage retrieval and answer
extraction. The sum rule can be
applied when combining scores or
Product rule has many applications in
Artificial Intelligence and data science.One
of the most important application is feature
engineering.
In machine learning feature engineering
involves creating new features from existing
ones to improve model performance.The
product rule of permutations and
predictions from these components combinations plays a crucial role in feature
to produce a final answer. engineering by helping to quantify the total
number of possible feature combinations
and interactions.
II.PRODUCT RULE
A procedure can be broken down into a
sequence of two tasks.There are n1 ways to
do the first task and n2 ways to do the
second task.Then there are n1*n2 ways to
do the procedure.
If E1 and E2 are two events,and if we want
to perform event 1 and event 2,we use
product rule.

1. Pairwise Feature Interactions:


Consider a data set with several features.
The product rule helps you to calculate the
total number of pairwise interactions
between features. For example, if you have 4
features, the product rule tells you that
there are 4.3=12 ways to pair up them. Each
pair can be used to create a new feature
representing the interaction between the
original features.

2.Higher Order Interactions:


Beyond pairwise interactions , you may be
interested in creating new features based on
higher order interactions.The product rule
Applications of Product rule in Artificial
extends to higher order as well.For
Intelligence and Data Science:
instance , if you want to consider triple
interactions among five features ,the
product rule helps you to calculate 5.4.3=60 We can arrange n distinct objects in n! ways
possible combinations.

3. Categorical feature combinations:


When dealing with categorical features, the
product rule helps calculate the total
number of combinations when creating new
features based on combinations of
categories.For example,if you have two
categorical features ,one with 5 levels and
one with 6 levels ,the product rule tell you
that there are 5.6=30 possible
combinations.
Example: From a committee of 8 persons,in
how many ways can we choose a chairman
4.Creating polynomial features:
and a vice chairman assuming one person
Polynomial features involve creating new
cannot hold more than one position?
features by raising existing features into
Solution:
different powers.The product rule helps
n=8
calculate total number of polynomial
r=2
features for each original feature.For
nPr=n!/(n-r)!=8!/(8-2)!=8!/6!=8*7=56 ways
instance ,if you want to create a polynomial
feature of degree 2 for 4 features ,the
Permutation formula when repetition is
product rule gives 4.2=8 combinations.
allowed
The number of possible permutations of r
III.PERMUTATIONS
objects from a collection of n distinct
A permutation is an ordered arrangement of
objects when repetition is allowed is given
all sum of n objects.
by the formula n*n*n*…….n =n^r
Permutation formula:
The number of possible permutations of ‘r’
Permutation when objects are not distinct
objects from a collection of ‘n’ distinct
The number of permutations of n objects
objects is given by the formula:
when p of them are one of a kind =n!/p!
n*(n-1)*……..*(n-r+1)and is denoted by
nPr Circular Permutations
nPr=n!/(n-r)!
Special Cases:
1.nP0=n!/(n-0)!=1
There is only one ordered arrangement of 0
objects
2.nP1=n!/(n-1)!=n
There are n ways of choosing one object
from n objects.
3.nPn=n!/(n-n)!=n!
1.The number of ways n distinct objects can Applications of Permutations and
be arranged in a circle(clockwise and Combinations in AI and Data Science
anticlockwise are different)=(n-1)!
2.The number of ways n distinct objects can Permutations and combinations have
be arranged in a circle(clockwise and various applications in the field of artificial
anticlockwise are same)=(n-1)!/2 intelligence(AI).One of the specific
application is solving combinatorial
IV.COMBINATIONS optimization problems.
A combination is a way of selecting items
unlike permutations,here order is not
important. Combinatorial Optimization Problems:
The number possible combinations of r Many problems in AI involve finding optimal
objects from a collection of n distinct solutions among a set of
objects is denoted by nCr and is given by possibilities.Combinatorial optimization
nCr=n!/(n-r)!*r! problems,such as travelling salesman
Special Cases: problem can be solved using permutation
1.nCn=1 and combinations.
2.nC0=1
3.nCr=(n-1)C(r-1)+(n-1)Cr

Travelling Salesman Problem involves


Finding the shortest possible tool that visits
Example:Choosing questions in an
a set of cities and returns to the starting city.
examination .
Permutations and Combinations play a
In an examination,a question paper consists
significant role in understanding and solving
of 12 questions divided into 2 parts
the travelling salesman problem,here are
containing 7 and 5 questions respectively.
some specific applications of permutations
A student is required to attempt 8 questions
and combinations in the travelling salesman
in all,selecting atleast 3 from each part.In
problem:
how many ways a student can select the
 Representation of tours:
questions?
The travelling salesman problem
7C3*5C5+7C4*5C4+7C5*5C3
involves considering different orders
=35+175+210
in which cities can be visited.
=420
Permutations are used to represent
possible tours,where each table to store optimal solutions for
permutation corresponds to a sub problems.The number of sub
specific order in which the cities are problems is typically represented by
visited.The number of possible combinations of cities.For example a
permutations for n cities is n! table entry might represent the
optimal truth that visits a subset of
cities.
 Branch and Bound
Branch and bound algorithms for the
Travelling sales man problem involve
breaking a problem into sub
problems and systematically
exploring the solution
space.Permutations are used to
represent partial tours and
combinations are used to determine
which cities are already included in a
partial tour.
 Approximation algorithm
 Calculating Distances: Some approximation algorithms for
The travelling salesman problem the Travelling sales man problem
requires calculating the distances use combinations of cities to create
between the pairs of sub tours and iteratively merge them
cities.Combinations are used to to construct a final tour.These
select pairs of cities for distance algorithms aim to find near optimal
calculation.The number of possible solutions without exploring the
combinations for n cities taken 2 at a entire solution space
time is nC2=n!/(n-2)!*2!
 Brute force Approach: Cross Validation:
The most straight forward way to One more important application of
solve travelling salesman problem is permutation and combination is cross
through a brute force approach that validation.
involves considering all possible Cross validation is a crucial technique in
permutations of city visits and machine learning for assessing a model’s
calculating the total distance for performance and generalization to unseen
each permutation.This approach data.Cross validation involves splitting the
requires exploring all n! dataset into multiple subsets for training
permutations making it and validation and permutations and
computationally expensive for large combinations are utilized in various aspects
instances. of this process.Here are some applications
 Dynamic programming: of permutations and combinations in cross
Dynamic programming approaches validation.
for solving the travelling sales  K-fold cross validation:
problem often involve creating a
In K-fold Cross validation,the dataset
is divided into K equally sided
folds,combinations of these folds are
used for training and validation in K
different iterations.The permutations
of folds determine the specific
training and validation sets for each
iteration.
 Leave –One-Out-Cross
validation(LOOCV):
LOOCV is a special case of K-fold
Cross validation where K is set equal
to the number of samples in the
dataset.Each iteration involves
leaving out one data point as the
validation set,and permutations of
data points determine the order in
which each point is left out.
 Repeated Cross Validation:
Repeated Cross Validation involves
performing K-fold Cross validation
multiple times with different random
splits.Permutations are used to
determine the randomization of data
points in each repetition,providing a
more robust estimate of model
performance.
 Shuffle-Split-Cross Validation:
It involves randomly shuffling the
data and splitting it into training and
validation sets for each
iteration.Permutations of the data
points influence the randomization
process,ensuring diverse splits in
each iteration.
 Time-series Cross Validation
In time series Cross Validation,where
the order of data points
matters,permutations are used to
create different combinations of
training and validations.

You might also like