Find a recurrence relation for this problem

AI Thread Summary
The discussion focuses on finding a recurrence relation for the number of valid mathematical expressions of length n, denoted as an. Valid expressions can include digits (0-9) and operators (+, ×, /), with specific definitions for numbers and expressions. The initial values a1 and a2 are established easily, as they correspond to single-digit and two-digit numbers, respectively. Participants suggest calculating further values to identify a pattern that could lead to a closed form for an. The conversation emphasizes the importance of understanding the structure of valid expressions to derive the recurrence relation.
johnsmiths
Messages
4
Reaction score
0

Homework Statement


Suppose that a mathematical expression can only be formed by the following symbols: 0, 1,
2, …, 9, ×, +, /. Some examples are “0 + 9”; “2 + 2 × 8”; “1 / 5 + 6”. Let an be the the number of such mathematical expression of length n (e.g. “0 + 9” is considered of length 3). Find a recurrence relation for an and compute the closed form for an.
[Some clarification: We define a number as follows
- 0, 1, 2, …, 9 is a number
- If x is a number, then x0, x1, …, x9 is a number
We define a valid expression as follows
- E is a valid expression if E is a number
- If E, F are valid expressions, then E + F, E × F, E / F are also valid expressions.
For example: 1+50/4 is an expression of length 6, and 09×00/5 is an expression of length 7.]

The Attempt at a Solution


No idea.
 
Physics news on Phys.org


johnsmiths said:

Homework Statement


Suppose that a mathematical expression can only be formed by the following symbols: 0, 1,
2, …, 9, ×, +, /. Some examples are “0 + 9”; “2 + 2 × 8”; “1 / 5 + 6”. Let an be the the number of such mathematical expression of length n (e.g. “0 + 9” is considered of length 3). Find a recurrence relation for an and compute the closed form for an.
[Some clarification: We define a number as follows
- 0, 1, 2, …, 9 is a number
- If x is a number, then x0, x1, …, x9 is a number
We define a valid expression as follows
- E is a valid expression if E is a number
- If E, F are valid expressions, then E + F, E × F, E / F are also valid expressions.
For example: 1+50/4 is an expression of length 6, and 09×00/5 is an expression of length 7.]

The Attempt at a Solution


No idea.

Before trying to come up with a closed form expression for an it might be helpful to figure out a1, a2, and a few more.

a1 is pretty easy, since a valid expression of length 1 can only be a number with a single digit.
a2 is almost as easy, since a valid expression of length 2 can only a number with two digits.

Continue along these lines and see what you can come up with.
 
Back
Top