Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. order of algorithm

order of algorithm

Scheduled Pinned Locked Moved Algorithms
algorithmshelpquestion
20 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    khomeyni
    wrote on last edited by
    #1

    in the name of god hello how can we solve this problem to find the order of it: T(n)=sqrt(n)*(T(sqrt(n))+n order =? valhamdolelah.

    L R 2 Replies Last reply
    0
    • K khomeyni

      in the name of god hello how can we solve this problem to find the order of it: T(n)=sqrt(n)*(T(sqrt(n))+n order =? valhamdolelah.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      There is no base case, what is T(1) ?

      K 1 Reply Last reply
      0
      • L Lost User

        There is no base case, what is T(1) ?

        K Offline
        K Offline
        khomeyni
        wrote on last edited by
        #3

        take a constant as C>0 valhamdolelah.

        L 1 Reply Last reply
        0
        • K khomeyni

          take a constant as C>0 valhamdolelah.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Ok then I think: T(n) = (n * C)/(e^2) + (n * ln(ln(n))) / ln(2) edit: that would be O(n log(log n)) I think

          K 1 Reply Last reply
          0
          • L Lost User

            Ok then I think: T(n) = (n * C)/(e^2) + (n * ln(ln(n))) / ln(2) edit: that would be O(n log(log n)) I think

            K Offline
            K Offline
            khomeyni
            wrote on last edited by
            #5

            thanks please say the way?how we can gain to this? valhamdolelah.

            L 1 Reply Last reply
            0
            • K khomeyni

              thanks please say the way?how we can gain to this? valhamdolelah.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              What do you mean?

              K 1 Reply Last reply
              0
              • L Lost User

                What do you mean?

                K Offline
                K Offline
                khomeyni
                wrote on last edited by
                #7

                solution =? how do you solve it? valhamdolelah.

                L 1 Reply Last reply
                0
                • K khomeyni

                  solution =? how do you solve it? valhamdolelah.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Well I cheated and put it on wolfram alpha, this wasn't an exam so :)

                  K 1 Reply Last reply
                  0
                  • L Lost User

                    Well I cheated and put it on wolfram alpha, this wasn't an exam so :)

                    K Offline
                    K Offline
                    khomeyni
                    wrote on last edited by
                    #9

                    thanks but i want to know how to solve this problems. valhamdolelah.

                    L 1 Reply Last reply
                    0
                    • K khomeyni

                      thanks but i want to know how to solve this problems. valhamdolelah.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      I don't know what you mean

                      R 1 Reply Last reply
                      0
                      • L Lost User

                        I don't know what you mean

                        R Offline
                        R Offline
                        RichardM1
                        wrote on last edited by
                        #11

                        In the end, he does want the answer, but he is more interested in how you come up with the answer - the way to solve it. In effect, he does not want you to do his homework for him, he wants to know HOW to do his homework. That is unusual for this kind of question, and I think he deserves kudos! Unfortunately, I don't know how to solve it.

                        Silver member by constant and unflinching longevity.

                        1 Reply Last reply
                        0
                        • K khomeyni

                          in the name of god hello how can we solve this problem to find the order of it: T(n)=sqrt(n)*(T(sqrt(n))+n order =? valhamdolelah.

                          R Offline
                          R Offline
                          RichardM1
                          wrote on last edited by
                          #12

                          Thank you for wanting to know HOW, not just wanting the answer. . Are you solving for the computational order of an algorithm that takes this long to process (the Big O notation), or are you looking for a numerical order of magnitude for the result of applying this equation to an arbitrary value 'n' ( eg. T(2) = sqrt(2)+T(sqrt(2))+2)? . T(n)=sqrt(n)*(T(sqrt(n))+n . The Big O would be O(n). the two terms are added together, so each term can be taken by itself. sqrt(n) * T(sqrt(n))becomes 'n' in the limit, so you have two O(n) terms, which is the same as O(n). . If you are looking for numerics, I can't really help you.

                          Silver member by constant and unflinching longevity.

                          K L R 3 Replies Last reply
                          0
                          • R RichardM1

                            Thank you for wanting to know HOW, not just wanting the answer. . Are you solving for the computational order of an algorithm that takes this long to process (the Big O notation), or are you looking for a numerical order of magnitude for the result of applying this equation to an arbitrary value 'n' ( eg. T(2) = sqrt(2)+T(sqrt(2))+2)? . T(n)=sqrt(n)*(T(sqrt(n))+n . The Big O would be O(n). the two terms are added together, so each term can be taken by itself. sqrt(n) * T(sqrt(n))becomes 'n' in the limit, so you have two O(n) terms, which is the same as O(n). . If you are looking for numerics, I can't really help you.

                            Silver member by constant and unflinching longevity.

                            K Offline
                            K Offline
                            khomeyni
                            wrote on last edited by
                            #13

                            thanks very much for your attention i want to know the computational order of it as you said : sqrt(n) * T(sqrt(n))becomes 'n' in the limit, so you have two O(n) terms, which is the same as O(n). but why in limit it becomes n?,please explain more. also i think finding it as numerical would be interesting but i think this would be hard!!! thanks.

                            R 1 Reply Last reply
                            0
                            • R RichardM1

                              Thank you for wanting to know HOW, not just wanting the answer. . Are you solving for the computational order of an algorithm that takes this long to process (the Big O notation), or are you looking for a numerical order of magnitude for the result of applying this equation to an arbitrary value 'n' ( eg. T(2) = sqrt(2)+T(sqrt(2))+2)? . T(n)=sqrt(n)*(T(sqrt(n))+n . The Big O would be O(n). the two terms are added together, so each term can be taken by itself. sqrt(n) * T(sqrt(n))becomes 'n' in the limit, so you have two O(n) terms, which is the same as O(n). . If you are looking for numerics, I can't really help you.

                              Silver member by constant and unflinching longevity.

                              L Offline
                              L Offline
                              Lost User
                              wrote on last edited by
                              #14

                              I have to disagree. The two terms are not O(n) at all, one of them is O(n^0.5) which is asymptotically different from O(n), and the other is unknown until the recursion is solved.

                              R 1 Reply Last reply
                              0
                              • R RichardM1

                                Thank you for wanting to know HOW, not just wanting the answer. . Are you solving for the computational order of an algorithm that takes this long to process (the Big O notation), or are you looking for a numerical order of magnitude for the result of applying this equation to an arbitrary value 'n' ( eg. T(2) = sqrt(2)+T(sqrt(2))+2)? . T(n)=sqrt(n)*(T(sqrt(n))+n . The Big O would be O(n). the two terms are added together, so each term can be taken by itself. sqrt(n) * T(sqrt(n))becomes 'n' in the limit, so you have two O(n) terms, which is the same as O(n). . If you are looking for numerics, I can't really help you.

                                Silver member by constant and unflinching longevity.

                                R Offline
                                R Offline
                                RichardM1
                                wrote on last edited by
                                #15

                                I'm answering both of you, so I am just tacking it on to the end. The problem in what I wrote was with the T(sqrt(n)) part of the function. The answer hinges on what F(n) = sqrt(n)*F(sqrt(n)) is. I was thinking it approached (n), but I see I was wrong, it may approach(n^1.5), which would mean it dominated. When you add in the (+ n), with an infinite recursion, I see that this goes to infinity, even for n = 1. As a matter of fact, I will kick my own but on this and say that, while I don't know which order of infinity this ends up being, but, since there is no stop condition on the recursion, the answer, even for n=1 is infinity, given this analysis: T(1) = 1*T(1)+1 which shows that you end up adding 1 at each recursion level, with an infinite number of recursions (no stop condition). And it just gets larger from there. khomeyni - sorry for my flawed analysis, thank you for asking why. harold aptroot - is that a better analysis? I'm asking, not being snide.

                                Silver member by constant and unflinching longevity.

                                L K 2 Replies Last reply
                                0
                                • L Lost User

                                  I have to disagree. The two terms are not O(n) at all, one of them is O(n^0.5) which is asymptotically different from O(n), and the other is unknown until the recursion is solved.

                                  R Offline
                                  R Offline
                                  RichardM1
                                  wrote on last edited by
                                  #16

                                  response below your entry

                                  Silver member by constant and unflinching longevity.

                                  1 Reply Last reply
                                  0
                                  • K khomeyni

                                    thanks very much for your attention i want to know the computational order of it as you said : sqrt(n) * T(sqrt(n))becomes 'n' in the limit, so you have two O(n) terms, which is the same as O(n). but why in limit it becomes n?,please explain more. also i think finding it as numerical would be interesting but i think this would be hard!!! thanks.

                                    R Offline
                                    R Offline
                                    RichardM1
                                    wrote on last edited by
                                    #17

                                    response below

                                    Silver member by constant and unflinching longevity.

                                    1 Reply Last reply
                                    0
                                    • R RichardM1

                                      I'm answering both of you, so I am just tacking it on to the end. The problem in what I wrote was with the T(sqrt(n)) part of the function. The answer hinges on what F(n) = sqrt(n)*F(sqrt(n)) is. I was thinking it approached (n), but I see I was wrong, it may approach(n^1.5), which would mean it dominated. When you add in the (+ n), with an infinite recursion, I see that this goes to infinity, even for n = 1. As a matter of fact, I will kick my own but on this and say that, while I don't know which order of infinity this ends up being, but, since there is no stop condition on the recursion, the answer, even for n=1 is infinity, given this analysis: T(1) = 1*T(1)+1 which shows that you end up adding 1 at each recursion level, with an infinite number of recursions (no stop condition). And it just gets larger from there. khomeyni - sorry for my flawed analysis, thank you for asking why. harold aptroot - is that a better analysis? I'm asking, not being snide.

                                      Silver member by constant and unflinching longevity.

                                      L Offline
                                      L Offline
                                      Lost User
                                      wrote on last edited by
                                      #18

                                      Yes this is better, this is why I asked him what T(1) was, and he said "take a constant as C>0", which significantly changes the result

                                      1 Reply Last reply
                                      0
                                      • R RichardM1

                                        I'm answering both of you, so I am just tacking it on to the end. The problem in what I wrote was with the T(sqrt(n)) part of the function. The answer hinges on what F(n) = sqrt(n)*F(sqrt(n)) is. I was thinking it approached (n), but I see I was wrong, it may approach(n^1.5), which would mean it dominated. When you add in the (+ n), with an infinite recursion, I see that this goes to infinity, even for n = 1. As a matter of fact, I will kick my own but on this and say that, while I don't know which order of infinity this ends up being, but, since there is no stop condition on the recursion, the answer, even for n=1 is infinity, given this analysis: T(1) = 1*T(1)+1 which shows that you end up adding 1 at each recursion level, with an infinite number of recursions (no stop condition). And it just gets larger from there. khomeyni - sorry for my flawed analysis, thank you for asking why. harold aptroot - is that a better analysis? I'm asking, not being snide.

                                        Silver member by constant and unflinching longevity.

                                        K Offline
                                        K Offline
                                        khomeyni
                                        wrote on last edited by
                                        #19

                                        thanks for your getting involved in it i say that we must take T(1) a constant as c so the stop condition is T(1),but i dont know how either you or harold aptroot solved this? you said that it would be n^1.5 how you find it? please explain more on the solution not only the final answer.if we only find a order it is enough. thanks. valhamdolelah.

                                        R 1 Reply Last reply
                                        0
                                        • K khomeyni

                                          thanks for your getting involved in it i say that we must take T(1) a constant as c so the stop condition is T(1),but i dont know how either you or harold aptroot solved this? you said that it would be n^1.5 how you find it? please explain more on the solution not only the final answer.if we only find a order it is enough. thanks. valhamdolelah.

                                          R Offline
                                          R Offline
                                          RichardM1
                                          wrote on last edited by
                                          #20

                                          khomeyni wrote:

                                          you said that it would be n^1.5 how you find it?

                                          I said that about t(n) = sqrt(n)+T(sqrt(n)),but waswrong on the overall analysis at that point. Than I went on to do the actual form t(n)=sqrt(n)+t(sqrt(n))+n and said it was infinite, though I don't know what order. Even if you remove the sqrt(n)part, t(n)=t(sqrt(n))+n, but assume t(1) is a stop condition,if you try t(n >1), sqrt(sqrt(sqrt(...(n)))) approaches, but never reaches 1, so you have and infinite series of summing for x = 1 to infinity of n^(1/x). Sums an infinite progression of numbers > 1.

                                          Silver member by constant and unflinching longevity.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups