A counting question with A identical items of one kind and B identical items of another: choose C of them and arrange them in a row. It asks how many distinct rows are possible, testing how the two supply limits bound each kind and how identical items affect the number of orderings.
Counting Rows Formed From Two Kinds of Identical Items
Company: Sig
Role: Quantitative Trader
Category: Statistics & Math
Difficulty: medium
Interview Round: Online Assessment
You have $A$ identical items of one kind and $B$ identical items of a second kind. You choose $C$ of these items and arrange them in a row. How many different rows can you form? Items of the same kind cannot be told apart, so two rows are the same exactly when they show the same kind at every position.
The specific values of $A$, $B$ and $C$ are generated randomly, and the answer is an exact integer.
```hint Separate the two questions
Treat which mixes of the two kinds the supplies allow separately from how many orders each allowed mix produces.
```
### Constraints and Clarifications
- $A$, $B$ and $C$ are nonnegative integers.
- The order of the row matters.
### Clarifying Questions
- Does order matter, or are we counting only which items are chosen?
- Must every row contain at least one item of each kind?
- If $C$ exceeds $A + B$, should the answer be zero?
### What a Strong Answer Covers
- The feasible range for the number of first-kind items, using both supply limits
- Counting the orderings for each feasible mix without double counting identical items
- The simplifications when $C$ is at most both supplies and when it exceeds their total
- A small hand-enumerated check
### Follow-up Questions
- How does the count change with three kinds of items?
- How many rows have no two adjacent items of the same kind?
- If $A$, $B$ and $C$ are very large, how would you compute the answer modulo a prime efficiently?
Overview: A counting question with A identical items of one kind and B identical items of another: choose C of them and arrange them in a row. It asks how many distinct rows are possible, testing how the two supply limits bound each kind and how identical items affect the number of orderings.
Counting Rows Formed From Two Kinds of Identical Items
Sig
Sep 19, 2026
mediumQuantitative TraderOnline AssessmentStatistics & Math
0
0
You have A identical items of one kind and B identical items of a second kind. You choose C of these items and arrange them in a row. How many different rows can you form? Items of the same kind cannot be told apart, so two rows are the same exactly when they show the same kind at every position.
The specific values of A, B and C are generated randomly, and the answer is an exact integer.
Constraints and Clarifications
A
,
B
and
C
are nonnegative integers.
The order of the row matters.
Clarifying Questions Guidance
Does order matter, or are we counting only which items are chosen?
Must every row contain at least one item of each kind?
If
C
exceeds
A+B
, should the answer be zero?
What a Strong Answer Covers Guidance
The feasible range for the number of first-kind items, using both supply limits
Counting the orderings for each feasible mix without double counting identical items
The simplifications when
C
is at most both supplies and when it exceeds their total
A small hand-enumerated check
Follow-up Questions Guidance
How does the count change with three kinds of items?
How many rows have no two adjacent items of the same kind?
If
A
,
B
and
C
are very large, how would you compute the answer modulo a prime efficiently?