Given a set {1;2;3;4;5}, find the number of 5 digits numbers that none of its consecutive digits are equal to each other,. If possible, find the sum of them
This discussion board is a place to discuss our Daily Challenges and the math and science
related to those challenges. Explanations are more than just a solution — they should
explain the steps and thinking strategies that you used to obtain the solution. Comments
should further the discussion of math and science.
When posting on Brilliant:
Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.
Markdown
Appears as
*italics* or _italics_
italics
**bold** or __bold__
bold
- bulleted - list
bulleted
list
1. numbered 2. list
numbered
list
Note: you must add a full line of space before and after lists for them to show up correctly
# I indented these lines
# 4 spaces, and now they show
# up as a code block.
print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.
print "hello world"
Math
Appears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3
2×3
2^{34}
234
a_{i-1}
ai−1
\frac{2}{3}
32
\sqrt{2}
2
\sum_{i=1}^3
∑i=13
\sin \theta
sinθ
\boxed{123}
123
Comments
Assuming that the given set is the set of digits we can use (with replacement) to form the 5-digit numbers, the number of such 5-digit numbers with no two consecutive digits equal to each other is equal to 5×44=1280. The combinatorial argument here is constructive: We can select the first digit in 5 ways, then the second digit in 4 ways (excluding the first digit), the third digit in 4 ways (excluding the second digit) and so on till the 5th digit. By the rule of product, there are 1280 such numbers.
Now, to find the sum of all such numbers, note that every digit appears exactly 44=256 times at each digit-place among all such numbers. This can be proved easily using the argument used above. If we fix a digit at a digit-place, its adjacent digits can be chosen in 4 ways and their adjacent digits can also be chosen in 4 ways since we can't have adjacent digits equal to each other. Repeating this argument shows that for each fixed digit at a fixed digit place, there are exactly 256 numbers having the said digit at the said digit-place.
Hence, by the rule of product, the sum is given by, 256(1+2+3+4+5)(104+103+102+10+1)=42666240
To generalize this to some extent, if S be the set of digits that can be used to make n-digit numbers with no two consecutive digits equal to each other, then,
If 0∈/S, there are ∣S∣×(∣S∣−1)n−1 such numbers and their sum is given by, (∣S∣−1)n−1(k∈S∑k)(k=0∑n−110k)=9(∣S∣−1)n−1(10n−1)(k∈S∑k)
If 0∈S, then there are (∣S∣−1)n such numbers. I'm pretty sure that there's a closed form for their sum, but it gets a bit complicated for me. I'm still working on it. I'll edit this comment when I get the closed form.
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
Assuming that the given set is the set of digits we can use (with replacement) to form the 5-digit numbers, the number of such 5-digit numbers with no two consecutive digits equal to each other is equal to 5×44=1280. The combinatorial argument here is constructive: We can select the first digit in 5 ways, then the second digit in 4 ways (excluding the first digit), the third digit in 4 ways (excluding the second digit) and so on till the 5th digit. By the rule of product, there are 1280 such numbers.
Now, to find the sum of all such numbers, note that every digit appears exactly 44=256 times at each digit-place among all such numbers. This can be proved easily using the argument used above. If we fix a digit at a digit-place, its adjacent digits can be chosen in 4 ways and their adjacent digits can also be chosen in 4 ways since we can't have adjacent digits equal to each other. Repeating this argument shows that for each fixed digit at a fixed digit place, there are exactly 256 numbers having the said digit at the said digit-place.
Hence, by the rule of product, the sum is given by, 256(1+2+3+4+5)(104+103+102+10+1)=42666240
To generalize this to some extent, if S be the set of digits that can be used to make n-digit numbers with no two consecutive digits equal to each other, then,
If 0∈/S, there are ∣S∣×(∣S∣−1)n−1 such numbers and their sum is given by, (∣S∣−1)n−1(k∈S∑k)(k=0∑n−110k)=9(∣S∣−1)n−1(10n−1)(k∈S∑k)
If 0∈S, then there are (∣S∣−1)n such numbers. I'm pretty sure that there's a closed form for their sum, but it gets a bit complicated for me. I'm still working on it. I'll edit this comment when I get the closed form.