I'm looking for a bijective mapping which maps an n-tuple onto/into a subset {1, 2, 3, ..., nCr) of Z where the n-tuples are (non-repeating) combinations of the integers {0, 1, 2, ..., r - 1}.  For example,     (1, 5, 10) maps to x where (1, 5, 10) is an ordered triple representation of a combination of {0, 1, 2, ..., 14} and thus 1 &lt;= x &lt;= 15C3.  For our purposes, assume the elements of the tuple are zero based but the result is 1 based.  Also, assume the elements of the tuple are in ascending order.  I need the solution to either be a formula or an algorithm and not just "calculate all possible combinations in an orderly way and number them".   This is somewhat like Lehmer encoding but I need it for combinations rather than permutations.  Does anyone know a solution to this?  Edit: Though none of the solutions in the linked question are marked as the solution, I was able to use (with a slight tweak) joriki's solution for my purposes. Thanks guys!
This question has an inverse:     What would be the most efficient way to translate a combination of $k$-tuple into its positions within the $\left(\!\!\binom{n}{k}\!\!\right)$ combinations? I need this to be fast for combinations of $\left(\!\!\binom{70}{7}\!\!\right)$ order of magnitude - very large, but not exceeding 2 billion (fits into int32 maximum value).  Below is an example of $\left(\!\!\binom{6}{3}\!\!\right)$, where the aim is to quickly translate (a, d, f) tuple to value 9, while in the real problem $k$ ranges between 5 and 8.  $$\begin{array} {cccccc|c} a&amp;b&amp;c&amp;d&amp;e&amp;f&amp;^{combination}/_{sort\_order}&amp; \\\hline x&amp;x&amp;x&amp; &amp; &amp; &amp;1\\ x&amp;x&amp; &amp;x&amp; &amp; &amp;2\\ x&amp;x&amp; &amp; &amp;x&amp; &amp;3\\ x&amp;x&amp; &amp; &amp; &amp;x&amp;4\\ x&amp; &amp;x&amp;x&amp; &amp; &amp;5\\ x&amp; &amp;x&amp; &amp;x&amp; &amp;6\\ x&amp; &amp;x&amp; &amp; &amp;x&amp;7\\ x&amp; &amp; &amp;x&amp;x&amp; &amp;8\\ x&amp; &amp; &amp;x&amp; &amp;x&amp;9\\ x&amp; &amp; &amp; &amp;x&amp;x&amp;10\\ .&amp;.&amp;.&amp;.&amp;.&amp;.&amp;.\\  &amp; &amp; &amp;x&amp;x&amp;x&amp;20\\ \end{array}$$  I know that I could pre-calculate all the combinations and reverse the lookup dictionary. However, such dictionary would not be efficient in terms of memory usage. Therefore I am looking for either calculation-based approach, or a more efficient data structure to perform this mapping.
Show that G is a group, if G is finite, the operation is associative, and cancellation law holds Let $G$ be a non-empty finite set with an associative binary operation so that cancellation law holds, i.e. $ab=ac$ or $ba=ca$ implies $b=c$, for any choices of $a,b,c$ in $G$. Assume that there is an identity element $e$ in $G$. Show that $G$ is a group.  Proof: To show $G$ is a group, conditions must hold. Suppose that $ab=ac$, then $b=eb=(a^{-1}a)b =a^{-1}(ab)=a^{-1}(ac) =(a^{-1}a)c=ec=c$. So left cancellation holds in $G$.  2) Suppose $ba=ca$, then $b=be=b(aa^{-1}) =(ba)a^{-1}=(ca)a^{-1} =c(aa^{-1})=ce=c$. So right cancellation holds in $G$.  3) If $a$ exists in $G$ then $aa^{-1}=a^{-1}a=e$, where $a$ is an inverse of $a^{-1}$. Since inverses are unique, $(a^{-1})^{-1}=a$.  4) Let $x$ be the inverse of $ab$. Then $(ab)x=e$. By associativity we have $a(bx)=aa^{-1}$. Through left cancellation we have  $bx=a^{-1}bx=ea^{-1}=b(b^{-1}a^{-1})$ and $x=b^{-1}a^{-1}$.  Thus $(ab)^{-1}=b^{-1}a^{-1}$. So all conditions hold, $G$ is a group.  Is this proof correct? I know to show $G$ is a group these conditions have to be met. This is all I have to show right? Convolution is uniformly continuous and bounded Suppose $f\in L^\infty(\mathbb{R})$ and $K\in L^1(\mathbb{R})$ with $\int_\mathbb{R}K(x)dx=1$. Show that the convolution $f\ast K$ is a uniformly continuous and bounded function.  The definition of the convolution is $(f\ast K)(x)=\int_\mathbb{R}f(x-y)K(y)dy$.   There is the inequality $\|f\ast K\|_\infty\leq\|f\|_\infty\|K\|_1$, which yields that $f\ast K$ is bounded. But what about uniform continuity? Is there an idiom for people who boast too much? Why do some questions not start with an auxiliary verb? When I learned English, my teachers told me that all questions must have an auxiliary verb at the beginning, just like Are you mad? or Is she playing? do.  But when watching some movies or talking with people who speak English, they just ask using things like You mad? and She’s playing?   Of course, the kind of intonation let me know they are asking a question, but why this happen? Any javascript event occurring when user clicks Stop load button? Let $X \sim Bin(n,p)$ show that $X/n \nsim Bin()$ Let $X \sim Bin(n,p)$   Part A.  Show that the argument      "Then $X/n \sim Bin()$ with $E[X/n]=p$and $Var[X/n]=pq/n$"    is false.   My book says we can prove this result using a moment generating function. But to me it makes no intuitive sense: We have Bin-distributed RV $X$ and if we rescale it with $1/n$ of course it will be Bin-distributed.  And we know from standard formulas that $E[aX]=aE[X]$ and $Var[aX] = a^2Var[X]$ so I think the argument is correct.   (For full disclosure, the argument we should falsify according to the book is "Let X be a binomial random variable with mean np and variance np(1−p). Show that the ratio X/n also has a binomial distribution with mean p and variance p(1−p)/n." But I think the argument is correct. )    Ok, now I get part A. Here is Part B. Prove it using the moment generating function of $X/n$.   Attempt: I get $$m_X(t)=E[\exp(tX/n)]=(m_X(t))^{1/n}$$ Can a single sentence be used to distinguish between isomorphic classes of finite structures? The answer seems to be yes, judging from the following exercise I found in the book Mathematical Logic by H.D. Ebbinghaus, J. Flum, and W. Thomas:     Let $S$ be a finite symbol set and let $\mathfrak{U}$ be a finite $S$-structure. Show that there is an $S$-sentence $\varphi _{\mathfrak{U}}$ the models of which are precisely the $S$-structures isomorphic to $\mathfrak{U}$.   I think I have an idea of how to solve this exercise, but I seem to be unable to materialize it. Thanks. How can I see all versions of a package that are available in the archive? Is there a way I can see all the versions that are in the archives that I have configured in sources.list. I can see the last version of each archive withapt-get policy, but how can I see them all?  Is there any way that this can also include PPA and anything in sources.list.d? Difference between the use of "a" and "any" in these examples? I didn't have an idea.      I did not have any idea.   I am much more familiar with the second one. The first one sounds a bit odd to me, but sounds fine if I say:     I did not have even an idea.   But, the first one is also one of the widely used sentences by natives. What is the difference between the two? ID a book about a mirror world and 4th dimension I read a book about 10-15 years ago about a boy and a girl who find a mirror. What made the mirror special was, they were able to enter the reflection and be a part of the reverse image world. They end up going to school and when asked to write something on the board, it ends up being backwards, but to them looks normal.  Later, the two end up in a world with 4 dimensions. With the added dimension they can't see as they normally could. If one moved a certain way the other would see their insides. Eventually a native of that dimension made some type of device that lets them see regularly.  Other than that my memory is blank. If I remember anything else I will be sure to edit it in. Why do a lot of questions from around 2008 seem to have really high upvotes? Mobile web refresher, part 3 Should I activate the additional driver: Processor microcode firmware for Intel CPUs for intel-microcode I have recently noticed that there is an additional driver called Unknown: Unknown here which was not there before:    I have already read , and understand why it is there, but my question is, should I activate it? Will this make a difference? Or should I just leave it as it is as it sounds rather useful?    OS Information:  Description:    Ubuntu 15.04 Release:    15.04 Baking IK into FCurves I have an object containing multiple models with several IK.  One model has fcurves (euler rotation only) which gives motor to linked IK models.  What I need is bake/convert all IK animations into FCurves.  Is it possible? Software was blocked from opening because it is not from an identified developer I went to run LibreOffice on my OS X 10.9 and it would not let me install it. It said it was from an unidentified developer. I'm aware of the security features of the Mac and went to System Preferences to allow the software to run.   When I opened this setting I saw a button that said, '"LibreOffice" was blocked from opening because it is not from an identified developer.' and there was a button next to it that said "Open Anyway". I clicked this button and nothing happened. I clicked it multiple times, like a hundred, out of frustration. Is there something else I need to do? Could someone verify this is not a bug?   UPDATE: I've included the photo below of what my System Preferences screen looked like and the button I pushed that didn't work.  UPDATE II: So I tried opening the application again and went into the system preferences and pressed the "Open Anyway" button again and nothing happened at first but a few minutes later while I was typing an email something flashed across my screen, possibly another dialog (or more likely a chewpacabra), but it quickly disappeared and the next thing I know LibreOffice launched! Using Residue Theorem find $\displaystyle \int_0^{2\pi} \frac{1}{a^2\cos^2 t+b^2 \sin^2 t} dt \;; a,b&gt;0$.   My Try:  So, I am going to use the ellipse $\Gamma = \{a\cos t+i b \sin t: 0\leq t\leq 2\pi\}$.   On $\Gamma$, $z=a\cos t+i b \sin t$, so $|z|^2=z\bar{z}=a^2\cos^2 t+b^2 \sin^2 t$.   Now, $dz=-a\sin t+i b \cos t dt$.   Hence, the integral becomes $\displaystyle \int_\Gamma \frac{dz}{z(iab+(\sin t \cos t)(b^2-a^2))}$. I know that $\displaystyle \int_\Gamma \frac{dz}{z}=2\pi i$. Now, how do I get rid of $\sin t \cos t$ part? I am stuck here. Can somebody please explain how? Convert ArrayList to String[] array How does the Java 'for each' loop work? Cannot favorite once up voted I'm not sure whether this is exactly the same bug as  or whether this is a new bug.  If you up vote a question and then attempt to add it to favorites too you get Question is already favorited:    This also happens if you up vote on the web site and then try to favorite it from Android. If you don't up vote or if you favorite it first and then up vote it appears to work fine. Solving binomial theorem via induction