We now count the number of non-negative integer solutions to this equation with each $ y_i \leq 5 $. First, count all non-negative integer solutions to $ y_1 + y_2 + y_3 + y_4 = 10 $ without restriction:

["# Counting Non-Negative Integer Solutions: Restricted and Unrestricted Equations in Counting", "When solving combinatorics problems involving integer solutions, a fundamental question arises: how many non-negative integer solutions exist for equations of the form\n$$\ny_1 + y_2 + y_3 + y_4 = n?\n$$\nThis type of problem appears frequently in discrete mathematics, computer science, and optimization. In this article, we explore how to count unrestricted non-negative integer solutions and then build upon that to handle constraints—specifically, when each $ y_i $ is limited to $ y_i \leq 5 $. We start with the unrestricted case and then extend the method to include bounded variables.", "## Unrestricted Non-Negative Integer Solutions: Stars and Bars", "The simplest and most powerful tool for counting non-negative integer solutions to equations like\n$$\ny_1 + y_2 + y_3 + y_4 = 10\n$$\nis known as the stars and bars theorem.", "Theorem (Stars and Bars):\nThe number of non-negative integer solutions to\n$$\ny_1 + y_2 + \cdots + y_k = n\n$$\nis given by:\n$$\n\binom{n + k - 1}{k - 1}\n$$\nThis formula arises by imagining $ n $ indistinguishable “stars” to distribute into $ k $ distinguishable “bins” (variables), separated by $ k-1 $ “bars.”", "### Applying the Formula", "Here, we have $ k = 4 $ variables ($ y_1, y_2, y_3, y_4 $) and we want the number of non-negative integer solutions to\n$$\ny_1 + y_2 + y_3 + y_4 = 10\n$$\nUsing the stars and bars formula:\n$$\n\binom{10 + 4 - 1}{4 - 1} = \binom{13}{3}\n$$\nNow compute:\n$$\n\binom{13}{3} = \frac{13 \ imes 12 \ imes 11}{3 \ imes 2 \ imes 1} = 286\n$$\nThus, there are 286 unrestricted non-negative integer solutions to $ y_1 + y_2 + y_3 + y_4 = 10 $.", "---", "## Introducing the Constraint: $ y_i \leq 5 $", "Now suppose we introduce the constraint that each variable cannot exceed 5:\n$$\n0 \leq y_i \leq 5 \quad \ ext{for all } i = 1,2,3,4\n$$\nThis turns the problem into counting bounded non-negative integer solutions, which requires a refined counting technique.", "The total number of unrestricted solutions is 286, but some of these violate the $ y_i \leq 5 $ condition—specifically, those where one or more $ y_i > 5 $. To find the valid count, we use the Inclusion-Exclusion Principle.", "---", "## Step-by-Step Counting with Constraints", "Let $ A_i $ be the set of solutions where $ y_i \geq 6 $. We want to compute:\n$$\n\ ext{Valid solutions} = \ ext{Total} - \left|\bigcup_{i=1}^4 A_i\right|\n$$\nUsing inclusion-exclusion:\n$$\n\left|\bigcup_{i=1}^4 A_i\right| = \sum |A_i| - \sum |A_i \cap A_j| + \sum |A_i \cap A_j \cap A_k| - |A_1 \cap A_2 \cap A_3 \cap A_4|\n$$", "### Step 1: Count $ |A_i| $ — One variable $ \geq 6 $", "Fix $ y_1 \geq 6 $. Set $ y_1' = y_1 - 6 \geq 0 $. Then the equation becomes:\n$$\ny_1' + y_2 + y_3 + y_4 = 10 - 6 = 4\n$$\nNumber of non-negative integer solutions:\n$$\n\binom{4 + 4 - 1}{3} = \binom{7}{3} = 35\n$$\nThere are 4 such variables, so:\n$$\n\sum |A_i| = 4 \ imes 35 = 140\n$$", "### Step 2: Count $ |A_i \cap A_j| $ — Two variables $ \geq 6 $", "Fix $ y_1 \geq 6 $, $ y_2 \geq 6 $. Set $ y_1' = y_1 - 6 $, $ y_2' = y_2 - 6 $. Then:\n$$\ny_1' + y_2' + y_3 + y_4 = 10 - 12 = -2\n$$\nNegative total — no non-negative solutions exist. So:\n$$\n|A_i \cap A_j| = 0 \quad \ ext{for all } i <br/>\ne j\n$$\nHigher-order intersections (three or four) are also impossible, since even two variables exceeding 5 exceed the total sum of 10.", "---", "## Final Count", "Since all pairwise intersections and higher are empty, inclusion-exclusion stops here:\n$$\n\left|\bigcup_{i=1}^4 A_i\right| = 140\n$$\nThus, the number of valid solutions where all $ y_i \leq 5 $ is:\n$$\n286 - 140 = 146\n$$", "---", "## Conclusion", "Counting non-negative integer solutions becomes manageable using combinatorial tools like stars and bars. When constraints like $ y_i \leq 5 $ are introduced, the inclusion-exclusion principle enables precise adjustment of the unrestricted count by subtracting invalid cases.", "In this example:\n- Unrestricted solutions to $ y_1 + y_2 + y_3 + y_4 = 10 $: $ \binom{13}{3} = 286 $\n- Solutions with $ 0 \leq y_i \leq 5 $: $ 286 - 140 = 146 $", "This approach applies broadly—whether modeling resource allocation with bounded constraints or solving complex integer partition problems in algorithm design.", "---", "Keywords: non-negative integer solutions, stars and bars, inclusion-exclusion, bounded variables, combinatorics, counting solutions, $ y_i \leq 5 $, discrete mathematics, integer partition", "Meta Description:\nDiscover how to count non-negative integer solutions to equations like $ y_1 + y_2 + y_3 + y_4 = 10 $, starting with unrestricted stars and bars, then applying bounds with inclusion-exclusion. Learn to count only solutions where $ 0 \leq y_i \leq 5 $. Find the exact number: 146."]









