Questioning Recurrence Relation: 3n-1 - an-1

AI Thread Summary
The discussion centers on the recurrence relation for counting invalid strings, specifically questioning why the number of invalid strings is expressed as 3n-1 - an-1 instead of 3(3n-1 - an-1). Participants clarify that the requirement for a string to contain a pair of consecutive numbers does not limit this pair to the first two characters. They emphasize that valid strings can still be formed by appending to invalid strings of length n-1. The reasoning hinges on the total number of strings and the valid configurations, leading to the conclusion that the initial assumption about the placement of consecutive numbers is flawed. The conversation highlights the importance of clearly articulating the logic behind the recurrence relation.
Miike012
Messages
1,009
Reaction score
0
I boxed the portion of the solution that I am questioning.

How come the number of invalid strings is only 3n-1 - an-1 and not
3(3n-1 - an-1) ?

As you can see there are three cases (Which are to the right of the black box)

In all the three cases, the portion boxed in red is a string of length n-1 and does not have any consecutive numbers

Case 1:
The first number is a 1, then the second number must also be a 1
so that the string has a pair of consecutive numbers

Case 2
The first number is a 2, then the second number must also be a 2
so that the string has a pair of consecutive numbers

Case 3
The first number is a 0, then the second number must also be a 0
so that the string has a pair of consecutive numbers
 

Attachments

  • aaaa.jpg
    aaaa.jpg
    15.7 KB · Views: 489
Physics news on Phys.org
Miike012 said:
I boxed the portion of the solution that I am questioning.

How come the number of invalid strings is only 3n-1 - an-1 and not
3(3n-1 - an-1) ?

As you can see there are three cases (Which are to the right of the black box)

In all the three cases, the portion boxed in red is a string of length n-1 and does not have any consecutive numbers

Case 1:
The first number is a 1, then the second number must also be a 1
so that the string has a pair of consecutive numbers

Case 2
The first number is a 2, then the second number must also be a 2
so that the string has a pair of consecutive numbers

Case 3
The first number is a 0, then the second number must also be a 0
so that the string has a pair of consecutive numbers
This is not true. There is no requirement that the "pair of consecutive numbers" be the first two. For example, 100 is a valid string with n= 3.
 
HallsofIvy said:
This is not true. There is no requirement that the "pair of consecutive numbers" be the first two. For example, 100 is a valid string with n= 3.

The string of length n has the requirment that it must have a pair of consecutive numbers, so if the 2nd term through the nth term of the string don't have a pair of consecutive numbers then the first term and second term must be the same inorder to satisfy the requirement.
 
Miike012 said:
I boxed the portion of the solution that I am questioning.

How come the number of invalid strings is only 3n-1 - an-1 and not
3(3n-1 - an-1) ?

As you can see there are three cases (Which are to the right of the black box)

In all the three cases, the portion boxed in red is a string of length n-1 and does not have any consecutive numbers
I don't understand your logic. The reasoning in the attachment starts with an invalid string length n-1. By definition there are an-1 valid strings of that length, and obviously there are 3n-1 total strings of that length. Therefore there are (3n-1 - an-1) invalid strings length n-1. For each such invalid string, there is exactly one way of tacking on an nth (at the given end) to produce a valid string length n.
If that doesn't help, I'll need you to spell out your own reasoning more clearly.
 
I picked up this problem from the Schaum's series book titled "College Mathematics" by Ayres/Schmidt. It is a solved problem in the book. But what surprised me was that the solution to this problem was given in one line without any explanation. I could, therefore, not understand how the given one-line solution was reached. The one-line solution in the book says: The equation is ##x \cos{\omega} +y \sin{\omega} - 5 = 0##, ##\omega## being the parameter. From my side, the only thing I could...
Back
Top