ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 12 Jun 2014 13:13:12 +0200Simple counting on restricted n-ary k-tupleshttps://ask.sagemath.org/question/11068/simple-counting-on-restricted-n-ary-k-tuples/I have some simple counting problems, for example, how many n-ary k-tuples, i.e. $(v_0,v_1,\ldots, v_k)$ with $0\le v_i < n$, are there which have $v_0=1$, and $m$ non-zero coordinates.
What sort of functionality is there is Sage or other computer algebra systems for answering such questions for general $n,k$ and $m$?Wed, 11 Jun 2014 07:57:19 +0200https://ask.sagemath.org/question/11068/simple-counting-on-restricted-n-ary-k-tuples/Answer by kcrisman for <p>I have some simple counting problems, for example, how many n-ary k-tuples, i.e. $(v_0,v_1,\ldots, v_k)$ with $0\le v_i < n$, are there which have $v_0=1$, and $m$ non-zero coordinates.</p>
<p>What sort of functionality is there is Sage or other computer algebra systems for answering such questions for general $n,k$ and $m$?</p>
https://ask.sagemath.org/question/11068/simple-counting-on-restricted-n-ary-k-tuples/?answer=16091#post-id-16091I'm not quite sure how to interpret your question, but do you mean [integer vectors](http://www.sagemath.org/doc/reference/combinat/sage/combinat/integer_vector.html)?Wed, 11 Jun 2014 09:32:26 +0200https://ask.sagemath.org/question/11068/simple-counting-on-restricted-n-ary-k-tuples/?answer=16091#post-id-16091Comment by kcrisman for <p>I'm not quite sure how to interpret your question, but do you mean <a href="http://www.sagemath.org/doc/reference/combinat/sage/combinat/integer_vector.html">integer vectors</a>?</p>
https://ask.sagemath.org/question/11068/simple-counting-on-restricted-n-ary-k-tuples/?comment=16151#post-id-16151But I'm wondering whether they might have that built in as well...Thu, 12 Jun 2014 13:13:12 +0200https://ask.sagemath.org/question/11068/simple-counting-on-restricted-n-ary-k-tuples/?comment=16151#post-id-16151Comment by alejandroerickson for <p>I'm not quite sure how to interpret your question, but do you mean <a href="http://www.sagemath.org/doc/reference/combinat/sage/combinat/integer_vector.html">integer vectors</a>?</p>
https://ask.sagemath.org/question/11068/simple-counting-on-restricted-n-ary-k-tuples/?comment=16152#post-id-16152they are a restricted class of integer vectors, since every vector would have the same number of coordinates, $k$, and the maximum in each coordinate is also fixed at $n$. edit: the biggest difference, however, is that I think IV computes all of the vectors with the given parameters, whilst I want algebraic answers for general parameters.Wed, 11 Jun 2014 09:37:03 +0200https://ask.sagemath.org/question/11068/simple-counting-on-restricted-n-ary-k-tuples/?comment=16152#post-id-16152