Para resolver este tipo de recursiones, siempre es mejor escribir los primeros términos.
Dado, [matemáticas] T (0) = 0 [/ matemáticas]
[matemáticas] T (1) = 1 [/ matemáticas]
[matemáticas] T (2) = 2 ^ {1} \ cdot 1 + 2 ^ {0} \ cdot 2 [/ matemáticas]
- ¿Qué son las matemáticas binarias y cómo se usan?
- Cómo resolver un problema igualando exponentes
- Dado un conjunto, A, de n elementos, ¿de cuántas maneras se pueden elegir x elementos del conjunto A, siempre que pueda elegir el mismo elemento muchas veces?
- Cómo sondear un feed web de manera eficiente
- ¿Cuál es la complejidad temporal de 2T (n-1) -1?
[matemáticas] T (3) = 2 (2 ^ {1} \ cdot 1 + 2 ^ {0} \ cdot 2) + 3 = 2 ^ {2} \ cdot 1 + 2 ^ {1} \ cdot 2 + 2 ^ {0} \ cdot 3 [/ matemáticas]
[matemáticas] T (4) = 2 (2 ^ {2} \ cdot 1 + 2 ^ {1} \ cdot 2 + 2 ^ {0} \ cdot 3) + 4 = 2 ^ {3} \ cdot 1 + 2 ^ {2} \ cdot 2 + 2 ^ {1} \ cdot 3 + 2 ^ {0} \ cdot 4 [/ matemáticas]
[matemáticas] T (5) = 2 (2 ^ {3} \ cdot 1 + 2 ^ {2} \ cdot 2 + 2 ^ {1} \ cdot 3 + 2 ^ {0} \ cdot 4) + 5 = 2 ^ {4} \ cdot 1 + 2 ^ {3} \ cdot 2 + 2 ^ {2} \ cdot 3 + 2 ^ {1} \ cdot 4 + 2 ^ {0} \ cdot 5 [/ matemática]
Claramente, puedes ver un patrón emergente. Para [matemáticas] n = k [/ matemáticas], [matemáticas] T (k) [/ matemáticas] toma la forma,
[matemáticas] T (k) = \ sum_ {i = 1} ^ {k} 2 ^ {ki} i [/ matemáticas]
que se puede probar usando inducción.
La solución de forma cerrada toma la forma,
[matemáticas] T (k) = 2 ^ {k + 1} – 2 – k [/ matemáticas]
que se puede probar tomando la diferencia entre [matemáticas] T (k) [/ matemáticas] y [matemáticas] 2T (k) [/ matemáticas] y luego sumando la serie geométrica resultante.