I am a bit confused as to how to look for the Big-O of this algorithm.  So far I'm thinking that the while loop wouldn't be O(n) like a normal iteration of an array since x doubles after each for loop. The mergeSort is n log n, and I have no idea how to go about the for loop's time complexity. I don't think its O(n) either, since once again, x doubles.  void algorithm2 (int[] A, int n) {    int x = 1;   while (x &lt; n) {      for (int i = 0; i + x &lt; n; i += 2 * x ) {       mergeSort(A, i , i + x -1, i + 2 * x - 1);     }      x = x * 2;   } }    Any help would be greatly appreciated!
Most people with a degree in CS will certainly know what . It helps us to measure how well an algorithm scales.   But I'm curious, how do you calculate or approximate the complexity of your algorithms?
How do I get the Glare node to output transparent instead of Black background Where can I find information about past versions of iOS and code-signing windows? I have an iPad 2 that is currently running iOS 5.0.1. I'm generally happy with it but some applications require a more recent iOS version. So I started to look into upgrading it, but the only upgrade that it offers is to iOS 7.  From the look of it I don't like the new design of iOS 7 too much and also upgrading to a version this fresh doesn't appeal to me. So my question is: is there a way to upgrade to some version of iOS 5.x or iOS 6.x instead of upgrading to iOS 7? My Granddaughter has lost/forgotten her ID and passwords for her iPad. When the iPad powers on, it goes straight to an iCloud password request and I cannot get past it.  I have installed iTunes on my laptop but it fails to connect to the server (error 310).  I installed iCloud control panel and tried a restore but that failed because of "Find my iPad" was active, which I cannot turn off because of the original password problem!  This is driving me crazy. I just want to reset everything now so that I can hand it back to her. Can anyone help? OSVR has a right-handed system: x is right, y is up, z is near.  I need to convert orientation data from a sensor in OSVR to a different right-handed system in which x is forward, y is left, and z is up.  I need to calculate the transformation that will convert a quaternion from one system to the other.  I naively tried:  void osvrPoseCallback(const geometry_msgs::PoseStampedConstPtr &amp;msg) { // osvr to ros     geometry_msgs::PoseStamped outputMsg;      outputMsg.header = msg-&gt;header;     outputMsg.pose.orientation.x = msg-&gt;pose.orientation.y;     outputMsg.pose.orientation.y = msg-&gt;pose.orientation.z;     outputMsg.pose.orientation.z = msg-&gt;pose.orientation.x;     outputMsg.pose.orientation.w = msg-&gt;pose.orientation.w;      osvrPosePub.publish(outputMsg);     ros::spinOnce(); }   But that made things really weird. Facing north pitch is pitch, facing west, pitch is yaw, facing south, pitch is negative pitch...  How can I convert my OSVR quaternion to the a corresponding quaternion in the new coordinate system? Why do electron and proton have the same but opposite electric charge? There was a book (it actually had a second book as well) where a guy gets paid with a group of others to go to a planet that is enclosed in a metallic sphere.   There are many species in this planet. I don't recall if they actually met the races in the first or the second book but there an incident where an alien in the first book ate fruit from a tree that removed any signs of gender from it. Terence Tao, Analysis I, Ex. 5.5.2: Entry point needed Terence Tao, Analysis I, 3e, Exercise 5.5.2:     Let $E$ be a non-empty subset of $\mathbb{R}$, let $n \ge 1$ be an   integer, and let $L &lt; K$ be integers. Suppose that $K/n$ is an upper   bound for $E$, but that $L/n$ is not an upper bound for $E$. Without   using Theorem 5.5.9, show that there exists an integer $L &lt; m \le K$   such that $m/n$ is an upper bound for $E$, but that $(m-1)/n$ is not   an upper bound for $E$. (Hint: prove by contradiction, and use   induction. It may also help to draw a picture of the situation.)    does not do the trick for me, since I'm looking for the proof by contradiction, equipped only with the set of propositions and theorems covered so far.  What I'm actually looking for is an entry point to the proof, since I find it quite hard to negate the assumption.  My attempt is to induct over $n$. Assume I have been able to prove the statement for $n = 1$, is the following a valid negation of the assumption?  For all integers in the range $(L, K]$, at least one of the following statements holds:   $(m-1)/(n+1)$ is not an upper bound and $m/(n+1)$ is not an upper bound. $(m-1)/(n+1)$ is an upper bound and $m/(n+1)$ is not an upper bound. $(m-1)/(n+1)$ is an upper bound and $m/(n+1)$ is an upper bound.   If I were able to prove that there is an integer in the given range such that none of the above holds, am I done?       Theorem 5.5.9 (Existence of least upper bound). Let $E$ be a non-empty subset of $\mathbb{R}$. If $E$ has an upper bound, (i.e.,   $E$ has some upper bound $M$), then it must have exactly one least   upper bound.     I went through another loop considering  of Steve Kass, but I ended up wondering why the proof needs induction at all:  Assume for all integers $m$ where $L &lt; m \le K$ we have that $m/n$ and $(m-1)/n$ are upper bounds of $E$. Then $(m-1)/n = L/n$ is also an upper bound. But $L/n$ is no upper bound, by assumption. Assume $m/n$ and $(m-1)/n$ are no upper bounds. Then $m/n = K/n$ is also no upper bound. But $K/n$ is an upper bound, by assumption.   Hence, there is an integer in the range $(L, K]$ s.t. $m/n$ is an upper bound for $E$, and $(m-1)/n$ is not. Passport validity for Canada I am traveling from Boston to Canada by cruise ship. The first port of arrival is on July 30 and the last port in Canada is on August 4. Then I'm flying on August 5 from Montreal to California. My passport is valid until August 20th. Will I have a problem? Suppose $X$ is binomial $B(n,p)$. How can I find the probability that $X$ is even ?  I know $$P(X = k ) = \frac{ n!}{(n-k)!k!} p^k(1-p)^{n-k} $$  where $X=1,....,n$. Are they just asking to find $P(X = 2m )$ for some $m &gt; 0$ ? Prove that if $A$ is an infinite set then $A \times 2$ is equipotent to $A$ I want to prove that if $A$ in an infinite set, then the cartesian product of $A$ with 2 (the set whose only elements are 0 and 1) is equipotent to $A$.  I'm allowed to use Zorn's Lemma, but I can't use anything about cardinal numbers or cardinal arithmetic (since we haven't sotten to that topic in the course).  I read a proof of the fact that if $a$ is an infinite cardinal number, then $a+a=a$, which is something similar to what I want to prove.   Any suggestions will be appreciated :) Earth Engine convert list with coordinates and values into a feature collection for export I need to create a feature collection from a list containing coordinates and band values.  These are extracted from a landsat image as shown in this linked script.    I'm unable to find a solution in creating a feature collection.  Here is the tail end code.  var valuesList = joinedImage.reduceRegion({   reducer: ee.Reducer.toList(4),   geometry: myGeometry }).values().get(0);  var feature = ee.Feature(null, valuesList);   // Wrap the Feature in a FeatureCollection for export. var myFeatures = ee.FeatureCollection([feature]);   // Export the image, specifying scale and region. Export.table.toDrive(myFeatures, "data", "myData", "B4-B5",  "CSV");   This doesn't work, because it is clearly the wrong way to create the feature collection.  I've tried to create it similar to Rodrigo E. Principe's solution of mapping a Feature Collection but I can't seem to create the initial feature collection to start with. GCD in polynomial rings with coefficients in a field extension Why disable Fast Boot on Windows 8 when having dual booting? Add an API key to QGIS for QOSM layer Primary ideals in Noetherian rings For an $R$-module $M$ I have the following definition for a submodule $N\subset M$ to be $\mathfrak{p}$-primary: this is the case when $\text{Ass}(M/N) = \{\mathfrak{p}\}$, that is, $M/N$ is coprimary or $(0)$ is a primary submodule.  Now for an ideal $\mathfrak{q} \subset R$ this definition gives that $\mathfrak{q}$ is $\mathfrak{p}$-primary iff $\text{Ass}(R/\mathfrak{q}) = \{\mathfrak{p}\}$. It can be shown that this is equivalent with $\mathfrak{p}^n \subset \mathfrak{q}$ for some $n\in \mathbb{N}$ and the condition \begin{align*} \forall r,s \in R: rs \in \mathfrak{q}, r\not\in \mathfrak{p}\Rightarrow s \in \mathfrak{q}. \end{align*}     Now I suspect that if $R$ is Noetherian, and if $\mathfrak{q}$ is $\mathfrak{p}$-primary, then we have $\sqrt{\mathfrak{q}} = \mathfrak{p}$. I have shown this for PID's, but does this generaly hold?    And if so, is every ideal $\mathfrak{q}\subset R$ then $\sqrt{\mathfrak{q}}$-primary?   Many thanks. How to upload a file of size 2GB from Apex? Is there any sobject that I can make use of? How to remove the Ubuntu menu of Windows Boot Manager? I have an ASUS K55VM and it came with DOS, and then Windows 7 was installed. I am planning to install Ubuntu on it. My computer had 4 partitions: 240GB, 230GB, 230GB, and 230GB, and I changed this to 5 partitions: 243GB, 230GB, 230GB, 150GB, and 80GB. I installed Ubuntu 12.04 to the 80GB partition through a USB flash drive. It installed fine, however the problem is during the Boot option in Windows Boot Manager. When I choose Ubuntu, this what is displayed:  Windows failed to start. A recent hardware or software change might be the cause. To fix the problem:   1. Insert your Windows installation disc and restart your computer.   2. Choose your language settings, and then click "Next,"   3. Click "Repair your computer." If you don't have this disc, contact your system administrator or computer manufacturer for assistance.    File: \ubuntu\winboot\wubildr.mbr   Status: 0xc000000e   Info: The selected entry could not be loaded because the application is missing or corrupt.   I tried to change the boot option for the OS and made Ubuntu as my first option. It worked, however Windows 7 does not show up in GRUB. In this fear I did the following:     Restarted my PC changed boot option 1 to Windows.   Formatted the drive to which Ubuntu was installed (80GB one) through Windows.   Restarted again.     The problem persists. Windows Boot Manager still shows Ubuntu, and when I choose this it gives two lines one like: grub rescue&gt;, but my Windows 7 is working perfectly fine.  Now I want a solution to remove Ubuntu from the Windows boot option and reinstall completely. The spell was cast without words, simply a flick of the Death Eater's wand, and a 'streak of purple flame' that lanced across her chest. It was later mentioned that the spell was weakened because of the lack of a verbal component, but still 'did enough damage as it was'. She was in the infirmary healing from the damage for some time. What spell was this? I define a shell keybinding in my ~/.bashrc like so:  bind -x '"\e\C-w":"/usr/bin/reset"'   This does make Ctrl-Alt-w launch the reset executable. However, it leaves the terminal in a state that resembles the one you get into by pressing Ctrl-v. So, for example, if immediately after resetting in this way I press Ctrl-p, instead of invoking the action of that shortcut (repeat previous command) I get ^P printed.  Any idea what's causing this problem and how to fix it?  EDIT: I am attaching a Python program that reproduces the messed-up terminal state I am trying to fix with the reset. I encounter this condition very often while debugging multi-threaded applications:  import pdb, thread, time  def interrupt():     time.sleep(2)     pdb.set_trace()  thread.start_new_thread(interrupt, ()) raw_input('? ')   To reproduce the messed-up state, just run the code above, and press Enter when you see the debugger invoked (it will print a bunch of text, ending with pdb.set_trace(), about two seconds after you run the program and the initial prompt appears). Is there a way to increase space between bibliography without using biblatex?