Solve Recurrence Equation for Domino Chart of 1xn

  • MHB
  • Thread starter Puzzles
  • Start date
  • Tags
    Recurrence
In summary: There is a chart with dimensions 1xn. We have dominoes in two different colors which we should use to fill up the chart. In how many different ways can the chart be filled?The way I understand it, a single domino will take up two spaces. Therefore, we have n/2 places to put the dominoes in, and 2 choices at each place. However, I'm not certain about the whole "a single domino will take up two spaces" if it's a correct assumption at all - I'm afraid I don't understand the problem well enough. In any case, if this is the solution, it has nothing to do with recurrence relations, and I have no idea how
  • #1
Puzzles
21
0
Hey everyone, it's me again with yet another recurrence equation I've been stuck with:

Using recurrence relations (recurrence equations... is it the same thing?), solve the following: There is a chart with dimensions 1xn. We have dominoes in two different colors which we should use to fill up the chart. In how many different ways can the chart be filled?

The way I understand it, a single domino will take up two spaces. Therefore, we have n/2 places to put the dominoes in, and 2 choices at each place. However, I'm not certain about the whole "a single domino will take up two spaces" if it's a correct assumption at all - I'm afraid I don't understand the problem well enough. In any case, if this is the solution, it has nothing to do with recurrence relations, and I have no idea how to even start with those.

Very obviously, I'm hopeless with recurrence problems. I hope someone can explain how this particular problem should be solved using recurrence relations. Thank you :)
 
Physics news on Phys.org
  • #2
Puzzles said:
Hey everyone, it's me again with yet another recurrence equation I've been stuck with:

Using recurrence relations (recurrence equations... is it the same thing?), solve the following: There is a chart with dimensions 1xn. We have dominoes in two different colors which we should use to fill up the chart. In how many different ways can the chart be filled?

The way I understand it, a single domino will take up two spaces. Therefore, we have n/2 places to put the dominoes in, and 2 choices at each place. However, I'm not certain about the whole "a single domino will take up two spaces" if it's a correct assumption at all - I'm afraid I don't understand the problem well enough. In any case, if this is the solution, it has nothing to do with recurrence relations, and I have no idea how to even start with those.

Very obviously, I'm hopeless with recurrence problems. I hope someone can explain how this particular problem should be solved using recurrence relations. Thank you :)

Hey Puzzles,

Suppose $a_n$ is the number of ways for a chart with $n$ positions and $n$ even.
In how many ways might we insert another domino between the others, giving us a chart of $n+2$ positions?
And what does that make $a_{n+2}$? (Wondering)
 
  • #3
In my opinion, this is the most poorly constructed problem I've seen in quite some time (shame on whoever assigned this to students). Why were dominoes used, where one must assume $n$ is even if we assume the dominoes are 1 X 2? Why is there no mention of the type of domino sets, such as double-six sets or double-nine sets? If we have two double-$p$ sets, then must we assume $n=(p+1)(p+2)$? Can the dominoes be placed pip side up or down?

A better problem to me would be to use 1 X 1 solidly colored square tiles, with a choice of 2 or even $m$ colors, where the number of tiles of any particular color from which to choose is at least as great as $n$. :D
 
  • #4
I agree that it's an awfully constructed problem, honestly I'm not even sure I understand it. Somehow I got to solve it in the next few hours.

I've been thinking about it a lot. Let's say one domino is blue, the other is green.

1 x 1: 0
1 x 2: 2 different ways, we can place the blue one, or the green one
1 x 3: 4 different ways, but it gets tricky - we haven't exactly filled the entire board.
1 x 4: again 4 different ways, but this isn't too difficult to picture. We either have 2 blue, 2 green, 1st blue then green, or 1st green then blue
1 x 5: 12 ways
1 x 6: here's where I count 8, and get really confused
View attachment 6556
View attachment 6557

I don't think that what I'm doing with the odd numbers is correct. If we consider n to be even, then, with combinatorics, I get 2n/2, which is exactly what I've been counting with my visualization. I still don't understand if a domino will take up two spots in the chart, or one. Even in the case I've presented, the relation an = 2an-2 leaves me uncertain.
 

Attachments

  • dominoes.png
    dominoes.png
    650 bytes · Views: 91
  • dominoes1.png
    dominoes1.png
    464 bytes · Views: 94
Last edited:
  • #5
If we assume the dominoes are 1 X 2, and we assume there will be no blank spaces (i.e. the chart is completely filled), then we must assume $n$ is even. Let $n=2k$ where $k\in\mathbb{N}$.

We should further assume that pips are to be ignored, or don't come into play, that is, we simply have 1 X 2 solidly colored tiles.

So far you have found, in terms of $a_k$:

\(\displaystyle a_1=2\)

\(\displaystyle a_2=4\)

\(\displaystyle a_3=8\)

Now, what relation would you say there is between $a_k$ and $a_{k-1}$? Can you state a reason for the relationship that doesn't rely on knowing any particular $a_k$?
 
  • #6
MarkFL said:
If we assume the dominoes are 1 X 2, and we assume there will be no blank spaces (i.e. the chart is completely filled), then we must assume $n$ is even. Let $n=2k$ where $k\in\mathbb{N}$.

We should further assume that pips are to be ignored, or don't come into play, that is, we simply have 1 X 2 solidly colored tiles.

So far you have found, in terms of $a_k$:

\(\displaystyle a_1=2\)

\(\displaystyle a_2=4\)

\(\displaystyle a_3=8\)

Now, what relation would you say there is between $a_k$ and $a_{k-1}$? Can you state a reason for the relationship that doesn't rely on knowing any particular $a_k$?

ak = 2ak-1. Same as ak = 2n/2, which doesn't rely on the previous solution. I have trouble trusting this solution...
 
  • #7
Puzzles said:
ak = 2ak-1. Same as ak = 2n/2, which doesn't rely on the previous solution. I have trouble trusting this solution...

I agree that:

\(\displaystyle a_k=2a_{k-1}\)

My reasoning would be:

\(\displaystyle a_k=(\text{number of color choices})\cdot a_{k-1}\)

Each time we add a tile, we have 2 choices of color, and so we double the previous number of ways to tile the chart. And so we have the recurrence:

\(\displaystyle a_k=2a_{k-1}\) where $a_1=2$

Can you now find the closed form for $a_k$?
 
  • #8
I'm sorry, I'm not sure I know what "closed form" refers to.
 
  • #9
Puzzles said:
I'm sorry, I'm not sure I know what "closed form" refers to.

Typically, when you solve a recurrence relation (difference equation), you turn the relationship between successive values of the recurrence into a function that doesn't depend on previous values. This may also be referred to as solving the recurrence. :D

So, what we want is something of the form:

\(\displaystyle a_k=f(k)\)

where $f$ depends only on $k$, and not other values of $a$.
 
  • #10
MarkFL said:
Typically, when you solve a recurrence relation (difference equation), you turn the relationship between successive values of the recurrence into a function that doesn't depend on previous values. This may also be referred to as solving the recurrence. :D

So, what we want is something of the form:

\(\displaystyle a_k=f(k)\)

where $f$ depends only on $k$, and not other values of $a$.

Oh, right, thanks! Isn't it simply ak = 2k/2?
 
  • #11
Puzzles said:
Oh, right, thanks! Isn't it simply ak = 2k/2?

Well, let's see...the characteristic equation is:

\(\displaystyle r-2=0\implies r=2\)

And thus, the closed form will take the form:

\(\displaystyle a_k=c_12^k\)

Now, we must use our initial value to determine the parameter $c_1$:

\(\displaystyle a_1=2c_1=2\implies c_1=1\)

And so the solution to the recurrence is:

\(\displaystyle a_k=2^k\) where $k=\frac{n}{2}$
 
  • #12
Yeah, exactly! My approach is never mathematical enough. Thanks a bunch, again!
 
  • #13
Update: I had a talk with the professor today, and turns out there was a typo in the assignment - the board is supposed to be 2xn, not 1xn as it was written. She also confirmed we're considering 1x2 sized dominoes.

I've found several solutions online, which look pretty much the same like the one here: Fit 1*2 dominos in 2*N strip | PROGRAMMING INTERVIEWS

So yeah. Now I'm just trying to get around the "two different colors" problem. Does anyone have any ideas how to do this with two different sets of dominoes?
 
  • #14
Based on the reasoning in the link posted, and extending it to tiles of two colors, I would posit the recurrence:

\(\displaystyle a_{n+1}=2a_{n}+4a_{n-1}\) where \(\displaystyle a_1=2,\,a_2=4\)

So, can you find the characteristic roots and give the general form for the solution?
 
  • #15
How did you come to that recurrence?

For the roots, I get 1+sqrt(5) and 1-sqrt(5). (I still can't figure out how to format it properly, I'm sorry :( I keep trying to)

Based on this, I get:

an = (1+sqrt(5))n + (1-sqrt(5))n
 
  • #16
Puzzles said:
How did you come to that recurrence?

If $F_n$ is the $n$th Fibonacci number, then I considered:

\(\displaystyle a_{n}=2^nF_{n}\implies F_n=2^{-n}a_{n}\)

But, we know:

\(\displaystyle F_{n+1}=F_{n}+F_{n-1}\)

And so we may write:

\(\displaystyle 2^{-(n+1)}a_{n+1}=2^{-n}a_{n}+2^{-(n-1)}a_{n-1}\)

Multiply through by $2^{n+1}$ to get:

\(\displaystyle a_{n+1}=2a_{n}+4a_{n-1}\)

Puzzles said:
For the roots, I get 1+sqrt(5) and 1-sqrt(5). (I still can't figure out how to format it properly, I'm sorry :( I keep trying to)

Based on this, I get:

an = (1+sqrt(5))n + (1-sqrt(5))n

Yes, those are the correct roots, however, this means the general form of the solution will be:

\(\displaystyle a_n=c_1\left(1+\sqrt{5}\right)^n+c_2\left(1-\sqrt{5}\right)^n\)

Now, we need to determine the parameters $c_i$ from the initial values...(Thinking)
 
  • #17
Oh thanks, that makes a lot of sense. And yeah, I just wrote it down directly because I got c1 = c2 = 1.
 
  • #18
Puzzles said:
Oh thanks, that makes a lot of sense. And yeah, I just wrote it down directly because I got c1 = c2 = 1.

I get different values...please post your work so I can see where we differ. :)
 
  • #19
Well,

a1 = 2 = c1(1+sqrt(5)) + c2(1-sqrt(5))
a2 = 4 = c1(1+sqrt(5))2 + c2(1-sqrt(5))2

c1 + c1sqrt(5) + c21 - c2sqrt(5) = 2
6c1 + 2c1sqrt(5) + 6c21 - 2c2sqrt(5) = 4

When I multiply the first equation by 2, and subtract it from the second, I get

c1 = c2

And, replacing that in the first equation,

2c1 = 2

Thus
c1 = c2 = 1

- - - Updated - - -

Puzzles said:
Well,

a1 = 2 = c1(1+sqrt(5)) + c2(1-sqrt(5))
a2 = 4 = c1(1+sqrt(5))2 + c2(1-sqrt(5))2

c1 + c1sqrt(5) + c21 - c2sqrt(5) = 2
6c1 + 2c1sqrt(5) + 6c21 - 2c2sqrt(5) = 4

When I multiply the first equation by 2, and subtract it from the second, I get

c1 = c2

And, replacing that in the first equation,

2c1 = 2

Thus
c1 = c2 = 1

Right, I see my mistake now.

c1 = -c2

So, c1 = 1/sqrt(5), c2 = -1/sqrt(5)
 
  • #20
Puzzles said:
Well,

a1 = 2 = c1(1+sqrt(5)) + c2(1-sqrt(5))
a2 = 4 = c1(1+sqrt(5))2 + c2(1-sqrt(5))2

c1 + c1sqrt(5) + c21 - c2sqrt(5) = 2
6c1 + 2c1sqrt(5) + 6c21 - 2c2sqrt(5) = 4

When I multiply the first equation by 2, and subtract it from the second, I get

c1 = c2

What you actually get is:

\(\displaystyle c_1=-c_2\)

This is what you get if you consider the case where $n=0$...which is $a_0=0$.

So, using $a_1$, we then have:

\(\displaystyle c_1(1+\sqrt{5})-c_1(1-\sqrt{5})=2\)

What do you now get for $c_1$?
 
  • #21
Puzzles said:
Right, I see my mistake now.

c1 = -c2

So, c1 = 1/sqrt(5), c2 = -1/sqrt(5)

Yes, that's what I got as well. (Yes)

As a follow-up question, using your result and the relationship between this sequence and the Fibonacci sequence, what would be the closed form for the Fibonacci sequence?
 
  • #22
Yeah, I'm a little popular in my uni for screwing up at least a quarter points of each exam by making silly mistakes like that. :D

an = 1/sqrt(5)(1+sqrt(5))n - 1/sqrt(5)(1-sqrt(5))nTo the follow up question, I get the same result... :( My gut tells me I'm just solving it wrong, as usual. The roots are 1/2 + 1/2sqrt(5) and 1/2 - 1/2sqrt(5) this time. Considering that a1 = 1 and a2 = 2 in this case, I get the same result... I'm sorry for being useless. My problem is I haven't solved nearly enough examples to actually know what I'm doing, which is due to the fact that education over here sucks.
 
  • #23
Puzzles said:
Yeah, I'm a little popular in my uni for screwing up at least a quarter points of each exam by making silly mistakes like that. :D

an = 1/sqrt(5)(1+sqrt(5))n - 1/sqrt(5)(1-sqrt(5))n

Yes, and I would write this as:

\(\displaystyle a_n=\frac{\left(1+\sqrt{5}\right)^n-\left(1-\sqrt{5}\right)^n}{\sqrt{5}}\)

Puzzles said:
To the follow up question, I get the same result... :( My gut tells me I'm just solving it wrong, as usual. The roots are 1/2 + 1/2sqrt(5) and 1/2 - 1/2sqrt(5) this time. Considering that a1 = 1 and a2 = 2 in this case, I get the same result... I'm sorry for being useless. My problem is I haven't solved nearly enough examples to actually know what I'm doing, which is due to the fact that education over here sucks.

For this, I would observe that we previously found:

\(\displaystyle F_n=2^{-n}a_n\)

Using our closed form for $a$, we obtain:

\(\displaystyle F_n=2^{-n}\left(\frac{\left(1+\sqrt{5}\right)^n-\left(1-\sqrt{5}\right)^n}{\sqrt{5}}\right)=\frac{\left(\dfrac{1+\sqrt{5}}{2}\right)^n-\left(\dfrac{1-\sqrt{5}}{2}\right)^n}{\sqrt{5}}\)

A special number in mathematics is called the golden ratio, and is given as:

\(\displaystyle \varphi=\frac{1+\sqrt{5}}{2}\)

Now, it can algebraically be shown that:

\(\displaystyle \frac{1-\sqrt{5}}{2}=-\varphi^{-1}\)

And so we can state the closed form for the Fibonacci sequence in terms of $\varphi$ as follows:

\(\displaystyle F_n=\frac{\varphi^n-(-\varphi)^{-n}}{2\varphi-1}\)

And thus, we can express our sequence in terms of $\varphi$ as:

\(\displaystyle a_n=\frac{(2\varphi)^n-\left(-\dfrac{\varphi}{2}\right)^{-n}}{2\varphi-1}\)
 

FAQ: Solve Recurrence Equation for Domino Chart of 1xn

What is a recurrence equation?

A recurrence equation is a mathematical formula that describes the relationship between a sequence of numbers or values. It is often used to model processes that involve repeated steps or patterns.

How is a recurrence equation used to solve a domino chart of 1xn?

A domino chart of 1xn is a visual representation of a sequence of numbers where each number is represented by a domino tile. To solve it using a recurrence equation, we can use the equation to find the value of the nth tile by using the values of the previous tiles.

What is the base case in a recurrence equation?

The base case in a recurrence equation is the starting point or initial condition of the sequence. It is necessary to have a base case in order to define the values of the following terms in the sequence.

Can a recurrence equation have multiple solutions?

Yes, a recurrence equation can have multiple solutions. This often happens when there are multiple possible patterns or sets of rules that can generate the same sequence of numbers.

How can I check if my solution to a recurrence equation is correct?

The best way to check the correctness of a solution to a recurrence equation is to plug in the values for the base case and see if it generates the correct sequence of numbers. You can also try plugging in different values for the variables to see if the equation still holds true.

Similar threads

Back
Top