I'm looking for an efficient way to count the number of ways $D_n$ to divide an $n \times n$ grid into four (possibly empty) regions: top left, top right, bottom left and bottom right, such that no cell of another region is in either of the designated directions from a cell of a given region, e. g. no cell from a different region is either above or to the left of a cell in the top left region.  I can see that a region will either be rectangular (possibly degenerate) or will share a (possibly irregular) stairstep-shaped border with the opposite region, in which case the other two regions will necessarily be rectangular.  I thus thought to count the number of stairstep paths between (possibly identical) points on an $(n+1) \times (n+1)$ lattice, which I know would be $$2\left(\sum _{k=1}^n\sum_{r=1}^n {{k+r} \choose k} + (n + 1){{n+1} \choose 2}\right)+(n+1)^2$$ which, when simplified is$$n^3+3n^2-n-3+2{{2n+2}\choose {n+1}}$$  This needs to be adjusted for overcounting (and undercounting), though: divisions with all rectangular regions where one or more are degenerate have a many-to-many correspondence with paths, but I'm having a bit of trouble with the exact corrections to make.  I'm actually trying to compute this as part of a larger calculation, so I'd like to find ways to improve the time-complexity of the algorithm.  In this particular case, for $n&gt;2$, when I'm trying to calculate $D_n$, I'll already know $D_a$ and $D_b$ for some $(a,b)$ where $a+b=n$ so a recurrence relation would be nice.  This is a project Euler problem (or rather isomorphic to one), so I'm looking more for hints/suggestions etc. than actual answers, but any help is appreciated.  Note: in case it wasn't clear, for the purposes of this question, a stairstep path from point $a$ to point $b$ along the lattice in which the distance to point $b$ is strictly decreasing. Paths go both ways, so the path from $a$ to $b$ is equivalent to the reverse path from $b$ to $a$.  update: joriki pointed out that this is the same problem as .  That question's page has a closed form, but no derivation.  I am still interested in computing it quickly for large n, though it's worth noting that the answers in this particular case are taken modulo a large number (which I suspect is probably prime), if that changes anything.
Got this problem from a friend and would like some pointers if anyone has any.  Fill an $n \times n$ matrix with the symbols $\{a,b,c,d\}$ subject to the following:     Only the symbol $a$ appears to the left or above an $a$    Only the symbol $b$ appears to the right or above a $b$    Only the symbol $c$ appears to the left or below a $c$    Only the symbol $d$ appears to the right or below a $d$     Here are some examples of a valid fillings: $$\left( \begin{matrix} a &amp; a &amp; b  &amp; b \\ a &amp; a &amp; b &amp; b \\ c &amp; c &amp; c &amp; d \\  c &amp; c &amp; c &amp; d  \end{matrix}\right) $$  $$\left( \begin{matrix} a &amp; a &amp; a  &amp; a &amp; a &amp; b  &amp; b \\ a &amp; a &amp; a  &amp; a &amp; a &amp; b  &amp; b \\ a &amp; a &amp; a &amp; d &amp; d &amp; d &amp; d \\  a &amp; a &amp; a &amp; d &amp; d &amp; d &amp; d\\a &amp; a &amp; d &amp; d &amp; d &amp; d &amp; d\\c &amp; c &amp; d &amp; d &amp; d &amp; d &amp; d\\  c &amp; c &amp; d &amp; d &amp; d &amp; d &amp; d  \end{matrix} \right) $$  What I have done: We'll it is clear to me that the $a$'s (for example) make up a sort of Young Diagram just by the property above. But there is more to the problem than that. If your YT for $a$ is just a square, then you might have a reversed (right justified) YT available to place for the $b$'s. Details like this seem to make this a tricky problem for me. I am intrigued by this problem and I just thought I'd share it here in case there is some easy way to do this counting problem that I've never heard of.  Thanks,
Multiple tables join in SQL for this scenario What would happen if every person in the world gathered at a minimum possible area and jumped all at once? Would that have any effect on Earth? When is the image of a linear operator (between Banach spaces) closed? Let $T: X \longrightarrow Y$ be a continuous linear map between two Banach spaces.  When is $\operatorname{Ran}(T)$ a closed subspace?  What theorems are there?   Thanks :) Font characters displayed as squares in Ubuntu 18.04 Recently, on my Ubuntu 18.04 I have noticed that at least on gnome-calculator and chromium browser the fonts are displayed as squares. I have followed instructions  and , the calculator is fixed, but the problem on chromium still exists when I open a dialog to search for a file.  Not sure if this happens on other applications as well, I haven't checked all my apps, but File managers nemo and nautilus are working fine.  Also, before few months ago, I have included some windows fonts for my libre office shown . I used the copy (cp) method, not the link (ln -s). But, was working fine until yesterday. Haven't done any major change or update, at least on my Linux partition (dual boot). But, I don't think that this has anything to do with that.  Any idea how can I fix this issue?  . Why does everyone do 9-overlord, not 10-overlord? Which lenses should be included in a travel photography kit? On a crop sensor camera, e.g. Canon EOS 7D, what would be the best kit to travel with around Europe for a few weeks? My shooting style will focus on landscape, architecture, and general travel shots (of note would be my lack of interest for portraits).     Limit to around 1-3 lenses, and I prefer light ones.   Crop sensor camera chosen to save on weight over a full frame option. Question is open to all brands for general guidance, but I will be using a Canon body.   Cost is not a factor, I will rent the lenses I do not already own.   Quality is of paramount importance. I will not have a tripod.   I understand some may consider this subjective, but I do believe that for a crop sensor body, with weight as a consideration, and a limit to the amount of lenses, a true best kit can be determined. Convert from MySQL datetime to another format with PHP Should I have more than one brokerage account? I have my brokerage business with one particular well-known US brokerage house. I find being able to access my retirement accounts and personal investment accounts through the one interface useful.  However, I was talking with a friend of mine and she said she never puts more than about $50k into any particular brokerage account.  Managing three or four such accounts seems like too much overhead for me. I'd prefer to spend my "investment time" reading up on my investments and researching new ones.  One reason to have more than one brokerage account with different houses is the issue of  insurance:     Within limits, SIPC expedites the return of missing customer property by protecting each customer up to $500,000 for securities and cash (including a $250,000 limit for cash only).   What other reasons could I have to use more than one brokerage account? Get next / previous element using JavaScript? What type of buildings offer what level of jobs? There are three tiers of workers (as is everything else); tier 1, 2 and 3. What I am having a hard time with is figuring out what I can build to target workers from each of the tiers. I gather what I am sure everyone else has, low tech industrial (regardless of density really) provides mostly tier 1 jobs.  But what are my other building options for tier 1 jobs? If I want to target tier 2 or 3 what types of buildings should I consider? The title kind of says it all. Is it possible to replace C# with C++ on a game using Unity? What is the volatile keyword useful for? Registry key / GPO to disable and block Windows 10 upgrade? When should I upgrade my camera body? As the question says, when should I upgrade my camera body? In particular, if I have a low- to mid-range body (A DSLR such as a Nikon D3200 or Nikon D5100, or Canon SL1 or T5, or a mirrorless camera such as a Panasonic GH3 or an Olympus E-PL6). How do I know when I need to upgrade?  I have a complement of "kit" lenses, such as an 18-55mm f3.5-5.6 and a 55-200mm f4-5.6. Maybe I've even added a 50mm 1.8 to the kit. Flash is only for indoors (right?) and I usually shoot outside, so that means I don't need an external flash.  I shoot photos of my family and friends whether out at the park or having a picnic, my kids sports practices and games, vacation photos, as well as some landscapes, flowers, and whatever else catches my eye. Pretty familiar territory. I'm not a professional and don't intend to become one. Anonymous user feedback now in testing Anonymous and unregistered users with &lt; 15 reputation (the amount required to earn the upvote privilege) will now see       feedback   on every post in the area that a logged in user would see "add comment":    When the post area is moused over, the area expands to:     Was this post useful to you? [Yes] [No]     once clicked it will say     sending feedback...   and eventually     Thank you for your feedback.   The goal is to offer the 90% of our traffic that is anonymous users a way to provide more meaningful feedback on posts rather than passively incrementing a view counter.  This click data is currently being evaluated to see what we can do with it. Ideas welcome! The determinant of block triangular matrix as product of determinants of diagonal blocks I am given the following partitioned, upper-triangular matrix:  $$ \begin{bmatrix}   A_1 &amp;*  &amp;*  &amp;*  &amp;*  &amp;*  \\    0&amp; A_2 &amp;*  &amp;*  &amp;*  &amp;*  \\    .&amp;  0&amp; A_3 &amp;*  &amp;*  &amp;*  \\    .&amp;  0&amp;  0 &amp;...  &amp;*  &amp;. \\    .&amp;  0&amp;  0&amp;  0&amp; ... &amp;.  \\    0&amp;  .&amp;  ...&amp;  0&amp;0 &amp; A_m \end{bmatrix} $$  where each of the $A_i$ are block-matrices.  I have to prove that the determinant of this general matrix is: $$ \prod_{n=1}^m \det A_i. $$  We already proved in class that it is true for $ m=2 $ and we can use it in our proof.  Thanks for your answers! Would a fast interstellar spaceship benefit from an aerodynamic shape? Some (generous) assumptions:   We have a spaceship that can reach a reasonable fraction of light speed. The ship is able to withstand the high energies of matter impacting at that speed.   Given the amount of matter in inter-stellar space, at high speed, would it encounter enough of it and frequently enough that an aerodynamic shape would significantly reduce its drag (and thus save fuel)? Is it safe to change the lens on my new DSLR? I recently bought myself a shiny new DSLR camera. Before I can use it, I had to do something kind of terrifying: mount the lens.  Now of course, half the advantage of SLR cameras is that the lenses are interchangeable. But sitting there holding an extremely expensive brand new camera and staring into its bare innards, I'm just terrified that if I make one wrong move, a hair or a piece of dust could fall in there, and then the camera will be irreparably damaged and I'll never be able to use it again.  This might sound like a stupid question, but&hellip; is it actually &ldquo;safe&rdquo; to change the lens on the camera? Is this likely to destroy it?  (Obviously it goes without saying that you should limit the time spent with no lens attached to the minimum number of seconds possible. But even if you have lightning fingers, the camera will still be lenseless for some number of seconds. And it's not like I'm standing in a class 100 cleanroom here! Besides, you don't want to be too rough with the delicate lens mounting either&hellip;) High contrast theme and Firefox-Font colour issues? How do they film the mirror scenes in movies?