I understand that it is possible to analyse code and manually calculate the time complexity of an algorithm by hand and then determine the Big O notation. However I am curious if an algorithm exists to automatically compute this problem.
I wonder whether there is any automatic way of determining (at least roughly) the Big-O time complexity of a given function?  If I graphed an O(n) function vs. an O(n lg n) function I think I would be able to visually ascertain which is which; I'm thinking there must be some heuristic solution which enables this to be done automatically.  Any ideas?  Edit: I am happy to find a semi-automated solution, just wondering whether there is some way of avoiding doing a fully manual analysis.
Can you partition an infinite set, into an infinite number of infinite sets? I have a bunch of magnets (one of those game-board thingies) given to me when I was a school-going lad over 20 years ago, and the magnets feel just as strong as it was the day it was given.   As a corollary to this question , is there a way to determine how long a permanent magnet will remain a magnet?   Addendum: Would two magnets remain a magnet for a shorter duration if they were glued in close proximity with like poles facing each other? In bash, read after a pipe is not setting values Is voltage the speed of electrons? Why does the loss/accuracy fluctuate during the training? (Keras, LSTM) antonym for beneficiary Is there an antonym for beneficiary that is not simply "giver" or "payer"? I'm looking for a word that roughly mean someone who loses financially in the case of an event. Inverse of a Positive Definite Let K be nonsingular symmetric matrix, prove that if K is a positive   definite so is $K^{-1}$ .   My attempt:  I have that $K = K^T$ so $x^TKx = x^TK^Tx = (xK)^Tx = (xIK)^Tx$ and then I don't know what to do next. How to backup an Android device? Can anyone recommend a good way to backup Android devices? Ideally I would like to do this wirelessly and, not only backup my data, but also my user settings. Is it possible to backup an image of an Android device - so that one doesn't even need to reinstall apps? It would be particularly useful to hear from users that have restored backups, as to how easy, and complete, their processes were. Thanks Expectation of momentum in the bound state Is it logically correct to assert that the expectation of the momentum $$\langle \hat p \rangle=0$$ for any bound state because it is bound to some finite region? What is the physical interpretation of the fact that $$\langle \hat p \rangle=0$$ in an energy eigenstate $\psi_n(x,t)$  but $$\langle \hat p \rangle\neq0$$ in some superposition state $$\psi(x,t)=c_m\psi_m(x,t)+c_n\psi_n(x,t)~?$$ Here $\psi_n(x,t)$ the eigenstates of the Hamiltonian, for example, in the problem of particle in a box (say). Remove specific duplicates (all but latest) When removing duplicate rows, using the below query from  tutorial, how would I go about forcing which of the found duplicates to remove?  DELETE FROM dbo.ATTENDANCE      WHERE AUTOID NOT IN (SELECT MIN(AUTOID) _ FROM dbo.ATTENDANCE      GROUP BY EMPLOYEE_ID,ATTENDANCE_DATE)    And this works great. The reason why I am using this one is because the only unique id available is one in the IDENTITY column. And to determine if there are duplicate rows I have to look at a combination of multiple columns.    But if I have a set of duplicate rows how do I / how does SQL Server decide which to remove? And how would I force it to remove all but the one with the highest IDENTITY value?  EMPLOYEE_ID     ATTENDANCE_DATE     AUTOID A001            2011-01-01          1 A001            2011-01-01          2   If I would run the query now it happens to remove the second one, with AUTOID 2. But I am trying to remove all but this one (because this is the one latest added). grub2 wont load Ubuntu on dual boot Having an issue with a dual boot setup that is being run from Windows boot manager. I can successfully load into grub2 from Windows boot manager, however it seems that grub2 cannot locate to the Kernel or something, as it is dropping me right into a shell with the following output:  [ Minimal BASH-like line editing is suported. For the First word, TAB list the posible command completion. Anywhere else tab list the posible completions of a device/filename,]  grub&gt;   I have used Easybcd in the past and successfully loaded a Linux grub through Windows bootloader, but this was when both operating systems were on the same partition, but since my OS installationd are now on separate partitions it seems EasyBcd cant work its magic.   ONe encouragement is that I was able to get Easybcd to load a working Grub if I used the Neo grub bootloader and edit the confg with:  title Ubuntu 14.04 find --set-root /boot/vmlinuz-3.19.0-61-generic kernel /boot/vmlinuz-3.19.0-61-generic ro root=/dev/sdc initrd /boot/initrd.img-3.19.0-61-generic   however this loads in Grub4DOS which is very slow, and as of today this method stopped working See  for details).  Here is the output of EasyBcd Settings for all the different methods I have tried for the Ubuntu 14.04 installation:  Default: Windows 7 Timeout: 30 seconds Boot Drive: C:\  Entry #1 Name: Windows 7 BCD ID: {current} Drive: C:\ Bootloader Path: \Windows\system32\winload.exe  Entry #2 Name: Ubuntu 14.04 Legacy BCD ID: {a4f127cf-3150-11e6-8aaf-408d5cb9e442} Drive: C:\ Bootloader Path: \NST\nst_linux.mbr  Entry #3 Name: Ubuntu 14.04 Grub2 BCD ID: {a4f127d0-3150-11e6-8aaf-408d5cb9e442} Drive: C:\ Bootloader Path: \NST\AutoNeoGrub0.mbr  Entry #4 Name: Ubuntu Neo Grub BCD ID: {a4f127d1-3150-11e6-8aaf-408d5cb9e442} Drive: C:\ Bootloader Path: \NST\NeoGrub.mbr   *It seems that none of the paths seen above are pointing to my dev/sdc2/ partition which would be considered DISK1 on my Windows Volume manager.     EDIT - In the confusion of attempting to get a working bootmanager for Ubuntu/Windows, you will see that grub and Windows Boot manager have all been installed in numerous locations. Below are the present locations and contents of all bootmanager &amp; Grub installations:  dev/sdb Windows7 drive  /dev/sdb1 - 512 MB fat32 partition which is currently empty  /dev/sdb2 - 110 GB ntfs partition containing Windows7 installation. This partition contains a 'Boot' folder which contains BCD files and a whole wack of langauage folders. THIS IS The FOLDER THAT WINDOWS BOOTLOADER uses.  /dev/sdb4 - 121.53 ntfs partition containing storage for media    dev/sdd - Ubuntu Drive  dev/sdd1 - 512 MB partition containing a 'EFI' folder, inside of which are two folders 'grub' and 'Ubuntu', both of which contain the exact same files (grub.cfg, grubx64.efi, MokManager.efi, shium64.efi)  dev/sdd2 - 48.83 GB ext4 partition that contains the '/' folder and Ubuntu instalation.   dev/sdd3 - 69.91 GB ntfs partition containing storage for media  what do I need to do so that the Grub shell I am being dropped into will load up Ubuntu? HOw can I get this machine to dual boot out of Grub? How can tangential acceleration from a radial force be explained? Is there any intuition or meaning regarding Cauchy-Riemann equations? Holomorphic functions are one of the most beautiful objects in mathematics. However, Cauchy-Riemann equations are a little bit of a mystery for me. What does that mean intuitively when a function satisfyes those equations? What is the accepted/most commonly used way to manipulate dynamic (with all dimensions not known until runtime) multi-dimensional arrays in C and/or C++.  I'm trying to find the cleanest way to accomplish what this Java code does:  public static void main(String[] args){  Scanner sc=new Scanner(System.in);  int rows=sc.nextInt();  int cols=sc.nextInt();  int[][] data=new int[rows][cols];  manipulate(data); }  public static void manipulate(int[][] data){    for(int i=0;i&lt;data.length;i++)    for(int j=0;j&lt;data[0].length.j++){          System.out.print(data[i][j]);           }     }   (reads from std_in just to clarify that dimensions aren't known until runtime).  Edit:I noticed that this question is pretty popular even though it's pretty old.  I don't actually agree with the top voted answer.   I think the best choice for C is to use a single-dimensional array as Guge said below "You can alloc rowscolssizeof(int) and access it by table[row*cols+col].".  There is a number of choices with C++, if you really like boost or stl then the answers below might be preferable, but the simplest and probably fastest choice is to use a single dimensional array as in C.  Another viable choice in C and C++ if you want the [][] syntax is lillq's answer down at the bottom is manually building the array with lots of malloc's. Why there isn't any integer solutions in non-zero integers for $z^3 = 3(x^3 +y^3+2xyz)$? Consider the following Diophantine equation  $$z^3 = 3(x^3 +y^3+2xyz)$$  Is there any elementary proof for the non-solubility in non-zero integers for this  Diophantine equation, where the absolute value of $x, y$ and $z$ are pairwise coprime integers?  I have proved the impossibility of solution of this Diophantine equation in non-zero integers, but that took quite a few pages and I consider this too long. I hope for a much more elementary and shorter proof for this puzzle.  Hint: It should be noted that is also true for the non-availability of the similar form (replacing coefficient 3 by 1) as the following:   $$z^3=x^3+y^3+2xyz,$$ but this case is very simple to prove, where $x, y\;\&amp;\; z$ are nonzero integers. Union of the conjugates of a proper subgroup Let G be a finite group and H be a proper subgroup. Prove that the union of the conjugates of H is not the whole of G.  Thanks for any help What does "\" mean in math Types of polynomial functions. Quadratic, cubic, quartic, quintic, ...,? I would very much like to have a complete list of the types of polynomial functions. I know that theres:  Quadratic :                      (AX^2 + BX + C) Cubic     :               (AX^3 + BX^2 + CX + D) Quartic   :        (AX^4 + BX^3 + CX^2 + DX + E) Quintic   : (AX^5 + BX^4 + CX^3 + DX^2 + EX + F)   What are the names of polynomial functions to the further powers? Sexstic? Septic? Octic? I'm not sure, so if someone could enlighten me, then that would be great. Please provide a list that goes at least to the seventh power, but it would be nice if you could go further. Thanks. Why is there something instead of nothing? A simple but fundamental question.    The "something" means the whole Universe (known and unknown), it could be represented as the reality version of the set of all sets, which is itself . It includes all the  and such.  A better version of the whole Universe could be described with a .  The "nothing" means an absence of the whole Universe, not a particular void or emptiness in the whole Universe but a nonexistent whole Universe. I remember reading this as a kid and it starts out with:   a boy in his home village where the other kids are mean to him during sports and they heat up their home with floating logs or something.   The kid is being hunted by some reaper character and that reaper finds him at a place called "The Edge" or something similar.   He buys a glove covered in an expensive dust that purifies things and is really rare.  In one book they had to climb down the edge for some reason.  There was another part where people only communicated telepathically and when sneaking into somewhere he only thought of light.  One of the main things is the floating ships and how he is really good at flying them and he assembles a team for a mission or something.  There is like float powder and stuff.  I read this close to 10 years ago.