Generating Functions Homework Question 2

100 Views Asked by At

This is a HW question

The question is to use generating functions to count the number of six digit (positive) integers whose digits sum to $42$. Ex. $978468$ is a six digit integer whose digits sum to $42$

I am only looking for a hint on how to set this up.

1

There are 1 best solutions below

3
On BEST ANSWER

If $a_{n,s}$ is the number of $n$-digit numbers (allowing leading $0$) with digit sum $s$, then we have the recursion $$a_{n+1,s}=\sum_{d=0}^9 a_{n,s-d}$$ So if $f_n(z)=\sum_{s=0}^\infty a_{n,s}z^s$, you can express $f_{n+1}$ using $f_{n}$ ...