Here are the key steps to solve this problem:
- There are 62 possible characters for each position in the variable name (26 lowercase letters + 26 uppercase letters + 10 digits + dollar sign + underscore)
- The first character cannot be a digit, so there are 61 possible characters
- The minimum length is 1 character, the maximum is 65,535 characters
- By the product rule, the number of possible variable names is the number of possibilities for the first character times the number of possibilities for each subsequent character, up to the maximum length
- Therefore, the total number of possible variable names is 61 * (62^65,534)
So in summary, the number of different variable names in Java is 61 * (
This document provides an overview of combinatorics concepts including the sum rule, product rule, permutations, combinations, and more. The sum rule states that if tasks are independent, the number of ways to do either task is the sum of the number of ways to do each individually. The product rule states that if tasks are independent, the number of ways to do both tasks simultaneously is the product of the number of ways to do each. Examples are provided to illustrate these rules. The document also covers permutations, combinations, the pigeonhole principle, and distributing distinguishable objects into boxes.
This document provides an introduction to combinatorics including the sum rule, product rule, permutations, and combinations. The sum rule states that if tasks are independent, the number of ways to do either task is the sum of the number of ways to do each individually. The product rule states that if tasks are independent, the number of ways to do both tasks is the product of the number of ways to do each. Permutations refer to ordered arrangements and combinations refer to unordered arrangements. The document includes examples of applying these concepts.
This document provides examples and definitions related to counting principles, including:
1) The product rule and sum rule for counting the number of ways a task can be completed.
2) The pigeonhole principle states that if more objects are placed in fewer boxes, at least one box will contain multiple objects.
3) Permutations refer to ordered arrangements of objects, and the number of r-permutations of a set of n distinct objects is calculated as P(n,r)=n!/(n-r)!.
The document discusses permutations and combinations. It provides examples of calculating permutations and combinations for different scenarios like selecting committees from a group of people and arranging books on a shelf. Formulas for permutations (nPr) and combinations (nCr) are given. Order matters for permutations but not for combinations. The key difference between the two is explained.
The document provides a table of contents and questions on various technical aptitude topics such as data structures, C, C++, quantitative aptitude, UNIX concepts, RDBMS concepts, SQL, computer networks, and operating systems. It contains 35 questions related to data structures concepts like linked lists, trees, graphs, hashing etc. and their applications.
Digital Systems Design Using Verilog 1st edition by Roth John Lee solution ma...endokayle
link full download: https://testbankstudy.com/product/digital-systems-design-using-verilog-1st-edition-by-roth-john-lee-solution-manual/
Language: English
ISBN-10: 1285051076
ISBN-13: 978-1285051079
ISBN-13: 9781285051079
This document provides an overview of combinatorics concepts including the sum rule, product rule, permutations, combinations, and more. The sum rule states that if tasks are independent, the number of ways to do either task is the sum of the number of ways to do each individually. The product rule states that if tasks are independent, the number of ways to do both tasks simultaneously is the product of the number of ways to do each. Examples are provided to illustrate these rules. The document also covers permutations, combinations, the pigeonhole principle, and distributing distinguishable objects into boxes.
This document provides an introduction to combinatorics including the sum rule, product rule, permutations, and combinations. The sum rule states that if tasks are independent, the number of ways to do either task is the sum of the number of ways to do each individually. The product rule states that if tasks are independent, the number of ways to do both tasks is the product of the number of ways to do each. Permutations refer to ordered arrangements and combinations refer to unordered arrangements. The document includes examples of applying these concepts.
This document provides examples and definitions related to counting principles, including:
1) The product rule and sum rule for counting the number of ways a task can be completed.
2) The pigeonhole principle states that if more objects are placed in fewer boxes, at least one box will contain multiple objects.
3) Permutations refer to ordered arrangements of objects, and the number of r-permutations of a set of n distinct objects is calculated as P(n,r)=n!/(n-r)!.
The document discusses permutations and combinations. It provides examples of calculating permutations and combinations for different scenarios like selecting committees from a group of people and arranging books on a shelf. Formulas for permutations (nPr) and combinations (nCr) are given. Order matters for permutations but not for combinations. The key difference between the two is explained.
The document provides a table of contents and questions on various technical aptitude topics such as data structures, C, C++, quantitative aptitude, UNIX concepts, RDBMS concepts, SQL, computer networks, and operating systems. It contains 35 questions related to data structures concepts like linked lists, trees, graphs, hashing etc. and their applications.
Digital Systems Design Using Verilog 1st edition by Roth John Lee solution ma...endokayle
link full download: https://testbankstudy.com/product/digital-systems-design-using-verilog-1st-edition-by-roth-john-lee-solution-manual/
Language: English
ISBN-10: 1285051076
ISBN-13: 978-1285051079
ISBN-13: 9781285051079
The document provides 29 sample questions on data structures and algorithms along with their answers. Some of the key questions covered include:
1. What is a data structure and examples of areas where they are applied extensively such as compiler design, operating systems, etc.
2. Major data structures used in relational databases, network and hierarchical data models.
3. Data structures used to perform recursion and evaluate arithmetic expressions.
4. Sorting algorithms like quicksort illustrated through an example.
5. Properties of different trees including the number of possible trees with a given number of nodes and number of null branches in a binary tree.
The summary hits the main topics covered in the document such as common
I am Blake H. I am an Algorithm Exam Expert at programmingexamhelp.com. I hold a PhD. in Programming, from Curtin University, Australia. I have been helping students with their exams for the past 10 years. You can hire me to take your exam in Algorithm.
Visit programmingexamhelp.com or email support@programmingexamhelp.com. You can also call on +1 678 648 4277 for any assistance with the Algorithm Exam.
This document introduces the topic of algorithms for a computer science course. It defines an algorithm as a step-by-step method for solving a problem and notes key properties like being unambiguous, terminating, and giving the correct output. The document gives examples of algorithms for finding the maximum of three numbers and computing greatest common divisors. It outlines some common algorithm design approaches and topics that will be covered in the course like graph algorithms and sorting.
Exercises for pupils in primary education(0 4)-enGeorgeta Manafu
The document discusses teaching methods and tools for presenting pseudocode language to students. It provides:
- Keywords used in pseudocode like read, write, if, then, else, while, and for to define instructions. Algorithms start with "Algorithm name" and end with "Stop".
- Examples of read-write instructions using keywords read and write to input and output data.
- Exercises for students to practice using pseudocode keywords and instructions like reading numbers, writing outputs, and comparing values in if statements.
- Discussion of theoretical concepts like assigning values, expressions, variables, and data types to introduce in pseudocode programming.
This document discusses correlation clustering algorithms that can be used when integer linear programming formulations are not scalable. It presents a greedy voting scheme algorithm and local search as alternatives to ILP. It also introduces a semidefinite programming bound that provides a tighter lower bound than previous methods. The algorithms are evaluated on two clustering tasks: the Twenty Newsgroups dataset and chat disentanglement. The results show local search performs best and is close to optimal, while the objective function does not always predict performance metrics.
discrete mathematics counting for bachelor in information technology and comp...MUSASIZIRONALD
1) The document covers basic counting principles like the sum rule, product rule, and inclusion-exclusion principle. It discusses counting the number of ways tasks can be completed.
2) The pigeonhole principle is introduced, stating that if more objects are placed in fewer boxes, at least one box will contain multiple objects.
3) Permutations and combinations are discussed to distinguish between ordered and unordered selections of items. Formulas are given for calculating the number of permutations and combinations.
This document discusses combinatorial design problems and approaches to solving them. It introduces combinatorial problems and challenges like huge search spaces. Methods covered include modeling problems as constraint satisfaction problems (CSPs) and using constraint propagation to reduce the search space. Specific problems discussed include ternary Steiner systems, Hamming distance optimization, and modeling the Data Encryption Standard (DES) cipher as a SAT problem for cryptanalysis.
This document provides an overview of combinatorics and number theory concepts including basic counting techniques, recurrence relations, binomial coefficients, prime numbers, congruences, and proofs by induction. It discusses topics such as permutations, subsets, Pascal's triangle for calculating binomial coefficients efficiently, and using recurrence relations to solve problems like calculating the Fibonacci sequence or the number of ways to reach the last stage in a multi-stage process.
This document discusses permutations, combinations, and binomial coefficients. It provides examples of calculating permutations and combinations, as well as properties like Pascal's identity. It also discusses combinations with repetition and solving combinatorics problems. The document is a lesson plan on programming for data analysis that covers permutations, combinations, and a laboratory session.
This document provides an overview of an algorithms and data structures course. It includes the instructor's name and contact information. It outlines the topics that will be covered in the course, including fundamentals of algorithms, sorting and searching, stacks, queues, linked lists, trees, hashing, and graphs. It provides recommendations for reference books and describes the marking scheme for assignments, quizzes, exams, and projects.
The document discusses greedy algorithms and matroids. It provides examples of problems that can be solved using greedy approaches, including sorting an array, the coin change problem, and activity selection. It defines key aspects of greedy algorithms like the greedy choice property and optimal substructure. Huffman coding is presented as an application that constructs optimal prefix codes. Finally, it introduces matroids as an abstract structure related to problems solvable by greedy methods.
The document provides instructions for Quiz 1 of the MIT course 6.006 Introduction to Algorithms. It states that the quiz has 120 minutes and 120 total points. It is closed book except for one crib sheet. Students are to write their solutions in the provided space and show their work for partial credit. The quiz contains 7 problems worth various point values testing topics like asymptotics, recurrences, sorting algorithms, and graph algorithms.
This document contains exercises, hints, and solutions for Chapter 1 of the book "Introduction to the Design and Analysis of Algorithms." It includes 11 exercises related to algorithms for computing greatest common divisors, square roots, binary representations, and other topics. The document also provides hints for each exercise to help students solve them and includes the solutions.
Chapter 4:Object-Oriented Basic ConceptsIt Academy
Exam Objective 1.1 Describe, compare, and contrast primitives (integer, floating point,boolean, and character), enumeration types, and objects.
Exam Objective 3.1 Develop code that uses primitives, enumeration types, and object references, and recognize literals of these types.
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...Spark Summit
Contemporary computing hardware offers massive new performance opportunities. Yet high-performance programming remains a daunting challenge.
We present some of the lessons learned while designing faster indexes, with a particular emphasis on compressed bitmap indexes. Compressed bitmap indexes accelerate queries in popular systems such as Apache Spark, Git, Elastic, Druid and Apache Kylin.
This document provides examples and step-by-step explanations of how to add, subtract, multiply and divide integers according to their signs. It begins with writing integers for word problems, then evaluates expressions. The main content explains that to add integers with the same sign, add their absolute values and the sum is positive if both are positive or negative if both are negative. To add integers with different signs, subtract the absolute values and the sum is positive if the positive value is greater or negative if the negative value is greater. Several worked examples are provided to illustrate the rules.
The document is a lecture on counting principles including permutations, combinations, and the pigeonhole principle. It begins by explaining the product rule and sum rule for counting. It then defines permutations as ordered arrangements and combinations as unordered selections. Permutations of a set are denoted by P(n,r) and combinations by C(n,r). Examples are provided to illustrate permutations, combinations, and the pigeonhole principle.
The document discusses discrete mathematics and provides examples of problems that can be solved using discrete mathematics. Some examples include determining the number of ways to choose a valid password, calculating the probability of winning a lottery, and finding the shortest path between two cities using a transportation system. Discrete mathematics involves counting discrete objects and studying relationships between finite sets. It is used whenever objects are counted or processes with a finite number of steps are analyzed. Studying discrete math helps develop mathematical maturity and provides foundations for computer science courses involving algorithms, databases, and more.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
The document provides 29 sample questions on data structures and algorithms along with their answers. Some of the key questions covered include:
1. What is a data structure and examples of areas where they are applied extensively such as compiler design, operating systems, etc.
2. Major data structures used in relational databases, network and hierarchical data models.
3. Data structures used to perform recursion and evaluate arithmetic expressions.
4. Sorting algorithms like quicksort illustrated through an example.
5. Properties of different trees including the number of possible trees with a given number of nodes and number of null branches in a binary tree.
The summary hits the main topics covered in the document such as common
I am Blake H. I am an Algorithm Exam Expert at programmingexamhelp.com. I hold a PhD. in Programming, from Curtin University, Australia. I have been helping students with their exams for the past 10 years. You can hire me to take your exam in Algorithm.
Visit programmingexamhelp.com or email support@programmingexamhelp.com. You can also call on +1 678 648 4277 for any assistance with the Algorithm Exam.
This document introduces the topic of algorithms for a computer science course. It defines an algorithm as a step-by-step method for solving a problem and notes key properties like being unambiguous, terminating, and giving the correct output. The document gives examples of algorithms for finding the maximum of three numbers and computing greatest common divisors. It outlines some common algorithm design approaches and topics that will be covered in the course like graph algorithms and sorting.
Exercises for pupils in primary education(0 4)-enGeorgeta Manafu
The document discusses teaching methods and tools for presenting pseudocode language to students. It provides:
- Keywords used in pseudocode like read, write, if, then, else, while, and for to define instructions. Algorithms start with "Algorithm name" and end with "Stop".
- Examples of read-write instructions using keywords read and write to input and output data.
- Exercises for students to practice using pseudocode keywords and instructions like reading numbers, writing outputs, and comparing values in if statements.
- Discussion of theoretical concepts like assigning values, expressions, variables, and data types to introduce in pseudocode programming.
This document discusses correlation clustering algorithms that can be used when integer linear programming formulations are not scalable. It presents a greedy voting scheme algorithm and local search as alternatives to ILP. It also introduces a semidefinite programming bound that provides a tighter lower bound than previous methods. The algorithms are evaluated on two clustering tasks: the Twenty Newsgroups dataset and chat disentanglement. The results show local search performs best and is close to optimal, while the objective function does not always predict performance metrics.
discrete mathematics counting for bachelor in information technology and comp...MUSASIZIRONALD
1) The document covers basic counting principles like the sum rule, product rule, and inclusion-exclusion principle. It discusses counting the number of ways tasks can be completed.
2) The pigeonhole principle is introduced, stating that if more objects are placed in fewer boxes, at least one box will contain multiple objects.
3) Permutations and combinations are discussed to distinguish between ordered and unordered selections of items. Formulas are given for calculating the number of permutations and combinations.
This document discusses combinatorial design problems and approaches to solving them. It introduces combinatorial problems and challenges like huge search spaces. Methods covered include modeling problems as constraint satisfaction problems (CSPs) and using constraint propagation to reduce the search space. Specific problems discussed include ternary Steiner systems, Hamming distance optimization, and modeling the Data Encryption Standard (DES) cipher as a SAT problem for cryptanalysis.
This document provides an overview of combinatorics and number theory concepts including basic counting techniques, recurrence relations, binomial coefficients, prime numbers, congruences, and proofs by induction. It discusses topics such as permutations, subsets, Pascal's triangle for calculating binomial coefficients efficiently, and using recurrence relations to solve problems like calculating the Fibonacci sequence or the number of ways to reach the last stage in a multi-stage process.
This document discusses permutations, combinations, and binomial coefficients. It provides examples of calculating permutations and combinations, as well as properties like Pascal's identity. It also discusses combinations with repetition and solving combinatorics problems. The document is a lesson plan on programming for data analysis that covers permutations, combinations, and a laboratory session.
This document provides an overview of an algorithms and data structures course. It includes the instructor's name and contact information. It outlines the topics that will be covered in the course, including fundamentals of algorithms, sorting and searching, stacks, queues, linked lists, trees, hashing, and graphs. It provides recommendations for reference books and describes the marking scheme for assignments, quizzes, exams, and projects.
The document discusses greedy algorithms and matroids. It provides examples of problems that can be solved using greedy approaches, including sorting an array, the coin change problem, and activity selection. It defines key aspects of greedy algorithms like the greedy choice property and optimal substructure. Huffman coding is presented as an application that constructs optimal prefix codes. Finally, it introduces matroids as an abstract structure related to problems solvable by greedy methods.
The document provides instructions for Quiz 1 of the MIT course 6.006 Introduction to Algorithms. It states that the quiz has 120 minutes and 120 total points. It is closed book except for one crib sheet. Students are to write their solutions in the provided space and show their work for partial credit. The quiz contains 7 problems worth various point values testing topics like asymptotics, recurrences, sorting algorithms, and graph algorithms.
This document contains exercises, hints, and solutions for Chapter 1 of the book "Introduction to the Design and Analysis of Algorithms." It includes 11 exercises related to algorithms for computing greatest common divisors, square roots, binary representations, and other topics. The document also provides hints for each exercise to help students solve them and includes the solutions.
Chapter 4:Object-Oriented Basic ConceptsIt Academy
Exam Objective 1.1 Describe, compare, and contrast primitives (integer, floating point,boolean, and character), enumeration types, and objects.
Exam Objective 3.1 Develop code that uses primitives, enumeration types, and object references, and recognize literals of these types.
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...Spark Summit
Contemporary computing hardware offers massive new performance opportunities. Yet high-performance programming remains a daunting challenge.
We present some of the lessons learned while designing faster indexes, with a particular emphasis on compressed bitmap indexes. Compressed bitmap indexes accelerate queries in popular systems such as Apache Spark, Git, Elastic, Druid and Apache Kylin.
This document provides examples and step-by-step explanations of how to add, subtract, multiply and divide integers according to their signs. It begins with writing integers for word problems, then evaluates expressions. The main content explains that to add integers with the same sign, add their absolute values and the sum is positive if both are positive or negative if both are negative. To add integers with different signs, subtract the absolute values and the sum is positive if the positive value is greater or negative if the negative value is greater. Several worked examples are provided to illustrate the rules.
The document is a lecture on counting principles including permutations, combinations, and the pigeonhole principle. It begins by explaining the product rule and sum rule for counting. It then defines permutations as ordered arrangements and combinations as unordered selections. Permutations of a set are denoted by P(n,r) and combinations by C(n,r). Examples are provided to illustrate permutations, combinations, and the pigeonhole principle.
The document discusses discrete mathematics and provides examples of problems that can be solved using discrete mathematics. Some examples include determining the number of ways to choose a valid password, calculating the probability of winning a lottery, and finding the shortest path between two cities using a transportation system. Discrete mathematics involves counting discrete objects and studying relationships between finite sets. It is used whenever objects are counted or processes with a finite number of steps are analyzed. Studying discrete math helps develop mathematical maturity and provides foundations for computer science courses involving algorithms, databases, and more.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
How to Add Chatter in the odoo 17 ERP ModuleCeline George
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
1. BITS Pilani, Hyderabad Campus
Session -6
Topic -1 : Combinatorics
Combinatorics is the study of finite or countable discrete
structures and
includes counting the structures of a given kind and size,
deciding when certain criteria can be met, and constructing
and
analyzing objects meeting the criteria, finding "largest",
"smallest", or "optimal" objects, and studying combinatorial
structures arising in an algebraic context, or applying
algebraic techniques to combinatorial problems.
2. Basic Counting Principles
• Sum Rule
• Product Rule
• THE PRODUCT RULE Suppose that a
procedure can be broken down into a
sequence of two tasks. If there are n1
ways to do the first task and for each of
these ways of doing the first task, there
are n2 ways to do the second task, then
there are n1n2 ways to do the procedure.
3. There are 32 microcomputers in a computer
center. Each microcomputer has 24 ports. How
many different ports to a microcomputer in the
center are there?
4. 4
Binomial Coefficients
• (a + b)4 = (a + b)(a + b)(a + b)(a + b)
= a4
4
0
+ a3b
4
1
+ a2b2
4
2
+ ab3
4
3
+ b4
4
4
Binomial Theorem: Let x and y be variables, and let n be any
nonnegative integer. Then
(x y)n
n
j
j 0
n
xn j
y j
5.
(x y)n
n
j
j 0
n
xn j
y j
• What is the coefficient of a8b9 in
the expansion of (3a +2b)17?
What is n? 17
What is j? 9
What is x? 3a
What is y? 2b
17
9
(3a)8
(2b)9
17
9
38
29
a8
b9
6. Binomial Coefficients
• (a + b)2 = a2 + 2ab + b2
• (a + b)3 = a3 + 3a2b + 3ab2 + b3
• (a + b)4 = a4 + 4a3b + 6a2b2 + 4ab3 + b4
What is coefficient
of a9b3 in (a + b)12?
A. 36
B. 220
C. 15
D. 6
E. No clue
Pascal’s triangle
A.: 220
7. j
j
n
n
0
j
n
y
x
j
n
y
x
)
(
Binomial Coefficients
• Sum each row of Pascal’s Triangle:
Powers of 2
n
j
j 0
n
2n Suppose you have a set of size
n. How many subsets does
it have?
2n
How many subsets of size 0
does it have? nC0
How many subsets of size 1
does it have? nC1
How many subsets of size 2
does it have? nC2
Add them up we have the result.
8. j
j
n
n
0
j
n
y
x
j
n
y
x
)
(
n
j
j 0
n
2n
Pick x=1 and y=1 !
n
j
j 0
n
1n j
1j
(1 1)n
n
j
j 0
n
2n
• Alternative (clever) proof? Look at binomial
theorem…
x and y are variables; can pick
any numbers… hmm…
9. There are 32 microcomputers in a computer
center. Each microcomputer has 24 ports. How
many different ports to a microcomputer in the
center are there?
Solution: The procedure of choosing a port
consists of two tasks, first picking a
microcomputer and then picking a port on this
microcomputer. Because there are 32 ways to
choose the microcomputer and 24 ways to
choose the port no matter which microcomputer
has been selected, the product rule shows that
there are 32 · 24 = 768 ports.
10. BITS Pilani, Hyderabad Campus
Session -6
Topic -1 : Combinatorics
The study of the number of ways to put things together into
various combinations.
E.g. If a password is 6-8 letters and/or digits, how many
passwords can there be?
Combinatorics is the study of finite or countable discrete structures
and includes counting the structures of a given kind and size,
deciding when certain criteria can be met, and constructing and
analyzing objects meeting the criteria, finding "largest", "smallest",
or "optimal" objects, and studying combinatorial structures arising
in an algebraic context, or applying algebraic techniques to
combinatorial problems.
11. BITS Pilani, Hyderabad Campus
Session -6
Topic -1 : Combinatorics
The study of the number of ways to put things together into
various combinations.
E.g. If a password is 6-8 letters and/or digits, how many
passwords can there be?
Combinatorics is the study of finite or countable discrete structures
and includes counting the structures of a given kind and size,
deciding when certain criteria can be met, and constructing and
analyzing objects meeting the criteria, finding "largest", "smallest",
or "optimal" objects, and studying combinatorial structures arising
in an algebraic context, or applying algebraic techniques to
combinatorial problems.
12. BITS Pilani, Hyderabad Campus
Sum and Product Rules
Let
m be the number of ways to do task 1 and
n the number of ways to do task 2,
with each number independent of how the other task is
done,
and also assume that no way to do task 1
simultaneously also accomplishes task 2.
Then, we have the following rules:
The sum rule: The task “do either task 1 or task 2,
but not both” can be done in m+n ways.
The product rule: The task “do both task 1 and task 2”
can be done in mn ways.
13. BITS Pilani, Hyderabad Campus
Set Theoretic Version
If
A is the set of ways to do task 1, and B the set of ways
to do task 2, and if A and B are disjoint, then:
The ways to do either task 1 or 2 are A U B, and
|AUB|=|A|+|B|
The ways to do both task 1 and 2 can be represented
as AXB, and |AXB|=|A|·|B|
14. BITS Pilani, Hyderabad Campus
IPAddress Example
The Internet Protocol, version 4 (IPv4)
– Valid computer addresses are in one of 3 types:
A class A IP address contains a 7-bit “netid” ≠ 17, and a
24-bit “hostid”
A class B address has a 14-bit netid and a 16-bit hostid.
A class C addr. Has 21-bit netid and an 8-bit hostid.
–The 3 classes have distinct headers (0, 10, 110)
–Hostids that are all 0s or all 1s are not allowed.
How many valid computer addresses are there?
e.g., xxx.edu is 128.227.74.58
15. BITS Pilani, Hyderabad Campus
IP address solution
(# addrs)
= (# class A) + (# class B) + (# class C)
(by sum rule)
# class A = (# valid netids)·(# valid hostids) (by
product rule)
(# valid class A netids) = 27 − 1 = 127.
(# valid class A hostids) = 224 − 2 =
16,777,214. Continuing in this fashion we find
the answer is: 3,737,091,842 (3.7 billion IP
addresses)
16. BITS Pilani, Hyderabad Campus
Inclusion-Exclusion Principle
• Let
• m be the number of ways to do task 1 and
• n be the number of ways to do task 2,
• Suppose that k<m of the ways of doing task 1 also
simultaneously accomplish task 2.
• – And thus are also ways of doing task 2.
• Then, the number of ways to accomplish “Do either task
1 or task 2” is m+n-k.
• Set theory: If A and B are not disjoint, then
|AUB|=|A|+|B|-|A∩B|.
• – If they are disjoint this simplifies to |A|+|B|.
17. BITS Pilani, Hyderabad Campus
Inclusion/Exclusion Example
Some hypothetical rules for passwords: Passwords must be
2 characters long. Each character must be
– a letter a-z (#=26),
– a digit 0-9 (#=10), or
– one of the punctuation characters (#=10)
!@#$%^&*().
Each password must contain at least 1 digit or punctuation
character.
18. BITS Pilani, Hyderabad Campus
Setup of Problem
A legal password has a digit or punctuation character
in position 1 or position 2.
These cases overlap, so the principle applies. (# of
passwords w. OK symbol in
position #1) = (10+10)·(10+10+26)
(# w. OK sym. in pos. #2): also 20·46 (# w. OK sym
both places): 20·20 Answer: 920+920−400 = 1,440
19. How many strings of eight English letters are there
a) that contain no vowels, if letters can be repeated?
b) that contain no vowels, if letters cannot be repeated?
c) that start with a vowel, if letters can be repeated?
d) that start with a vowel, if letters cannot be repeated?
e) that contain at least one vowel, if letters can be
repeated?
f ) that contain exactly one vowel, if letters can be
repeated?
g) that start with X and contain at least one vowel, if letters
can be repeated?
h) that start and end with X and contain at least one vowel,
if letters can be repeated?
20.
21. The name of a variable in the JAVA programming language is a string of
between 1 and 65,535 characters, inclusive, where each character can be an
uppercase or a lowercase letter, a dollar sign, an underscore, or a digit,
except that the first character must not be a digit. Determine the number of
different variable names in JAVA.
22. The name of a variable in the JAVA programming language is a string of
between 1 and 65,535 characters, inclusive, where each character can be an
uppercase or a lowercase letter, a dollar sign, an underscore, or a digit,
except that the first character must not be a digit. Determine the number of
different variable names in JAVA.