Where Does 10^{n-1} Come From in the Recurrence Relation Example?

In summary, the Stackexchange user explains that there are a total of 10^{n-1} different strings of length n-1, where every element of the string can have any of 10 possible values.
  • #1
tamuag
9
0

Homework Statement


This isn't actually a homework question.Actually, it's an example from Rosen's Discrete Math and Its Applications that I'm having difficulty with:

"A computer system considers a string of decimal digits a valid codeword if it contains an even number of 0 digits. For instance, 1230407869 is valid, whereas 120987045608 is not valid. Let [itex]a_n[/itex] be the number of valid n-digit codewords. Find a recurrence relation for [itex]a_n[/itex]."

Homework Equations



The Attempt at a Solution



Here's an explanation from a Stackexchange user, that more or less is identical to the explanation from the book: "Take the number of valid strings in the previous, [itex]a_{n - 1}[/itex], you can't add a 0 because that would make the previously valid string invalid, so you can add any digit from 1-9 (i.e. 9 digits). So right away we know that [itex]a_n > 9a_{n - 1}[/itex].

But what about the previously invalid strings? If it was invalid, then there were an odd number of 0's and adding one more will make it valid. Now it depends on whether or not you consider zero 0's an even number of 0's. If so just take the compliment of the valid strings: [itex]10^{n - 1} - a_{n - 1}[/itex]. This gives:

[itex]a_n = 9a_{n - 1} + 10^{n - 1} - a_{n - 1} = 8a_{n-1} + 10^{n - 1}[/itex]"

My question is where does [itex]10^{n - 1}[/itex] come from? I would understand this example if I could get where they were getting that term from.
 
Physics news on Phys.org
  • #2
How many possible different strings of length n-1 are there?
 
  • #3
[itex]a_{n−1}[/itex]?
 
  • #4
No. ##a_{n-1}## is the number of valid strings.
 
  • #5
In the Stackexchange user's explanation, he says that [itex]10^{n−1}−a_{n−1}[/itex] is the complement of the number of valid strings. Is that to say, that the number of strings of length n-1 is [itex]10^{n-1}[/itex]?
 
Last edited:
  • #6
How would you go about working out the number of different possible strings of length n-1 (ignoring any notions of validity introduced in the question), where every element of the string can have anyone of 10 possible values?

eg if you have a combination lock with n-1 barrels, and each barrel has the numbers 0-9, how many different possible combinations are there?
 
  • #7
andrewkirk said:
eg if you have a combination lock with n-1 barrels, and each barrel has the numbers 0-9, how many different possible combinations are there?

[itex]10^{n-1}[/itex]?

Correct me if I'm wrong: [itex]10^{n-1}[/itex] is the term of all bit strings of length n-1 because the first digit of that string is any of ten digits ([itex]10[/itex]), which can each be followed by any of ten digits ([itex]10^2[/itex]), which can each be followed be ten different digits ([itex]10^3[/itex]), and so on ([itex]10^{n-1}[/itex])?
 

What is a recurrence relation?

A recurrence relation is a mathematical expression that defines a sequence of numbers by relating each term to one or more previous terms in the sequence.

Why are recurrence relations important?

Recurrence relations are important because they allow us to describe and analyze complex mathematical patterns and relationships in a concise and recursive manner, making it easier to solve problems involving sequences.

What is an example of a recurrence relation?

An example of a recurrence relation is the Fibonacci sequence, where each term is the sum of the two previous terms: fn = fn-1 + fn-2, with f0 = 0 and f1 = 1.

How do you solve a recurrence relation?

The process of solving a recurrence relation involves finding a closed-form expression, or explicit formula, for the sequence. This can be done by using various methods such as substitution, iteration, and the method of characteristic roots.

What are the practical applications of recurrence relations?

Recurrence relations have various practical applications in fields such as computer science, economics, and physics. They can be used to model and analyze real-world phenomena, such as population growth, algorithmic complexity, and electromagnetic waves.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
Replies
8
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
18
Views
2K
  • Calculus and Beyond Homework Help
Replies
11
Views
1K
  • Precalculus Mathematics Homework Help
Replies
2
Views
2K
  • Programming and Computer Science
Replies
17
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Precalculus Mathematics Homework Help
Replies
6
Views
830
  • Programming and Computer Science
Replies
1
Views
1K
Back
Top