Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Investigating numbers with few repeated numbers
1 回表示 (過去 30 日間)
古いコメントを表示
how many 18 digit numbers are there such that no digit occurs more than three time in n?
1 件のコメント
回答 (1 件)
Amal George M
2019 年 4 月 11 日
編集済み: Amal George M
2019 年 4 月 11 日
The first digit has to be a non-zero digit, and hence it can only be populated 9 ways.
Let a denote the number of times the first digit is repeted in the rest of the 17 possible locations. and
(
) denote the number of times the other digits are repeated in the rest of the 17 possible locations.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/213110/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/213111/image.png)
Then the number of ways the rest of the locations can be filled is equalvent to the number of solutions to
under the constraints
and
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/213112/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/213113/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/213114/image.png)
This problem can be remodelled as a multiplication problem. Consider the algebraic expression
. If we expand this expression, then the coefficent of
power of x will be the number of solutions such that sum is n. This can be found by
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/213115/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/213116/image.png)
>> syms x
>> y=((1+x+x^2+x^3)^9*(1+x+x^2));
>> coX=coeffs(y,x);
>> coX(18)
ans =
69834
Now, since first place can be filled 9 ways, the final answer willl be 628506.
Correct me if I got this wrong.
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!