Achievable logoAchievable logo
AMC
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. Algebra
2. Geometry
3. Number theory
4. Counting and probability
4.1 Permutations and combinations
4.2 Probability
4.3 Stars and bars
5. Intermediate topics (AMC 10/12)
6. Advanced topics (AMC 12)
7. General approaches
8. Practical strategies
Wrapping up
Achievable logoAchievable logo
4.3 Stars and bars
Achievable AMC
4. Counting and probability

Stars and bars

4 min read
Font
Discuss
Share
Feedback

This chapter applies to all AMC 8/10/12 test takers.

The stars and bars method is a combinatorics technique for counting how many ways you can distribute identical items into groups, or how many combinations are possible when repetition is allowed.

The idea is simple:

  • The items you’re distributing are the stars.
  • The dividers that separate groups are the bars.

Once you translate a problem into stars and bars, the counting question becomes:

  • “How many different ways can I place the bars among the stars?”

That’s often much easier than counting the distributions directly.

Here’s a simple example. Suppose you have 10 dollars to give to two children. If each child gets at least one dollar, how many ways can you split the money?

Start by laying out 10 identical dollars as 10 stars:

∗∗∗∗∗∗∗∗∗∗

To split the stars into two groups, we use one bar. Stars to the left go to the first child, and stars to the right go to the second:

∗∗∗∗∗∣∗∗∗∗∗

That split gives each child 5 dollars. Another valid split is:

∗∣∗∗∗∗∗∗∗∗∗

Because each child must get at least one dollar, the bar can’t go at either end. That leaves 9 possible positions for the bar (between adjacent stars), so there are 9 ways to split the money.

Now suppose there are three children. We need two bars to split the 10 stars into three groups. The question is still “How many ways can we place the bars among the stars?”

There are still 9 gaps between stars, and we choose 2 of them for the bars. That’s 9C2, which equals 36.

Try this similar AMC question using the same method.

Example: The question below is from 2004 AMC 8

Three friends have a total of 6 identical pencils, and each one has at least one pencil. In how many ways can this happen?
A. 1
B. 3
C. 6
D. 10
E. 12

(spoiler)

Answer: D. 10

This method is also useful for counting combinations with repetition. For example, imagine you want a bowl with four scoops of ice cream, and there are three flavors to choose from. You can choose anywhere from zero to four scoops of each flavor. How many different flavor combinations are possible?

In the money example, each star was a dollar, and the bar(s) determined how many dollars each person received. Here:

  • Each star is a scoop.
  • The bars split the scoops into three groups, one group per flavor.

Start with four stars:

∗∗∗∗

We need two bars to create three flavor groups. Since a flavor is allowed to have zero scoops, bars can go at the edges, and the two bars can even be adjacent.

Here are some valid arrangements:

∗∣∗∗∣∗

$ ||$

∣∣∗∗∗∗

Now count the total symbols being arranged:

  • 4 stars
  • 2 bars

That’s 6 total positions. Choosing where the 2 bars go determines the whole arrangement, so the count is 6C2, which equals 15.

More complex combinatorial identities will be discussed later in the Advanced topics unit.

Common themes

  • This method is most likely necessary when a question a question is about distributing or assigning things among people or bins, when you are selecting a group of items among different categories of things, or when you are choosing n-digit integers when the digits are in ascending or descending order.
  • When a problem says “at least 1”, recognize that the arrangement must allow for at least one star to the left and right of each bar.
  • Recognize that the stars and bars method cannot be applied to groups of all distinct items or when the order is important. Stars and bars are useful for combinations, not permutations.

Stars and Bars Method Basics

  • Used for distributing identical items into groups
  • Stars = items; Bars = dividers between groups
  • Converts distribution problems into counting bar placements

Counting Arrangements

  • Number of ways = number of ways to place bars among stars
  • If each group must get at least one item:
    • Bars cannot be at ends; only between stars
    • Number of ways: choose bar positions from gaps between stars
  • If groups can get zero items:
    • Bars can go anywhere, including ends or together
    • Total positions = stars + bars; choose bar positions

Example Applications

  • Distributing n identical items to k groups:
    • At least one per group: choose k−1 bars from n−1 gaps ((k−1n−1​))
    • Zero allowed: choose k−1 bars from n+k−1 positions ((k−1n+k−1​))
  • AMC 8 example: 6 pencils to 3 friends, at least one each → (25​)=10 ways
  • Ice cream scoops example: 4 scoops, 3 flavors, zero allowed → (26​)=15 ways

Common Themes and Limitations

  • Use for distributing/assigning identical items, selecting groups with repetition, or n-digit numbers in order
  • For “at least 1” constraints, ensure no bar at ends
  • Not for distinct items or when order matters (permutations)
  • Applies to combinations with repetition, not to permutations

Sign up for free to take 6 quiz questions on this topic

Previous
Next  | 5.1 Polynomials
All rights reserved ©2016 - 2026 Achievable, Inc.

Stars and bars

This chapter applies to all AMC 8/10/12 test takers.

The stars and bars method is a combinatorics technique for counting how many ways you can distribute identical items into groups, or how many combinations are possible when repetition is allowed.

The idea is simple:

  • The items you’re distributing are the stars.
  • The dividers that separate groups are the bars.

Once you translate a problem into stars and bars, the counting question becomes:

  • “How many different ways can I place the bars among the stars?”

That’s often much easier than counting the distributions directly.

Here’s a simple example. Suppose you have 10 dollars to give to two children. If each child gets at least one dollar, how many ways can you split the money?

Start by laying out 10 identical dollars as 10 stars:

∗∗∗∗∗∗∗∗∗∗

To split the stars into two groups, we use one bar. Stars to the left go to the first child, and stars to the right go to the second:

∗∗∗∗∗∣∗∗∗∗∗

That split gives each child 5 dollars. Another valid split is:

∗∣∗∗∗∗∗∗∗∗∗

Because each child must get at least one dollar, the bar can’t go at either end. That leaves 9 possible positions for the bar (between adjacent stars), so there are 9 ways to split the money.

Now suppose there are three children. We need two bars to split the 10 stars into three groups. The question is still “How many ways can we place the bars among the stars?”

There are still 9 gaps between stars, and we choose 2 of them for the bars. That’s 9C2, which equals 36.

Try this similar AMC question using the same method.

Example: The question below is from 2004 AMC 8

Three friends have a total of 6 identical pencils, and each one has at least one pencil. In how many ways can this happen?
A. 1
B. 3
C. 6
D. 10
E. 12

(spoiler)

Answer: D. 10

This method is also useful for counting combinations with repetition. For example, imagine you want a bowl with four scoops of ice cream, and there are three flavors to choose from. You can choose anywhere from zero to four scoops of each flavor. How many different flavor combinations are possible?

In the money example, each star was a dollar, and the bar(s) determined how many dollars each person received. Here:

  • Each star is a scoop.
  • The bars split the scoops into three groups, one group per flavor.

Start with four stars:

∗∗∗∗

We need two bars to create three flavor groups. Since a flavor is allowed to have zero scoops, bars can go at the edges, and the two bars can even be adjacent.

Here are some valid arrangements:

∗∣∗∗∣∗

$ ||$

∣∣∗∗∗∗

Now count the total symbols being arranged:

  • 4 stars
  • 2 bars

That’s 6 total positions. Choosing where the 2 bars go determines the whole arrangement, so the count is 6C2, which equals 15.

More complex combinatorial identities will be discussed later in the Advanced topics unit.

Common themes

  • This method is most likely necessary when a question a question is about distributing or assigning things among people or bins, when you are selecting a group of items among different categories of things, or when you are choosing n-digit integers when the digits are in ascending or descending order.
  • When a problem says “at least 1”, recognize that the arrangement must allow for at least one star to the left and right of each bar.
  • Recognize that the stars and bars method cannot be applied to groups of all distinct items or when the order is important. Stars and bars are useful for combinations, not permutations.
Key points

Stars and Bars Method Basics

  • Used for distributing identical items into groups
  • Stars = items; Bars = dividers between groups
  • Converts distribution problems into counting bar placements

Counting Arrangements

  • Number of ways = number of ways to place bars among stars
  • If each group must get at least one item:
    • Bars cannot be at ends; only between stars
    • Number of ways: choose bar positions from gaps between stars
  • If groups can get zero items:
    • Bars can go anywhere, including ends or together
    • Total positions = stars + bars; choose bar positions

Example Applications

  • Distributing n identical items to k groups:
    • At least one per group: choose k−1 bars from n−1 gaps ((k−1n−1​))
    • Zero allowed: choose k−1 bars from n+k−1 positions ((k−1n+k−1​))
  • AMC 8 example: 6 pencils to 3 friends, at least one each → (25​)=10 ways
  • Ice cream scoops example: 4 scoops, 3 flavors, zero allowed → (26​)=15 ways

Common Themes and Limitations

  • Use for distributing/assigning identical items, selecting groups with repetition, or n-digit numbers in order
  • For “at least 1” constraints, ensure no bar at ends
  • Not for distinct items or when order matters (permutations)
  • Applies to combinations with repetition, not to permutations

More from Counting and probability

  • Permutations and combinations
  • Probability