Break it up! Break it up! - MATLAB Cody - MATLAB Central

Problem 1873. Break it up! Break it up!

Difficulty:Rate

You have N pennies. Write a Matlab script that will reveal how many different ways you can break up those pennies. For example, with 5 pennies, there are seven different ways you can divide them:

  • (1,1,1,1,1)
  • (2,1,1,1)
  • (2,2,1)
  • (3,2)
  • (3,1,1)
  • (4,1)
  • (5)

The order of the coins does not matter, so (2,2,1) is considered the same combination as (2,1,2). You can assume that N will always be a positive integer.

Solution Stats

57.38% Correct | 42.62% Incorrect
Last Solution submitted on Jan 08, 2025

Problem Comments

Solution Comments

Show comments

Group

Randomness Image
Randomness
  • 11 Problems
  • 19 Finishers

Problem Recent Solvers57

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page