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

Click For Summary

Discussion Overview

The discussion revolves around understanding the recurrence relation for the number of valid n-digit codewords in a computer system that considers a string of decimal digits valid if it contains an even number of 0 digits. Participants explore the derivation of the term 10^{n-1} in the context of counting possible strings of a certain length, as well as the implications of valid and invalid strings.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Conceptual clarification

Main Points Raised

  • One participant presents a recurrence relation for a_n, stating that valid strings can be formed by adding digits to previous valid and invalid strings.
  • Another participant questions the total number of possible strings of length n-1, suggesting that it may relate to the term 10^{n-1}.
  • There is a clarification that a_{n-1} represents the number of valid strings, while 10^{n-1} may represent the total number of strings of length n-1.
  • One participant proposes that 10^{n-1} arises from considering each digit in a string of length n-1 can take on any of 10 values (0-9).

Areas of Agreement / Disagreement

Participants express uncertainty regarding the interpretation of the term 10^{n-1} and whether it accurately represents the total number of strings of a certain length. Multiple viewpoints on the counting of valid versus invalid strings are presented, and no consensus is reached.

Contextual Notes

Participants discuss the implications of defining valid and invalid strings, as well as the assumptions about the treatment of 0's in the context of the problem. The discussion does not resolve the mathematical steps or definitions involved in deriving the recurrence relation.

tamuag
Messages
9
Reaction score
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 a_n be the number of valid n-digit codewords. Find a recurrence relation for a_n."

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, a_{n - 1}, 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 a_n > 9a_{n - 1}.

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: 10^{n - 1} - a_{n - 1}. This gives:

a_n = 9a_{n - 1} + 10^{n - 1} - a_{n - 1} = 8a_{n-1} + 10^{n - 1}"

My question is where does 10^{n - 1} come from? I would understand this example if I could get where they were getting that term from.
 
Physics news on Phys.org
How many possible different strings of length n-1 are there?
 
a_{n−1}?
 
No. ##a_{n-1}## is the number of valid strings.
 
In the Stackexchange user's explanation, he says that 10^{n−1}−a_{n−1} is the complement of the number of valid strings. Is that to say, that the number of strings of length n-1 is 10^{n-1}?
 
Last edited:
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?
 
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?

10^{n-1}?

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

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
Replies
8
Views
3K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K