I'm working on a 2x2 subfigure figure and they keep appearing in 4 rows instead of 2x2. What am I doing wrong?  Code underneath (and some of the included packages):  \usepackage{memoir} \usepackage{graphicx} \usepackage{subcaption} \begin{figure}  \begin{subfigure}[b]{.45\linewidth} \centering \includegraphics[width=0.85\textwidth ]{pic/fig_flexibility.png} \caption{Customizability graph}\label{fig:flexibility} \end{subfigure}  \begin{subfigure}[b]{.45\linewidth} \centering  \includegraphics[width=0.85\textwidth ]{pic/privacy_graph.png} \caption{Privacy graph}\label{fig:privacy_graph} \end{subfigure}   \begin{subfigure}[b]{.45\linewidth} \centering  \includegraphics[width=0.85\textwidth ]{pic/load_balancing_graph.png} \caption{Resource impact distribution graph}\label{fig:load_balancing_graph} \end{subfigure}  \begin{subfigure}[b]{.45\linewidth} \centering  \includegraphics[width=0.85\textwidth ]{pic/failure_sensitivity_graph.png} \caption{Failure sensitivity graph}\label{fig:failure_sensitivity_graph} \end{subfigure} %  \caption{A figure}\label{fig:1} \end{figure}    Screenshot:    Additionally, I fear that when I do get them 2x2 they won't be the same height. Any handy tricks I can use for that?
I want to put four figures in a single row. The code I am trying to use is taken from .  This puts three figures in a row. When I add a fourth one, I get three images in row and the last one appears in the second row. But I want all of them in one row. Here is my code.  \documentclass[12pt,twoside]{report}% Use this line for the print version of the thesis   \usepackage{graphicx} \usepackage{caption} \usepackage{subcaption} \begin{document}  \begin{figure}         \centering         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{gull}                 \caption{A gull}                 \label{fig:gull}         \end{subfigure}%           \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{gull}                 \caption{A gull2}                 \label{fig:gull2}         \end{subfigure}%          ~ %add desired spacing between images, e. g. ~, \quad, \qquad etc.           %(or a blank line to force the subfigure onto a new line)         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{tiger}                 \caption{A tiger}                 \label{fig:tiger}         \end{subfigure}         ~ %add desired spacing between images, e. g. ~, \quad, \qquad etc.           %(or a blank line to force the subfigure onto a new line)         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{mouse}                 \caption{A mouse}                 \label{fig:mouse}         \end{subfigure}         \caption{Pictures of animals}\label{fig:animals} \end{figure} \end{document}   As I have mentioned above, it works for three figures.  But I can not use it for four figures. What should I change?   What does  width=\textwidth mean?   I changed    \begin{subfigure}[b]{0.3\textwidth}   to  \begin{subfigure}[b]{0.2\textwidth}   but it didn't help.  Then, I changed     \includegraphics[width=\textwidth]{mouse}   to  \includegraphics[width=0.5\textwidth]{mouse}   Still no solution.
Energy conservation of Virtual Particles - Quantum Fluctuation? I (as a middle-school student) was wondering how virtual particles even conserve energy of the entire system? I don't mean just the particle's energy, but conservation with respect to the surroundings?  Let me explain more, Einstein proved that $E = mc^2$ and equivalently, we can say $m = \frac{E}{c^2}$ . We however know mass causes curvature in space-time (gravity well). Now that statement being completely valid we can use Quantum Fluctuation, implying energy and time can be related by the relation:  $\Delta{E}\Delta{t}\approx\frac{\hbar}{2}$ and by that simple relation we can make the following points:   As the energy increases, the time allowed to be "borrowed" decreases, before it gives it back to the universe. As time increases, the energy allowed to be "borrowed" decreases.    These are completely satisfactory points I've made, I believe.  Now, I have read that the vacuum is filled with constantly bubbling virtual particles that get created from the energy "borrowed" by the above relation and is destroyed again, which satisfies the energy conservation laws.   This seems to imply that  in the short time the virtual particle exists, they must have a very small mass which is: $m_{1} = \frac{\Delta{E}}{c^2}$ and using basic classical mechanics rather than GR (for sake of simplicity) we calculate that the gravitational force mediated by this short-lived virtual particle;  $F_{g}= G\frac{m_1 * m_x}{r^2}$   where $m_x$ is an particle\mass in question. Nevertheless since we know the force set upon an object moves the object in a direction, we can say it would increase its kinetic energy by this factor: $F_g = \frac{1}{2}mv^2$ which is equal to $G\frac{m_1 * m_x}{r^2} = \frac{1}{2}mv^2$.  Surely, this implies that every time quantum fluctuations happen, energy of real-particles\masses increases and therefore violates energy conservation, but what prevents this violation from taking place?  If virtual particles are not really present and interact with objects like I thought, how can Hawking radiation (currently a large concept in black hole physics) then be accepted in physics community? How can I view all of the flights between two cities across all dates? I believe that the standard routes of carriers between two semi-major US cities always maintain the same route number (e.g. UA3271), and day of the week. I'm looking at planning travel for an interview, so dates are [currently] quite flexible (as in at least one month's range). Since that's the case, there are other constraints that go into my choice of flights. One would be the option to fly out of my home city, land in the interview location, conduct the interview, and fly out in the same day. I figure: if I can view the schedule for flights (i.e. routes) between the two cities, I can make an educated request for days of travel. Yes, I could likely work with the interview scheduler (and I will), but I'd like to be proactive in suggesting some dates to achieve my goal, as well as learn this skill for myself in the future. Thus:  Where can I view the daily routes and times for flights between two cities, on whatever rotating basis (e.g. day of the week) they may be on? What are the units of entropy of a normal distribution? I have a random process that follows a normal distribution. It's parameters are mean = 35 units, std.dev. = 8 units. I've seen from the  for the normal distribution that there is a formula to calculate the entropy. So plugging in the figures as:- $$     .5\log\left(2\pi e^1 8\cdot 8\right) $$ I get a value of 1.52, which I take to be  per sample.  My question is what are these units?  What thing do I have 1.52 of?    is (typically) measured in units of bits, after Claude Shannon's definition.  So can I take it that each sample generates 1.52 bits of entropy?  Clearly recording those samples generates information and therefore occupies a real and discrete amount of storage space. Ergo entropy cannot be unit less. Is there a way to use the covariance matrix to find coefficients for multiple regression? For simple linear regression, the regression coefficient is calculable directly from the variance-covariance matrix $C$, by  $$ C_{d, e}\over C_{e,e} $$ where $d$ is the dependent variable's index, and $e$ is the explanatory variable's index.  If one only has the covariance matrix, is it possible to calculate the coefficients for a model with multiple explanatory variables?   ETA: For two explanatory variables, it appears that $$\beta_1 = \frac{Cov(y,x_1)var(x_2) - Cov(y,x_2)Cov(x_1,x_2)}{var(x_1)var(x_2) - Cov(x_1,x_2)^2} $$ and analogously for $\beta_2$. I'm not immediately seeing how to extend this to three or more variables. When using a new Windows 8 search bar:    What is the syntax of the search expression? Is it possible to use wildcards like "*", "?" or any other special symbol?  For example, when searching with Google i can use:   '-' (minus) for excluding certain words; "quoted phrase" for exact phrase matching. When voting to migrate an off-topic question, why is the list of sites limited? Same e-mail user, different address? Density of sum of two independent uniform random variables on $[0,1]$ I am trying to understand an example from my textbook.  Let's say $Z = X + Y$, where $X$ and $Y$ are independent uniform random variables with range $[0,1]$. Then the PDF is $$f(z) = \begin{cases} z &amp; \text{for $0 &lt; z &lt; 1$} \\ 2-z &amp; \text{for $1 \le z &lt; 2$} \\ 0 &amp; \text{otherwise.} \end{cases}$$  How was this PDF obtained?   Thanks How can one format a cell to have word wrap in Google Sheets?  I've tried Shift+Enter, but that doesn't seem to work.  One thing I know works is to place  and then if you edit your cell you can have word wrap in it.  But is there a way to do this without switching modes? How to remove white space before reference? So, I understand that by using 'tee' I can redirect the output of a command such as 'ping' to stdout as well as a file.  For example:  &gt; ping google.com | tee somefile   This would display the ping statistics on terminal and write them to 'somefile'.  Now, if I wish to modify the output from 'ping', I can use 'cut' in such a way:  &gt; ping google.com | cut -d' ' -f 1   But, if I wish to use all the three commands together, I get a no output on stdout and an empty file.  &gt; ping google.com | cut -d' ' -f 1 | tee somefile   What am I doing wrong? Is there a better way to do this? Somehow I feel I am not using 'tee' properly. Any insight would be appreciated.  I'm using bash shell, if this is relevant. Can "real" be used as an adverb to describe an adjective? Is this correct?     That is a real cool answer.   I learned that that was incorrect, since "real" is an adjective which can describe a noun, e.g. "real answer" but it is not an adverb which can describe an adjective, "real cool". Instead you would have to say:     That is a really cool answer.   Since "really" is an adverb. How to set static IP address? Evaluating $\int_{0}^{1} dx\frac{\log(1+x)}{1 + x^2}$ Possible Duplicate:          $$\int_{0}^{1} dx\frac{\log(1+x)}{1 + x^2}$$  I am having a hard time deriving the answer, $\frac{\pi}{8} \log(2) $.  I have tried Taylor expansion of both numerator and denominator, both seem too complicated and fruitless. Value of recommendation letters from professors in a different field Avoiding 'instanceof' in Java Modified Hamilton's Principle overconstraining a system by imposing too many boundary conditions In Hamiltonian Mechanics, a version of Hamilton's principle is shown to evolve a system according to the same equations of motion as the Lagrangian, and therefore Newtonian formalism. In particular, letting $\delta$ indicate a variation of the path through phase space, $$ \delta \int_{t_1}^{t_2} \big(p_i \dot{q}_i - H(p_i,q_i,t)\big)dt = 0 $$ is shown to generate the same motion equations as those found by the Legendre transform of the Lagrangian equations of motion. Essentially, when we calculate the Euler-Lagrange equations for the above integrand, we find $$ \dot{p}_i + \frac{\partial H}{\partial q_i} = 0\text{, } \dot{q}_i - \frac{\partial H}{\partial p_i} = 0. $$ Now, since these are both first-order equations of motion, we require $2n$ boundary conditions to obtain a solution, where $n$ is the number of particles. This is perfectly consistent with the Lagrangian formalism which had $2n$ boundary conditions due to its $n$ distinct second-order motion equations.   An important thing to note is that since $p_i\dot{q}_i - H(p_i,q_i,t)$ contains no $\dot{p}_i$ dependence, the variation in $p_i(t)$ need not be zero at the endpoints of the path. This is not the case with $q_i(t)$ because the $\dot{q}_i$ dependance results in the appearance of boundary terms that must be set to zero in order to obtain the motion equations.  Now, as far as the boundary conditions are concerned, this makes sense. For the path to be uniquely specified given Newtonian mechanics, we require $2n$ boundary conditions. These can either be the usual Newtonian choice of initial positions and velocities/momenta, or they can be the initial and final positions. Both are perfectly acceptable mathematically speaking. If we were required, in the modified Hamilton's principle variation, to enforce that the variations in the momenta also be zero at the initial and final times, this would mean $2n$ additional boundary conditions, which would generally over constrain a Newtonian system.   However, my confusion is this: when textbooks (Goldstein in particular) consider generating functions, they require that the integrand be invariant to the addition of a total time derivative of a function $F(q_i,p_i,t)$ of the phase space coordinates. However, adding such a function will in general add some $\dot{p}_i$ dependence to the integrand, which will then add boundary terms to the equations of motion unless we require that the $p_i(t)$ variations be zero at the boundaries. This is fine as far as it goes. We can always define the variation however we like. The point is just that it spits out the right motion equations at the end of the day. But my confusion lies in how this doesn't generally over constrain the system. If we specify all the positions and momenta at both the initial and the final times, might not the required path to connect those points in phase space be non-Newtonian? Does this only matter if you're actually trying to use the stationary action principle to find the paths, rather than just using it to find the motion equations? $(\Bbb Z\oplus \Bbb Z)[X] \not\cong \Bbb Z[X]\oplus \Bbb Z[X]\,$? Well i tried to prove it but failed. They are both commutative and have the same set of units. So i can't see a property of one ring which the other ring does not possess. Thank you for any help. Is it possible to make the -init method private in Objective-C? I need to hide (make private) the -init method of my class in Objective-C.  How can I do that? How many elements does the ring $ℤ[X]/(X^2-3,2X-4)$ have? Describe the structure of this ring. I'm making exercises to prepare for my ring theory exam:     How many elements does the ring $ℤ[X]/(X^2-3,2X-4)$ have? Describe the   structure of the this ring.   I find it always difficult if the ideal is generated by two elements.   I thought about someting like this. $X=2$ and $X^2=3$. Therefore $4=3$ therefore $1=0$. As $2=1$ then $X=0$. And then everyting seems to become $0$.   I'm not sure if I'm allowed to see it this way, but this is the first thing that comes to my mind.