Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an equation like this: $${20 \choose k}\cdot \sum_{i=0}^k {k \choose i}\cdot i \leq 1+f$$.

I want to plot this inequality as the dependency between k and f. I found a commend RegionPlot but I don't know how to correctly use it in such equation.

share|improve this question
You have an inequality, not an equation. :) – Svend Tveskæg Dec 9 '13 at 13:58
@SvendTveskæg Yes, you are right ^^ – Ziva Dec 9 '13 at 15:32
up vote 2 down vote accepted
ListPlot[Table[{k, Binomial[20, k] Sum[i Binomial[k, i] - 1, {i, 0, k}]}, {k, 1, 20}], Filling->Top]

Mathematica graphics

Or the same using a Log scale

Mathematica graphics

share|improve this answer

If you want only integer values you can put k in Round:

RegionPlot[Binomial[20, Round[k]] Sum[
  i Binomial[Round[k], i], {i, 0, Round[k]}] <= 1 + f, {k, 1, 20}, {f, 0, 5 10^9}]

enter image description here

Your function is explicit, so it will be better to use ListPlot as in belisarius's answer:

ListPlot[Table[{k - 0.5, Binomial[20, k] Sum[i Binomial[k, i], {i, 0, k}] - 1}, {k, 20}], 
  Filling -> Top, Joined -> True, InterpolationOrder -> 0]

enter image description here

Also one can note that

Sum[i Binomial[k, i], {i, 0, k}]
 2^(-1 + k) k
share|improve this answer

The inequality you are considering is simplified as follow.

Consequently, we can use RegionPlot easily.

2^(-1+k) k Binomial[20,k]<=1+f
RegionPlot[2^(-1+k) k Binomial[20,k]<=1+f, {k,-4,10},{f,-20,40}]

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.