# Puzzle in Percentages

Okay, this is a real-time problem.

The following is a picture of Customer satisfaction rating, which was displayed next to an item in an online shopping website.

Satisfied customers click the vote-up button, and unsatisfied customers click the vote-down button. Every time a button is clicked, the rating changes accordingly.

From the above image, we can infer that 94% of the people are satisfied with the product and the rest 6% aren't satisfied.

Now, is there any way to find out the number of people who participated in voting?

Edit: It's clear that there could be infinite solutions evident from Lord Soth's answer. So, I'll change the question a bit. What could be the minimum no of people who participated in voting??

-
Is there unique number that corresponds to 94%? No. If $x$ is the total number of people, all this says is $0.94x$ liked it and $0.06x$ did not. $x$ could be any number. –  AnonSubmitter85 Jun 30 '13 at 20:11

No, though you can infer some limits if you know how the program rounds. The smallest number of voters who can produce a percentage that rounds normally to $94$% is $16$: $\frac{15}{16}=0.9375$, while $\frac{14}{15}$ is only $0.9333\dots\;$. If the program truncates instead of rounding, there must have been at least $17$: $\frac{16}{17}\approx0.9412$. But what you can infer is at best pretty minimal and probably not useful.

Added: In general the minimum number voting is the smallest $n$ such that some fraction $\frac{m}n$ rounds to the decimal corresponding to the percentage of satisfied customers. If that percentage is given as an integer, and if the rounding is done normally (with rounding up at the halves), the requirement is that

$$\frac1{100}\left(p-\frac12\right)\le\frac{m}n<\frac1{100}\left(p+\frac12\right)\;,$$

where $p$ is the percentage of satisfied customers. This can be rewritten as

$$p-\frac12\le m\cdot\frac{100}n<p+\frac12$$

and thence as

$$\frac{n}{100}\left(p-\frac12\right)\le m<\frac{n}{100}\left(p+\frac12\right)\;.$$

Thus, you want the smallest integer $n$ such that the interval

$$\left[\frac{n}{100}\left(p-\frac12\right),\frac{n}{100}\left(p+\frac12\right)\right)$$

contains an integer.

-
Thank you very much sir. Now it's much clearer :) –  VISHNU VIVEK Jun 30 '13 at 20:59
@TheProgrammer: You’re very welcome. –  Brian M. Scott Jul 1 '13 at 5:52

You can answer the question of the minimum number of voters via continued fractions. This is often given, e.g. in volume 2 of Knuth's The Art Of Computer Programming, as the 'baseball average' problem: what is the minimum number of at-bats a batter could have for a displayed average of .334?

Given the interval $(a,b)$ — in this case, we assume that the figure $94%$ is rounded to the nearest percent and so the values of $a$ and $b$ are $0.935$ and $0.945$ — first find the continued fractions for $a$ and $b$. Here, we have:

$$a = \frac{187}{200} = \frac{1}{\frac{200}{187}} = \frac{1}{1+\frac{13}{187}} = \frac{1}{1+\frac{1}{\frac{187}{13}}} = \frac{1}{1+\frac{1}{14+\frac{5}{13}}} = \frac{1}{1+\frac{1}{14+\frac{1}{2+\frac{3}{5}}}}=\ldots$$

and we find the continued fraction representation $(0,1,14,2,1,1,2)$ for $a$. Similarly, we can find the continued fraction representation for $b$ as $(0,1,17,5,2)$. Since these two diverge at their third value, all continued fractions in the range $(0,1,15) = \frac{15}{16}$ through $(0,1,17) = \frac{17}{18}$ will be within the range; what's more, by choosing the smallest convergent within the range $[15,17)$ here (i.e., $15$) we get the smallest fraction.

-

Not enough information. There might be 100 people 94 having said yes, and 6 having said no. There may also be 10000 people, with 9400 people having said yes, and 600 having said no.

Edit: Brian M. Scott has the answer for the smallest number of voters for which you can expect a percentage of 94.

Edit: The actual non-mathematical answer of this question is $0$. Most of these "percentages" are set by the moderators of the website.

-
"Every time a button is clicked, the rating changes accordingly." I think we're supposed to estimate how many clicks it takes. Also I suppose we should assume that the reported percentage has been rounded to a whole number somehow. –  Dan Brumleve Jun 30 '13 at 20:10
Hi, please read the edit to the question. Thanks! –  VISHNU VIVEK Jun 30 '13 at 20:13

All we can be sure is that the true proportion is between $0.935$ and $0.945$ so that it rounds to $94\%$. Note that $\frac{14}{15}=0.9\overline3$ is too small and $\frac11=1$ is too big. However, any fraction $\frac ab$ with $\frac{14}{15}<\frac ab<\frac11$ has denominator $\ge 16$ because the numerators of $\frac{a}{b}-\frac{14}{15}=\frac{15a-14b}{15b}$ and $\frac11-\frac ab=\frac{b-a}{b}$ must be positive, i.e. $\ge1$. Hence $$b=(15a-14b)+15\cdot(b-a)\ge 1+15\cdot 1=16.$$ And in fact $\frac{15}{16}=0.9375$ would round to $94\%$. The next candidates are $\frac{16}{17}$ and $\frac{17}{18}$, whereas $\frac{18}{19}$ is too big, i.e. we have $$\frac{14}{15}<0.935<\frac{15}{16}<\frac{16}{17}<\frac{17}{18}<0.945<\frac{18}{19}.$$ By a similar argument as above one sees that any fraction between these four fractions as a denominator at least as big as the sum as the two adjacent denominators, i.e. at least $15+16=31$ (and in fact $\frac{29}{31}$ fits the bill).

-

I will endeavour to give you an engineering style answer, which will give you the answer to greater accuracy, and will be of more practical use, but it won't be as mathematically advanced, and will also affect the result.

There is no way to infer a good and informative estimate of the number of people who voted from that image. Without manipulating the figures yourself....

1. Write a script which votes for you an arbitrary number of times until the score changes. We'll assume that this script can vote much faster than the rest of the internet combined.

2. Using your bot, downvote until the number changes to 7%. You now know that just over 6.5% of people including your bot downvoted. The precision of that figure depends on the number of people who voted.

3. Using your bot, downvote until the number changes to 8%. You now know that just over 7.5% of people including your bot downvoted. Let the number of votes cast in this step be n.

4. The number of people who voted is approximately 100*n. The higher this is, the more accurate your measurement of n will me.

5. Upvote to reset the counter to its approximate original score.

• If one downvote affects the score by more than 1%, you might be able to find the exact answer.

• If the number of downvotes required to affect the score by 1% is low, manipulate the score by a higher percentage.

-