• edited by
17,930 views
51 51 votes

A multiset is an unordered collection of elements where elements may repeat any number of times. The size of a multiset is the number of elements in it, counting repetitions.

  1. What is the number of multisets of size $4$ that can be constructed from n distinct elements so that at least one element occurs exactly twice?
  2. How many multisets can be constructed from n distinct elements? 

8 Answers

Best answer
50 50 votes

A. There are four places to be filled in the multiset using the $n$ distinct elements. At least one element has to occur exactly twice. That would leave $2$ more places in the multiset. This means, at most two elements can occur exactly twice. We can thus divide this into $2$ mutually exclusive cases as follows:

  1. Exactly one element occurs exactly twice:
  2. Select this element in $n$ ways.

Fill up the remaining two spots using $2$ distinct elements from the remaining $n−1$ elements in ${}^{(n-1)}C_2$ ways.

Exactly two elements that occur twice each: These two will fill up the multiset.

So, we only have to select two elements out of $n$ in ${}^nC_2$ ways. 
Since, these are mutually exclusive, the total number of ways to form the multiset is: ${}^nC_2 + n. {}^{(n-1)}C_2.$  

B. There are infinite number of sets as $n$ is unbounded. ($\because$ size of multiset is not given)

ref: http://cs.stackexchange.com/questions/7578/multisets-of-a-given-set

• edited by
23 23 votes

a)There are n distinct elements

Now, we have to find at least one element occurs exactly twice

For example, multiset could be {1,1,2,2} or {1,1,2,3}

As it is construction of a set arrangement not required.

For 1st one where both elements repeats , multiset could be $ \binom{n}{2}$

For 2nd one where only one element repeates, multiset could be $ \binom{n}{3}.\binom{3}{1}$

So, we will just permute when total number of multiset where " at least one element occurs exactly twice "$=^{n}\textrm{C}_{2}+3.^{n}\textrm{C}_{3}$

b)It will be infinite

• edited by
3 3 votes

The question says: “ ...at least one element occurs exactly twice.”

Case 1: one element repeat twice and the other two elements are distinct, as in {1,1,2,3}

Here we choose one element from n elements for repetition

and rest two distinct elements from the remaining (n-1) elements

Hence the number of ways: $\binom{n}{1}.\binom{n-1}{2}$

Case 2: two elements repeat twice, as in {1,1,2,2}

Here we choose two distinct elements from n elements for repetition

Hence the number of ways : $\binom{n}{2}$

By the fundamental principle of counting, the required answer is $\binom{n}{1}.\binom{n-1}{2} +\binom{n}{2}$

 

2 2 votes
4 places to be filled..

1 element exactly twice is must..

so choose 1 element from n => nC1=n ways

rest remaining 2 places , n-1 elements

so (n-1)^2 permutations, but a,b and b,a are same..

so n * 1/2 * (n-1)^2

= n(n-1)(n-1)/2
1 1 vote

Yes for B the answer will be infinite but if there is a restriction that: the size of multiset can't exceed 'n' then we can generalize it in terms of n.

Here first I have selected i elements to be present in the multiset, then if i<k then these must be some element repeated here so this is equivalent to making partitions or distributing K identical balls into 'i' distinct boxes so that every box has atleast one ball. Hence k-1Ci-1, then the limits are simple i goes from 1 to k and k goes from 1 to n. 
Assumptions:- The size of multiset can't exceed n.

Position:
Show:

Related questions

51 51 votes
6 answers 6 answers
13.8k
13.8k views
Misbah Ghaya asked Nov 29, 2016
13,847 views
How many substrings (of all lengths inclusive) can be formed from a character string of length $n$? Assume all characters to be distinct, prove your answer.
43 43 votes
6 answers 6 answers
17.4k
17.4k views
Kathleen asked Sep 23, 2014
17,366 views
The number of binary strings of $n$ zeros and $k$ ones in which no two ones are adjacent is$^{n-1}C_k$$^nC_k$$^nC_{k+1}$None of the above
14 14 votes
2 2 answers
4.4k
4.4k views
Kathleen asked Sep 14, 2014
4,440 views
Consider a bank database with only one relation transaction (transno, acctno, date, amount)The amount attribute value is positive for deposits and negative for withdrawa...
20 20 votes
2 2 answers
7.3k
7.3k views
Kathleen asked Sep 14, 2014
7,349 views
(a) Suppose you are given an empty $B^+$ tree where each node (leaf and internal) can store up to $5$ key values. Suppose values $1, 2,\ldots 10$ are inserted, in order, ...