Exercise · ZW-INTEGER-COMPOSITION-001 · ★☆☆ Basic
How many compositions of n=3 exist in total?
Choose one option.
Show answer
- A. 4
Exercise · ZW-INTEGER-COMPOSITION-001 · ★☆☆ Basic
Choose one option.
There are 2^(3-1)=4 compositions: 3, 1+2, 2+1 and 1+1+1. The option of 3 counts only the parts without order, and the option of 8 ignores that n-1 is the exponent.
A composition of a positive integer n is a way of writing it as an ordered sum of positive integers, where the order of the summands matters.