I need to find a recurrence relation such that every 2 hours the number of bacteria gets quadrupled and every 4 hours after creation, 3 times as many of the bacteria die. We start with 4 bacteria initially. n = number of hours. So I'm debating between two relations:
$F(n) = F(n-1) + 4F(n-2) - 3F(n-4)$ or $4F(n-2) - 3F(n-4)$
Any advice on which one? My reasoning for the extra F(n+1) is to take into account the number of bacteria last hour.
Both recurrence relations are flawed. Look at the pattern: (assumed that the bacteria quadrupled before they died)
$F(0) = 4$
$F(1) = 4$
$F(2) = 16$
$F(3) = 16$
$F(4) = 16 \times 4 - 3 \times 4 = 52$
The number of bacteria isn't necessarily quadrupled everytime. Instead, it quadrupled when $n$ is a multiple of $2$. Hence, the recurrence relation should look like this:
$F(n)= \begin{cases} F(n-1) & \quad \text{if } n \text{ is odd}\\ 4F(n-2)-3F(n-4) & \quad \text{if } n \text{ is divisible by 4}\\ 4F(n-2) & \quad \text{if } n \text{ is divisible by 2 but not 4}\\ \end{cases}$