Number of possible rectangles in a grid using combinatorics There are $n^2$ squares disposed in a bigger n by n square, like a grid. Something like [this][1]  The question is: how many rectangles can be formed using those squares? I saw this problem in a [blackpenredpen][2] (youtube maths channel) and decided to try and figure it out by myself, as I had an idea. The idea I had was to calculate the number of possible diagonals that could be made from picking any two squares in the grid, since one diagonal is all it takes to define a rectangle. It made sense to divide by 2, since $n \choose 2$ would yield 2 diagonals for each rectangle. So, I tried $\frac{n \choose 2}{2}$, but the results I got didn't match with the correct ones (I know the correct result, as it can be obtained by other methods, like the ones presented in the [video][2]). I had really high hopes for this idea and was disppointed when I got an incorrect result. I toyed and fiddled a little with the results I got, but to no avail. I did find out that for $n=8$ the difference between the result I got and the correct one was $7!$, which I found suspicious.  Can anyone help me figure out why my reasoning is not yielding the correct results? If I wasn't clear or there is something I should do better, please point it out. Thank you! I am enjoying this site.
How many rectangles or triangles. I have come across numerous questions where I am given the picture such as the above one been asked "how many rectangles are there?". I have even come across some slightly different images that instead of rectangles you are supposed to find the number of triangles. Well, I was thinking whether there is any formula or strategy that is used to solve these problems without having to manually count every shape.  Help would be appreciated.  Thank you :)
Is $\lim\limits_{n\rightarrow\infty} n$ comparable to $\aleph_0$? For example, can we say: $\infty=\lim\limits_{n\rightarrow\infty} n &lt; \aleph_0$?  These are two different types of structures. The limit being like the length, extension, or just generic magnitude and the other being cardinality of a set. Can we compare magnitude to cardinality?  Intuitively, we can reach $\aleph_0$ by counting the natural numbers on the number line and in the process will be approaching $\infty$. Which leads me to believe $\infty\leq\aleph_0$. But I can't see why it should be a strict inequality. I feel like they should be of equal magnitude.  I saw on a recent comment that $2^\infty=\infty$, but are those infinities really the same? It seems not to me. Of course we (usually) have that  $2^{\aleph_0}=\aleph_1$ where ${\aleph_0}$ and $\aleph_1$ are clearly two very distinct infinities, countable vs uncountable at least. Maybe one might argue that as far as the concept of magnitude is concerned, all infinities are "equal". Let $f : U \to V$ and $g : V \to W$ be linear transformations on the vector spaces $U$, $V$, and $W$. Supposedly,  $$ \dim(\ker(g \circ f)) = \dim(\ker(f)) + \dim(\ker(g) \cap \operatorname{im}(f)). $$  How might I go about proving that?    (Attempt:) The $\dim(\ker(g)\cap\operatorname{im}(f))$ term suggests to me that I should define a vector space $V' = \ker(g) + \operatorname{im}(f)$ to invoke the theorem that  $$ \dim(V') = \dim(\ker(g)) + \dim(\operatorname{im}(f)) - \dim(\ker(g) \cap \operatorname{im}(f)), $$  but I don't really see where to go from there. How does Princess Leia know Obi-Wan Kenobi is "Ben" Kenobi? When Luke rescues Leia from her cell on the Death Star:  Leia: Aren't you a little short to be a stormtrooper? Luke: Huh? Oh, the uniform. I'm Luke Skywalker. I'm here to rescue you. Leia: You're who? Luke: I'm here to rescue you. I've got your R2 unit, I'm here with Ben Kenobi! Leia: Ben Kenobi, where is he?! Luke: Come on!  How does Princess Leia know Obi-Wan Kenobi is &quot;Ben&quot; Kenobi? Shouldn't her response have been: &quot;Ben Kenobi? You mean the General??&quot; What are the existing datasets of world maritime routes? I am using TeXworks 0.4.5 r1280 with MikTeX 2.9 on Windows 7 64-bit. When I add  \usepackage{datetime}   and try to typeset the document, I get a dialog window like this:    I select "Install", confirm UAC request and then get the following error on the console:  ! LaTeX Error: File `datetime.sty' not found.   If I try to typeset the document again - the dialog and the error appear again.  Same thing happens when I've tried installing wrapfig and a few other packages at random: cases, comma, dowith, microtype.  Other packages have installed fine before. What is wrong with my setup? Please let me know if you need more info about my setup in comments.  I've tried this solution: . Didn't work. Is there console mode in Mac OS X? Automatically show connected mass storage devices on Windows desktop I just installed Ubuntu 14.04 on a Dell laptop with 1.7Ghz Pentium M and 1Gbyte memory.  Graphics are Intel® 852GM/855GM x86/MMX/SSE2, OS type is 32bit.  The whole system is VERY slow. When I launch the applications manager, for example, I need to wait in order to see the letters I typed appear!  It is as if the CPU was overloaded and no memory available, but I only have Firefox running.  How can I make the system run smoother? It used to have Windows XP installed and it worked fine. Why not use the Lagrangian, instead of the Hamiltonian, in nonrelativistic QM? I'm using the caption package.  In the List-Of-Figures I get only the numbers, but I also want to have the prefix. It currently looks like that:     List of Figures   1 Caption of Figure 1........1   2 Caption of Figure 2........9     And I want it to look like:     List of Figures   Figure 1: Caption of Figure 1...1   Figure 2: Caption of Figure 2...9     The same format is already used for the captions themselves. Why should I use the keyword "final" on a method parameter in Java? I can't understand where the final keyword is really handy when it is used on method parameters.    If we exclude the usage of anonymous classes, readability and intent declaration then it seems almost worthless to me.   Enforcing that some data remains constant is not as strong as it seems.    If the parameter is a primitive then it will have no effect since the parameter is passed to the method as a value and changing it will have no effect outside the scope.  If we are passing a parameter by reference, then the reference itself is a local variable and if the reference is changed from within the method, that would not have any effect from outside of the method scope.    Consider the simple test example below. This test passes although the method changed the value of the reference given to it, it has no effect.  public void testNullify() {     Collection&lt;Integer&gt; c  = new ArrayList&lt;Integer&gt;();           nullify(c);     assertNotNull(c);            final Collection&lt;Integer&gt; c1 = c;     assertTrue(c1.equals(c));     change(c);     assertTrue(c1.equals(c)); }  private void change(Collection&lt;Integer&gt; c) {     c = new ArrayList&lt;Integer&gt;(); }  public void nullify(Collection&lt;?&gt; t) {     t = null; } I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event?  Events are attached using:    Event.observe; DOM's addEventListener; As element attribute element.onclick. Where should I start with Star Trek? (TV series only, not the movies) I haven't seen any of the stuff in the Star Trek franchise, except for one of the movies, and now I want to remedy the situation. I am not interested in the movies, just the TV series. However, since the show has many seasons, I am not interested in watching the show start to finish. So, where (i.e what series/season) should I start with? Do I really need to see the series in real-world chronological order?   Note: I am somewhat familiar with Star Trek, that is I know the basic premise - ships in space, with war between different space-faring sentient species. Command to display and execute code (math formulae) Similar to  I would like to have a command to display and execute code. The code should be displayed with the listings package.  For example something like  \documentclass{scrartcl} \usepackage{amsmath,listings} \newcommand*{\codeExample}[1]{Code: \lstinline!\string{#1}! yields #1} \begin{document}   \codeExample{$\lVert a\rVert$} \end{document}   should for best of cases display $\lVert a \rVert$ as verbatim (\lstinline!...!) code and after that the rendered math code. Is something like that possible? The code above yields several mistakes. I think I miss something to avoid #1 being tokenised? I really tried hard to do this on my own, but I keep failing ... Using multi-column and multi-row commands confused me. I know some of you might frown upon such a request but I really need help getting this table implemented .. So I'm sorry if I upset anyone.  My preamble has :   \documentclass[12pt,a4paper]{report} \usepackage[lmargin=3.81cm,tmargin=2.54cm,rmargin=2.54cm,bmargin=2.52cm]{geometry} \linespread{1.5}     Is there a way I can convert this from excel to LaTeX form ? I tried an add-in before but it didn't work for me. Also online generators cannot combine cells the way I want them (unless I didn't find a better table generator ? ) How Are Galaxies Receding Faster Than Light Visible To Observers? How to pass the values from one activity to previous activity What does the notation like 8.6e-28 mean? What is the 'e' for? I have a problem with the interpretation of a test result in which the p-value is 8.6e-28. How should it be interpreted? What is the e for?  Specifically, I used White's Test for the homoscedasticity assumption of a linear regression:  White's general test statistic :  150.0535  Chi-sq( 9)  P-value =  8.6e-28 "I have" vs "I have got" I don't know what is the difference between using "I have got" and "I have" For example:      He's got broad shoulders.    Is it possible to say:      He has broad shoulders.    If yes, so what is the difference? How do I rip audio from a DVD?