Recurrence k-th pattern











up vote
2
down vote

favorite












I am trying to solve this recurrence $T(n) = 6 T(frac{n}{3}) + n$.



1st recurrence: $6^2T(frac{n}{3^2}) + frac{6n}{3} + n$



2nd: $6^3T(frac{n}{3^3}) + frac{6^3n}{3^2} + n$



3rd: $6^4T(frac{n}{3^4}) + frac{6^6n}{3^3} + n$



I am having trouble describing the general pattern after the k-th iteration.










share|cite|improve this question
























  • Please define $n$, the range it covers, what is $n/3$ for instance if $n$ is integer (but not divisible by three), and what is the k in the title / in the k-th iteration? Do we need to get a formula for $T(n)$ in terms of $T(n/3^k)$ (or in terms of $T(n/3^{k+1})$?
    – dan_fulea
    Nov 24 at 0:46










  • Assume base case T(1) = 1. We need to get the general pattern for T(n) after the k-th iteration, for example T(n) = 6^k T(n/3^k) + ...
    – aryamank
    Nov 24 at 0:59















up vote
2
down vote

favorite












I am trying to solve this recurrence $T(n) = 6 T(frac{n}{3}) + n$.



1st recurrence: $6^2T(frac{n}{3^2}) + frac{6n}{3} + n$



2nd: $6^3T(frac{n}{3^3}) + frac{6^3n}{3^2} + n$



3rd: $6^4T(frac{n}{3^4}) + frac{6^6n}{3^3} + n$



I am having trouble describing the general pattern after the k-th iteration.










share|cite|improve this question
























  • Please define $n$, the range it covers, what is $n/3$ for instance if $n$ is integer (but not divisible by three), and what is the k in the title / in the k-th iteration? Do we need to get a formula for $T(n)$ in terms of $T(n/3^k)$ (or in terms of $T(n/3^{k+1})$?
    – dan_fulea
    Nov 24 at 0:46










  • Assume base case T(1) = 1. We need to get the general pattern for T(n) after the k-th iteration, for example T(n) = 6^k T(n/3^k) + ...
    – aryamank
    Nov 24 at 0:59













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I am trying to solve this recurrence $T(n) = 6 T(frac{n}{3}) + n$.



1st recurrence: $6^2T(frac{n}{3^2}) + frac{6n}{3} + n$



2nd: $6^3T(frac{n}{3^3}) + frac{6^3n}{3^2} + n$



3rd: $6^4T(frac{n}{3^4}) + frac{6^6n}{3^3} + n$



I am having trouble describing the general pattern after the k-th iteration.










share|cite|improve this question















I am trying to solve this recurrence $T(n) = 6 T(frac{n}{3}) + n$.



1st recurrence: $6^2T(frac{n}{3^2}) + frac{6n}{3} + n$



2nd: $6^3T(frac{n}{3^3}) + frac{6^3n}{3^2} + n$



3rd: $6^4T(frac{n}{3^4}) + frac{6^6n}{3^3} + n$



I am having trouble describing the general pattern after the k-th iteration.







recurrence-relations






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Nov 24 at 0:16

























asked Nov 24 at 0:08









aryamank

445




445












  • Please define $n$, the range it covers, what is $n/3$ for instance if $n$ is integer (but not divisible by three), and what is the k in the title / in the k-th iteration? Do we need to get a formula for $T(n)$ in terms of $T(n/3^k)$ (or in terms of $T(n/3^{k+1})$?
    – dan_fulea
    Nov 24 at 0:46










  • Assume base case T(1) = 1. We need to get the general pattern for T(n) after the k-th iteration, for example T(n) = 6^k T(n/3^k) + ...
    – aryamank
    Nov 24 at 0:59


















  • Please define $n$, the range it covers, what is $n/3$ for instance if $n$ is integer (but not divisible by three), and what is the k in the title / in the k-th iteration? Do we need to get a formula for $T(n)$ in terms of $T(n/3^k)$ (or in terms of $T(n/3^{k+1})$?
    – dan_fulea
    Nov 24 at 0:46










  • Assume base case T(1) = 1. We need to get the general pattern for T(n) after the k-th iteration, for example T(n) = 6^k T(n/3^k) + ...
    – aryamank
    Nov 24 at 0:59
















Please define $n$, the range it covers, what is $n/3$ for instance if $n$ is integer (but not divisible by three), and what is the k in the title / in the k-th iteration? Do we need to get a formula for $T(n)$ in terms of $T(n/3^k)$ (or in terms of $T(n/3^{k+1})$?
– dan_fulea
Nov 24 at 0:46




Please define $n$, the range it covers, what is $n/3$ for instance if $n$ is integer (but not divisible by three), and what is the k in the title / in the k-th iteration? Do we need to get a formula for $T(n)$ in terms of $T(n/3^k)$ (or in terms of $T(n/3^{k+1})$?
– dan_fulea
Nov 24 at 0:46












Assume base case T(1) = 1. We need to get the general pattern for T(n) after the k-th iteration, for example T(n) = 6^k T(n/3^k) + ...
– aryamank
Nov 24 at 0:59




Assume base case T(1) = 1. We need to get the general pattern for T(n) after the k-th iteration, for example T(n) = 6^k T(n/3^k) + ...
– aryamank
Nov 24 at 0:59










2 Answers
2






active

oldest

votes

















up vote
3
down vote













I assume you are looking to find $T(n)$ after K iterations. First
$$ T(n) = 6 T(n/3) + n$$ then rewriting $T(n/3)$ in terms of $T(n/3^2)$ we conclude:
$$
T(n) = 6^2 T(n/3^2) + 6n/3 +n
$$

similarly $T(n)$ after K iterations becomes:
$$
T(n) = 6^K T(n/ 3^K) + sum_{i=1} ^K 6^{i-1}n/3^{i-1}
$$

or
$$
T(n) = 6^K T(n/ 3^K) + (2^{K}-1)n
$$






share|cite|improve this answer





















  • If you rewrite T(n/3^2) in terms of T(n/3^3), then wouldn't it be: T(n) = 6^3T(n/3^3) + 37n
    – aryamank
    Nov 24 at 4:44












  • It would be $6^2 (6T(n/3^3) + n/3^2) + 6n/3 + n = 6^3T(n/3^3) + 7n$
    – user609189
    Nov 24 at 7:09




















up vote
0
down vote













If you are trying to solve the recurrence, try finding the initial pattern and the number of terms - this will help solve the equation in most of the cases.



In the first step, we have $n$ work to do, we do $n$ work and have 6 problems of the same type but of size $frac{n}{3}$ this time.



In the second step, we have $frac{n}{3}$ work to do, we do $frac{n}{3}$ work and have 6 problems of the same type but of size $frac{n}{9}$ this time. We have 6 problems of this type.



In the third step, we have $frac{n}{9}$ work to do, we do $frac{n}{9}$ work and have 6 problems of the same type but of size $frac{n}{27}$ this time. We have 6 problems of this type.



This gives the equation,



$T(n) = n + 6(frac{n}{3}) + 36 (frac{n}{9}) + 216(frac{n}{27}) + ... + $



$T(n) = n + 2n + 4n + 8n + ... $



You will have $log_{3}n$ such terms, as you are cutting down the problem size by a factor of three all the time. This is a sum of a geometric series, given the number of terms and common ratio, it is easy to sum.



$T(n) = n + 2n + 4n + 8n + ... + 2^{log_{3}n}n $



Kth term will be of the form $2^{k}n$.



The solution should be $Theta(n^{log_{3}6})$.






share|cite|improve this answer























  • You did not remember to specify the initial condition (it is not very important though).
    – rranjik
    Nov 24 at 0:47










  • I'm trying to get the k-th form for the entire equation i.e. T(n) = 6^k T(n/3^k) + ...
    – aryamank
    Nov 24 at 0:58










  • Sorry, but your question reads "I am trying to solve this recurrence...".
    – rranjik
    Nov 24 at 1:07











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3011002%2frecurrence-k-th-pattern%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote













I assume you are looking to find $T(n)$ after K iterations. First
$$ T(n) = 6 T(n/3) + n$$ then rewriting $T(n/3)$ in terms of $T(n/3^2)$ we conclude:
$$
T(n) = 6^2 T(n/3^2) + 6n/3 +n
$$

similarly $T(n)$ after K iterations becomes:
$$
T(n) = 6^K T(n/ 3^K) + sum_{i=1} ^K 6^{i-1}n/3^{i-1}
$$

or
$$
T(n) = 6^K T(n/ 3^K) + (2^{K}-1)n
$$






share|cite|improve this answer





















  • If you rewrite T(n/3^2) in terms of T(n/3^3), then wouldn't it be: T(n) = 6^3T(n/3^3) + 37n
    – aryamank
    Nov 24 at 4:44












  • It would be $6^2 (6T(n/3^3) + n/3^2) + 6n/3 + n = 6^3T(n/3^3) + 7n$
    – user609189
    Nov 24 at 7:09

















up vote
3
down vote













I assume you are looking to find $T(n)$ after K iterations. First
$$ T(n) = 6 T(n/3) + n$$ then rewriting $T(n/3)$ in terms of $T(n/3^2)$ we conclude:
$$
T(n) = 6^2 T(n/3^2) + 6n/3 +n
$$

similarly $T(n)$ after K iterations becomes:
$$
T(n) = 6^K T(n/ 3^K) + sum_{i=1} ^K 6^{i-1}n/3^{i-1}
$$

or
$$
T(n) = 6^K T(n/ 3^K) + (2^{K}-1)n
$$






share|cite|improve this answer





















  • If you rewrite T(n/3^2) in terms of T(n/3^3), then wouldn't it be: T(n) = 6^3T(n/3^3) + 37n
    – aryamank
    Nov 24 at 4:44












  • It would be $6^2 (6T(n/3^3) + n/3^2) + 6n/3 + n = 6^3T(n/3^3) + 7n$
    – user609189
    Nov 24 at 7:09















up vote
3
down vote










up vote
3
down vote









I assume you are looking to find $T(n)$ after K iterations. First
$$ T(n) = 6 T(n/3) + n$$ then rewriting $T(n/3)$ in terms of $T(n/3^2)$ we conclude:
$$
T(n) = 6^2 T(n/3^2) + 6n/3 +n
$$

similarly $T(n)$ after K iterations becomes:
$$
T(n) = 6^K T(n/ 3^K) + sum_{i=1} ^K 6^{i-1}n/3^{i-1}
$$

or
$$
T(n) = 6^K T(n/ 3^K) + (2^{K}-1)n
$$






share|cite|improve this answer












I assume you are looking to find $T(n)$ after K iterations. First
$$ T(n) = 6 T(n/3) + n$$ then rewriting $T(n/3)$ in terms of $T(n/3^2)$ we conclude:
$$
T(n) = 6^2 T(n/3^2) + 6n/3 +n
$$

similarly $T(n)$ after K iterations becomes:
$$
T(n) = 6^K T(n/ 3^K) + sum_{i=1} ^K 6^{i-1}n/3^{i-1}
$$

or
$$
T(n) = 6^K T(n/ 3^K) + (2^{K}-1)n
$$







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Nov 24 at 1:04









user609189

314




314












  • If you rewrite T(n/3^2) in terms of T(n/3^3), then wouldn't it be: T(n) = 6^3T(n/3^3) + 37n
    – aryamank
    Nov 24 at 4:44












  • It would be $6^2 (6T(n/3^3) + n/3^2) + 6n/3 + n = 6^3T(n/3^3) + 7n$
    – user609189
    Nov 24 at 7:09




















  • If you rewrite T(n/3^2) in terms of T(n/3^3), then wouldn't it be: T(n) = 6^3T(n/3^3) + 37n
    – aryamank
    Nov 24 at 4:44












  • It would be $6^2 (6T(n/3^3) + n/3^2) + 6n/3 + n = 6^3T(n/3^3) + 7n$
    – user609189
    Nov 24 at 7:09


















If you rewrite T(n/3^2) in terms of T(n/3^3), then wouldn't it be: T(n) = 6^3T(n/3^3) + 37n
– aryamank
Nov 24 at 4:44






If you rewrite T(n/3^2) in terms of T(n/3^3), then wouldn't it be: T(n) = 6^3T(n/3^3) + 37n
– aryamank
Nov 24 at 4:44














It would be $6^2 (6T(n/3^3) + n/3^2) + 6n/3 + n = 6^3T(n/3^3) + 7n$
– user609189
Nov 24 at 7:09






It would be $6^2 (6T(n/3^3) + n/3^2) + 6n/3 + n = 6^3T(n/3^3) + 7n$
– user609189
Nov 24 at 7:09












up vote
0
down vote













If you are trying to solve the recurrence, try finding the initial pattern and the number of terms - this will help solve the equation in most of the cases.



In the first step, we have $n$ work to do, we do $n$ work and have 6 problems of the same type but of size $frac{n}{3}$ this time.



In the second step, we have $frac{n}{3}$ work to do, we do $frac{n}{3}$ work and have 6 problems of the same type but of size $frac{n}{9}$ this time. We have 6 problems of this type.



In the third step, we have $frac{n}{9}$ work to do, we do $frac{n}{9}$ work and have 6 problems of the same type but of size $frac{n}{27}$ this time. We have 6 problems of this type.



This gives the equation,



$T(n) = n + 6(frac{n}{3}) + 36 (frac{n}{9}) + 216(frac{n}{27}) + ... + $



$T(n) = n + 2n + 4n + 8n + ... $



You will have $log_{3}n$ such terms, as you are cutting down the problem size by a factor of three all the time. This is a sum of a geometric series, given the number of terms and common ratio, it is easy to sum.



$T(n) = n + 2n + 4n + 8n + ... + 2^{log_{3}n}n $



Kth term will be of the form $2^{k}n$.



The solution should be $Theta(n^{log_{3}6})$.






share|cite|improve this answer























  • You did not remember to specify the initial condition (it is not very important though).
    – rranjik
    Nov 24 at 0:47










  • I'm trying to get the k-th form for the entire equation i.e. T(n) = 6^k T(n/3^k) + ...
    – aryamank
    Nov 24 at 0:58










  • Sorry, but your question reads "I am trying to solve this recurrence...".
    – rranjik
    Nov 24 at 1:07















up vote
0
down vote













If you are trying to solve the recurrence, try finding the initial pattern and the number of terms - this will help solve the equation in most of the cases.



In the first step, we have $n$ work to do, we do $n$ work and have 6 problems of the same type but of size $frac{n}{3}$ this time.



In the second step, we have $frac{n}{3}$ work to do, we do $frac{n}{3}$ work and have 6 problems of the same type but of size $frac{n}{9}$ this time. We have 6 problems of this type.



In the third step, we have $frac{n}{9}$ work to do, we do $frac{n}{9}$ work and have 6 problems of the same type but of size $frac{n}{27}$ this time. We have 6 problems of this type.



This gives the equation,



$T(n) = n + 6(frac{n}{3}) + 36 (frac{n}{9}) + 216(frac{n}{27}) + ... + $



$T(n) = n + 2n + 4n + 8n + ... $



You will have $log_{3}n$ such terms, as you are cutting down the problem size by a factor of three all the time. This is a sum of a geometric series, given the number of terms and common ratio, it is easy to sum.



$T(n) = n + 2n + 4n + 8n + ... + 2^{log_{3}n}n $



Kth term will be of the form $2^{k}n$.



The solution should be $Theta(n^{log_{3}6})$.






share|cite|improve this answer























  • You did not remember to specify the initial condition (it is not very important though).
    – rranjik
    Nov 24 at 0:47










  • I'm trying to get the k-th form for the entire equation i.e. T(n) = 6^k T(n/3^k) + ...
    – aryamank
    Nov 24 at 0:58










  • Sorry, but your question reads "I am trying to solve this recurrence...".
    – rranjik
    Nov 24 at 1:07













up vote
0
down vote










up vote
0
down vote









If you are trying to solve the recurrence, try finding the initial pattern and the number of terms - this will help solve the equation in most of the cases.



In the first step, we have $n$ work to do, we do $n$ work and have 6 problems of the same type but of size $frac{n}{3}$ this time.



In the second step, we have $frac{n}{3}$ work to do, we do $frac{n}{3}$ work and have 6 problems of the same type but of size $frac{n}{9}$ this time. We have 6 problems of this type.



In the third step, we have $frac{n}{9}$ work to do, we do $frac{n}{9}$ work and have 6 problems of the same type but of size $frac{n}{27}$ this time. We have 6 problems of this type.



This gives the equation,



$T(n) = n + 6(frac{n}{3}) + 36 (frac{n}{9}) + 216(frac{n}{27}) + ... + $



$T(n) = n + 2n + 4n + 8n + ... $



You will have $log_{3}n$ such terms, as you are cutting down the problem size by a factor of three all the time. This is a sum of a geometric series, given the number of terms and common ratio, it is easy to sum.



$T(n) = n + 2n + 4n + 8n + ... + 2^{log_{3}n}n $



Kth term will be of the form $2^{k}n$.



The solution should be $Theta(n^{log_{3}6})$.






share|cite|improve this answer














If you are trying to solve the recurrence, try finding the initial pattern and the number of terms - this will help solve the equation in most of the cases.



In the first step, we have $n$ work to do, we do $n$ work and have 6 problems of the same type but of size $frac{n}{3}$ this time.



In the second step, we have $frac{n}{3}$ work to do, we do $frac{n}{3}$ work and have 6 problems of the same type but of size $frac{n}{9}$ this time. We have 6 problems of this type.



In the third step, we have $frac{n}{9}$ work to do, we do $frac{n}{9}$ work and have 6 problems of the same type but of size $frac{n}{27}$ this time. We have 6 problems of this type.



This gives the equation,



$T(n) = n + 6(frac{n}{3}) + 36 (frac{n}{9}) + 216(frac{n}{27}) + ... + $



$T(n) = n + 2n + 4n + 8n + ... $



You will have $log_{3}n$ such terms, as you are cutting down the problem size by a factor of three all the time. This is a sum of a geometric series, given the number of terms and common ratio, it is easy to sum.



$T(n) = n + 2n + 4n + 8n + ... + 2^{log_{3}n}n $



Kth term will be of the form $2^{k}n$.



The solution should be $Theta(n^{log_{3}6})$.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Nov 24 at 0:50

























answered Nov 24 at 0:45









rranjik

407




407












  • You did not remember to specify the initial condition (it is not very important though).
    – rranjik
    Nov 24 at 0:47










  • I'm trying to get the k-th form for the entire equation i.e. T(n) = 6^k T(n/3^k) + ...
    – aryamank
    Nov 24 at 0:58










  • Sorry, but your question reads "I am trying to solve this recurrence...".
    – rranjik
    Nov 24 at 1:07


















  • You did not remember to specify the initial condition (it is not very important though).
    – rranjik
    Nov 24 at 0:47










  • I'm trying to get the k-th form for the entire equation i.e. T(n) = 6^k T(n/3^k) + ...
    – aryamank
    Nov 24 at 0:58










  • Sorry, but your question reads "I am trying to solve this recurrence...".
    – rranjik
    Nov 24 at 1:07
















You did not remember to specify the initial condition (it is not very important though).
– rranjik
Nov 24 at 0:47




You did not remember to specify the initial condition (it is not very important though).
– rranjik
Nov 24 at 0:47












I'm trying to get the k-th form for the entire equation i.e. T(n) = 6^k T(n/3^k) + ...
– aryamank
Nov 24 at 0:58




I'm trying to get the k-th form for the entire equation i.e. T(n) = 6^k T(n/3^k) + ...
– aryamank
Nov 24 at 0:58












Sorry, but your question reads "I am trying to solve this recurrence...".
– rranjik
Nov 24 at 1:07




Sorry, but your question reads "I am trying to solve this recurrence...".
– rranjik
Nov 24 at 1:07


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3011002%2frecurrence-k-th-pattern%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen