Let's say we have $4$ positive integers $x$, $y$, $z$, $w$ that satisfy the property： $$x+ y+ z+ w = 100$$ How many possible distinct answers are there?
I have been racking my brain to understand the solutions of constrained stars and bars problems like:  $a+b+c+d = 19$;  $a,b,c,d \in \{0,1,2,3,4,5,6,7\}$  Finding the total number of solutions is really simple $\dbinom{22}{3}$.   What to do after that? I want to understand the entire procedure step by step.   Please do not mark it as a duplicate of .  Reasons:   The accepted answer's trick doesn't always work.   Another person (the answer with two upvotes) has just listed out the binomial coefficients and I can't even remotely understand what he has tried to do.   The second answer isn't my cup of tea.
Emacs text-scale-adjust causes line numbers column to incrementally shrink and disappear I've set up emacs to display line numbers (global-linum-mode 1), and it works until I start enlarging the text via text-scale-adjust    The line numbers column starts to shrink, and disappears entirely after a few increments. When it has fully disappeared, further increments have no more effect on the left edge.    Is this a know issue? Is there a workaround?    Using GNU Emacs 23.1.1 in Ubuntu 10.04. SE Android app for tablet has bad formatting on feed Getting Started to Xetex for Devangari? An equivalent condition with $\{0\}$ being the only nilpotent ideal How do I increase my code coverage, or why can't I cover these lines? This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How is code coverage obtained and calculated? How do I increase my coverage?  Why can't I cover these lines? Why isn't the body of my loop or conditional statement covered? Can matter really fall through an event horizon? Sunlight Sensitivity looks pretty bad — Disadvantage to attack rolls and Perception checks whenever you, your target, or what you're trying to perceive are in direct sunlight. I hope I'm missing something, since no other PC race has a comparable hindrance.  Are there any ways you have used to mitigate this flaw to make players of this race not at a severe disadvantage (or, if it doesn't need mitigation, explain why it's already balanced without any action required)? Markdown + Mathjax => PDF I've used LaTeX a lot in the past, but now, when comparing with StackExchange's great , I find it tedious, for short documents (&lt; 2 pages), to have to use pure LaTeX. For a short document, instead of having 30 lines as introduction: \begin{document} \documentclass[11pt,a4paper]{article} \usepackage[frenchb]{babel} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts}  + &lt;lots of other things&gt; ...  I'd like to write my short document with MarkDown + Math, like on . Question: Is there an offline compiler such that compilemarkdown exercice.tex  would produce a PDF from this: #Title  Here is a *short document* including Markdown and Math, here is the equation:  $$f(x)=x^2$$  ___  Proof: ...   This is **bold**. How to change the disk space left warning in Windows 7? my disk has over 100GB of free space, but the usage bar in Computer is displayed in red, as if it reached a low space limit. It looks like Windows applies the same 10% or 15% hard disk space value for low space warnings, regardless of if the disk is 50GB in size or 1.5TB, which is not very smart and obsolete for most recent computers.  Is there a Registry key or some place I can change this percentage so the usage bar displays in green, not red?  The hibernation and page files are already reserved (5GB together), so surely the low space warning for a 1.5TB disk should be 5-10GB, not 150GB or more. The way Windows 7 computes the low space limit seems pretty dumb, not much Intellisense there.  This is not a high priority issue, but it makes the Computer applet look pretty stupid and it's irritating every day to see that 100GB of free space is putting my computer in the red. It would also be nice to be able to edit this low limit percentage in Computer/Manage/Storage/Disk Management or directly in the disk properties ("Tools" tab). Make WCF service be accessible through Internet Full URL not working with php include how to hide mesh but keep hair particles Remmina remoteapp over RDP I was wondering how to use remmina to open applications on a Windows machine over rdp using remoteapp (or seamless or whatever it's actually called).  I've already used Kim Knight's  to set up remoteapp on a Windows 7 machine and I can connect and run remote apps fine from another windows box.  Allegedly FreeRDP (which Remmina uses for its RDP Plugin) has support for remoteapp. I'm not sure how to make use of it though. I can't find any examples of people actually doing this online but there is a , from which I can infer that there is some way to run remote apps.   I've tried many combinations of settings for Client, Startup Program and Startup Path in the Advanced tab when configuring an RDP connection in Remmina, but I can't make it work. I can connect to Windows boxes with RDP just fine, just not running a remoteapp. How to remove configuration files completely Recently I uninstalled some software using sudo apt-get --purge autoremove, thinking that this would remove all traces of it including unused dependencies and configuration files. However I discovered that a configuration file was left behind in my home folder.  Is there a more powerful command which would remove even that?   Also, is it safe to delete the hidden files and folders under home, if they are merely configuration files, or are there other kinds of files? Arranging GUI elements in QGIS 3 processing model user interface Using QGIS 3 graphical modeler I created a model with a variety of input parameters (> 10). When starting the model, a nice user interface is generated. But the arrangement of the GUI elements is totally confused and apparently unpredictable during creating the model. It does neither seem to depend on the arrangement of input parameters in the graphical modeler nor on the chronological order in which the input parameters are added to the model.   Is there a way that let's me arrange the GUI elements in the order I desire? An electron has no known internal structure, does that imply it has an unknown one? I'm currently reading Alonso and Finn's Electromagnetism book.  It explains that the spin contributes to the magnetic moment and is somewhat comparable to a rotation of the particle around its own axis. It says that the spin of a particle is caused by a certain internal structure, which makes sense in the aforementioned analogy.  Right underneath the paragraph with the explanation of spin, it says "The electron has no known internal structure", but since it does have a spin, does that mean that we know the electron has an internal structure but we just don't know what it is? 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;) I would like to see everything on my computer screen in grayscale (like say the kindle screen). How do I do this? Correct user names when tracking /etc/ in git repository and committing as root How to construct an example of a probability distribution for which $\mathbb{E}\left(\frac{1}{X}\right)=\frac{1}{\mathbb{E}(X)}$ holds, assuming $\mathbb{P}(X\ne0)=1$?    The inequality which follows from Jensen's inequality for a positive-valued RV $X$ is like $\mathbb{E}\left(\frac{1}{X}\right)\ge\frac{1}{\mathbb{E}(X)}$ (the reverse inequality if $X&lt;0$). This is because the mapping $x\mapsto\frac{1}{x}$ is convex for $x&gt;0$ and concave for $x&lt;0$. Following the equality condition in Jensen's inequality, I guess the distribution has to be degenerate for the required equality to hold. A trivial case where the equality holds is of course if $X=1$ a.e. Here is an example I found in a problem book: Consider a discrete random variable $X$ such that $\mathbb{P}(X=-1)=\frac{1}{9}, \mathbb{P}(X=\frac{1}{2})=\mathbb{P}(X=2)=\frac{4}{9}$. It is then easily verified that $\mathbb{E}\left(\frac{1}{X}\right)=\frac{1}{\mathbb{E}(X)}=1$.   This example shows that $X$ need not be positive (or negative) a.e. for the equality in the title to hold. The distribution here is not degenerate either.  How do I construct an example, possibly like the one I found in the book? Is there any motivation?