X-Received: by 2002:ac8:4151:: with SMTP id e17mr4380389qtm.234.1578776450311; Sat, 11 Jan 2020 13:00:50 -0800 (PST) X-Received: by 2002:a25:e00e:: with SMTP id x14mr3945504ybg.412.1578776450016; Sat, 11 Jan 2020 13:00:50 -0800 (PST) Path: csiph.com!tncsrv06.tnetconsulting.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!g89no11101086qtd.0!news-out.google.com!o19ni1566qtr.1!nntp.google.com!g89no11101080qtd.0!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.programming Date: Sat, 11 Jan 2020 13:00:49 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=24.200.162.29; posting-account=R-6XjwoAAACnHXTO3L-lyPW6wRsSmYW9 NNTP-Posting-Host: 24.200.162.29 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0aae99ea-c237-4ac6-b45a-8cbdcbe00a67@googlegroups.com> Subject: I continu about computational complexity by being more and more rigorous, read again From: aminer68@gmail.com Injection-Date: Sat, 11 Jan 2020 21:00:50 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Lines: 262 Xref: csiph.com comp.programming:10494 Hello, I continu about computational complexity by being more and more rigorous, r= ead again: I said previously(read below) that for example a time complexity such as n*(log(n)) and n are fuzzy, because we can say that n*(log(n) is an average resistance(read below to understand the analogy with material re= sistance) or we can say that n*log(n) is faster than if it was a quadratic = complexity or than an exponential complexity, but we can not say giving a t= ime complexity of n or n*log(n) how fast it is giving the input of the n of= the time complexity, so since it is not exact prediction, so it is fuzzy, = but this level of fuzziness, like in the example below of the obese person,= permits us to predict important things in the reality, and this level of f= uzziness of computational complexity is also science, because it is like pr= obability calculations that permits us to predict, since computational comp= lexity can predict the resistance of the algorithm if it is high of low or average (by analogy= with material resistance, read below to understand). Read my previous thoughts to understand: What is science? and is computational complexity science ? You just have seen me talking about computational complexity, but we need to answer the questions of: What is science ? and is computational complexity science ? I think that we have to be more smart because there is like higher level abstractions in science, and we can be in those abstractions exact precisions of science, but we can be more fuzzy precisions that are useful and that are also science, to understand me more= , let me give you an example: If i say that a person is obese, so he has a high risk to get a disease bec= ause he is obese. Now you are understanding more that with this abstraction we are not exact precision, but we are more fuzzy , but this fuzziness is useful and its level of precision is also useful, but is it science ? i think that this probabilistic calculations are also science that permits us to predict that the obese person has a high risk to get a disease. And this probabilistic calculations are like a higher level abstractions that lack exact precision but they are still useful precisions. This is how look like computational complexity and its higher level abstractions, so you are immediately understanding that a time complexity of O(n*log(n)) or a O(n) is like a average level of resistance(read below to know why i am calling i= t resistance by analogy with material resistance) when n grows large, and w= e can immediately notice that an exponential time complexity is a low level resistance when n grows large, and we can immediately notice that a log(n) time complexity is a high level of resistance when n grows large, so those time complexities are like a higher level abst= ractions that are fuzzy but there fuzziness, like in the example above of the obese person, permits us to predict important things in the re= ality, and this level of fuzziness of computational complexity is also science, because it is like probability calculations that permits us to predict. Read the rest of my previous thoughts to understand better: The why of computational complexity.. Here is my previous answer about computational complexity and the rest of my current answer is below: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Horand gassmann wrote: "Where your argument becomes impractical is in the statement "n becomes lar= ge". This is simply not precise enough for practical use. There is a break-= even point, call it n_0, but it cannot be computed from the Big-O alone. An= d even if you can compute n_0, what if it turns out that the breakeven poin= t is larger than a googolplex? That would be interesting theoretically, but= practically --- not so much." I don't agree, because take a look below at how i computed the binary searc= h time complexity, it is a divide and conquer algorithm, and it is log(n), = but we can notice that a log(n) is good when n becomes large, so this infor= mation is practical because a log(n) time complexity is excellent in practi= ce when n becomes large, and when you look at an insertion sort you will no= tice that it is a quadratic time complexity of n^2, here again, you can fee= l that it is practical because an quadratic time complexity is not so good = when n becomes large, so you can say that n^2 is not so good in practice wh= en n becomes large, so as you are noticing having time complexities of log(n) and n^2 are useful in practice, and for the rest of the the time complexities you c= an also benchmark the algorithm in the real world to have an idea at how it= is performing. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I think i am understanding better Lemire and Horand gassmann, they say that if it is not exact needed practical precision, so it is not science or engineering, but i don't agree with this, because science and engineering can be like working with more higher level abstract= ions that are not exact needed practical precision calculations, but they can still be useful precision in practice, it is like being a fuzz= y precision that is useful, this is why i think that probabilistic calculat= ions are also scientific , because probabilistic calculations are useful i= n practice because they can give us important informations on the reality t= hat can also be practical, this is why computational complexity is also use= ful in practice because it is like a higher level abstractions that are not= all the needed practical precision, but it is precision that is still use= ful in practice, this is why like probabilistic calculations i think comput= ational complexity is also science. Read the rest of my previous thoughts to understand better: More on computational complexity.. Notice how Horand gassmann has answered in sci.math newsgroup: Horand gassmann wrote the following: "You are right, of course, on one level. An O(log n) algorithm is better than an O(n) algorithm *for large enough inputs*. Lemire understands that, and he addresses it in his blog. The important consideration is that _theoretical_ performance is a long way from _practical_ performance." And notice how what Lemire wrote about computational complexity: "But it gets worse: these are not scientific models. A scientific model wou= ld predict the running time of the algorithm given some implementation, wit= hin some error margin. However, these models do nothing of the sort. They a= re purely mathematical. They are not falsifiable. As long as they are mathe= matically correct, then they are always true. To be fair, some researchers = like Knuth came up with models that closely mimic reasonable computers, but= that=E2=80=99s not what people pursuing computational complexity bounds do= , typically." So as you are noticing that both of them want to say that computational com= plexity is far from practical, but i don't agree with them, because time complexity is like material resistance, and it informs us on important practical things such as an algorithm of log(n) tim= e complexity is like much more resistant than O(n) when n becomes large, an= d i think this kind of information of time complexity is practical, this is why i don't agree with Lemire and Horand gassmann, because as you notice that time complexity is scientific and it is also engineering. Read the rest of my post to understand more what i want t= o say: More precision about computational complexity, read again: I have just read the following webpage of a PhD Computer Scientist and rese= archer from Montreal, Canada where i am living now from year 1989, here is = the webpage and read it carefully: Better computational complexity does not imply better speed https://lemire.me/blog/2019/11/26/better-computational-complexity-does-not-= imply-better-speed/ And here is his resume: https://lemire.me/pdf/resume/resumelemire.pdf So as you are noticing on the webpage above he is saying the following abou= t computational complexity: "But it gets worse: these are not scientific models. A scientific model wou= ld predict the running time of the algorithm given some implementation, wit= hin some error margin. However, these models do nothing of the sort. They a= re purely mathematical. They are not falsifiable. As long as they are mathe= matically correct, then they are always true. To be fair, some researchers = like Knuth came up with models that closely mimic reasonable computers, but= that=E2=80=99s not what people pursuing computational complexity bounds do= , typically." But i don't agree with him because i think he is not understanding the goal of computational complexity, because when we say that an algorithm has a time complexity of n*log(n), you have to understand that it is by logical analogy like saying in physics what is the= material resistance, because the n*log(n) means how well the algorithm is = "amortizing"(it means reducing) the "time" that it takes taking as a refere= nce of measure the average time complexity of an algorithm, i said that the= time complexity is like the material resistance in physics, because if the= time complexity n grows large, it is in physics like a big force that you = apply to the material that is by logical analogy the algorithm, so if the t= ime complexity is log(n), so it will amortize the time that it takes very w= ell, so it is in physics like the good material resistance that amortizes v= ery well the big force that is applied to it, and we can easily notice that= an algorithm becomes faster, in front of the data that is giving to him, b= y going from an exponential time complexity towards a logarithmic time comp= lexity, so we are noticing that the time complexity is "universal" and it m= easures how well the algorithm amortizes(that means it reduces) the time th= at it takes taking as a reference of measure the average time complexity of= an algorithm, so this is is why computational complexity is scientific and= also it is engineering and it gives us information on the physical world. So to give an interesting example of science in computing, we can ask of wh= at is the time complexity of a binary search algorithm, and here is my mathematical calculations of its time complexity: Recurrence relation of a binary search algorithm is: T(n)=3DT(n/2)+1 Because the "1" is like a comparison that we do in each step of the divide and conquer method of the binary search algorithm. So the calculation of the recurrence equation gives: 1st step=3D> T(n)=3DT(n/2) + 1 2nd step=3D> T(n/2)=3DT(n/4) + 1 =E2=80=A6=E2=80=A6[ T(n/4)=3D T(n/2^2) ] 3rd step=3D> T(n/4)=3DT(n/8) + 1 =E2=80=A6=E2=80=A6[ T(n/8)=3D T(n/2^3) ] . . kth step=3D> T(n/2^k-1)=3DT(n/2^k) + 1*(k times) Adding all the equations we get, T(n) =3D T(n/2^k) + k times 1 This is the final equation. So how many times we need to divide by 2 until we have only one element lef= t? So it must be: n/2^k=3D 1 This gives: n=3D2^k this give: log n=3Dk [taken log(base 2) on both sides ] Put k=3D log n in the final equation above and it gives: T(n) =3D T(1) + log n T(n) =3D 1 + log n [we know that T(1) =3D 1 , because it=E2=80=99s a base c= ondition as we are left with only one element in the array and that is the = element to be searched so we return 1] So it gives: T(n) =3D O(log n) [taking dominant polynomial, which is n here) This is how we got =E2=80=9Clog n=E2=80=9D time complexity for binary searc= h. Thank you, Amine Moulay Ramdane.