How to find whole-number ratios from percentages? The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)whole number equationPercentages - Find Maximum value.Calculating 2 whole factors from a fractionTranspositional Algebra: Isolating a whole numberMultiplying whole number with fractions.Find a number from its sum with certain percentages of itselfHow to get a whole number from $y = frac1x + 2$Find All $x$ from $0$ - $200$ where $f(x)$ is a whole numberHow to find a number with ratiosWhole Number to Exponents
how can a perfect fourth interval be considered either consonant or dissonant?
How to pronounce 1ターン?
Do working physicists consider Newtonian mechanics to be "falsified"?
ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?
Match Roman Numerals
Problems with Ubuntu mount /tmp
The following signatures were invalid: EXPKEYSIG 1397BC53640DB551
What aspect of planet Earth must be changed to prevent the industrial revolution?
Can a 1st-level character have an ability score above 18?
Searching for a differential characteristic (differential cryptanalysis)
Can a novice safely splice in wire to lengthen 5V charging cable?
Can withdrawing asylum be illegal?
Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?
Segmentation fault output is suppressed when piping stdin into a function. Why?
Difference between "generating set" and free product?
Did God make two great lights or did He make the great light two?
Python - Fishing Simulator
Did the new image of black hole confirm the general theory of relativity?
Why does the Event Horizon Telescope (EHT) not include telescopes from Africa, Asia or Australia?
Why is superheterodyning better than direct conversion?
How did the audience guess the pentatonic scale in Bobby McFerrin's presentation?
How did passengers keep warm on sail ships?
Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?
Is this wall load bearing? Blueprints and photos attached
How to find whole-number ratios from percentages?
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)whole number equationPercentages - Find Maximum value.Calculating 2 whole factors from a fractionTranspositional Algebra: Isolating a whole numberMultiplying whole number with fractions.Find a number from its sum with certain percentages of itselfHow to get a whole number from $y = frac1x + 2$Find All $x$ from $0$ - $200$ where $f(x)$ is a whole numberHow to find a number with ratiosWhole Number to Exponents
$begingroup$
Let's say I have a results of a small vote - but only in percentage form and want actual vote counts (as well as total vote).
For example:
- $A: 47.4$%
- $B: 26.3$%
- $C: 26.3$%
In this case, I constructed a spreadsheet of votes vs total votes, and looked down until all the numbers were close to whole numbers (which occurs at total votes $= 19$, with $9$, $5$, $5$ respectively).
- Is there a mathematical way I can take these numbers and estimate the vote quantities - assuming those percentages are rounded?
I am willing to make the assumption it is the lowest time where values are close to whole numbers (ie at $19$ and not $38$, etc) as well as consider all numbers within $0.05$ of a whole number to be considered valid.
The context is an online game, where different groups often post election results in percentage form. Sometimes it can be strategically advantageous to approximate what percentage of their group voted from these results.
algebra-precalculus
$endgroup$
add a comment |
$begingroup$
Let's say I have a results of a small vote - but only in percentage form and want actual vote counts (as well as total vote).
For example:
- $A: 47.4$%
- $B: 26.3$%
- $C: 26.3$%
In this case, I constructed a spreadsheet of votes vs total votes, and looked down until all the numbers were close to whole numbers (which occurs at total votes $= 19$, with $9$, $5$, $5$ respectively).
- Is there a mathematical way I can take these numbers and estimate the vote quantities - assuming those percentages are rounded?
I am willing to make the assumption it is the lowest time where values are close to whole numbers (ie at $19$ and not $38$, etc) as well as consider all numbers within $0.05$ of a whole number to be considered valid.
The context is an online game, where different groups often post election results in percentage form. Sometimes it can be strategically advantageous to approximate what percentage of their group voted from these results.
algebra-precalculus
$endgroup$
add a comment |
$begingroup$
Let's say I have a results of a small vote - but only in percentage form and want actual vote counts (as well as total vote).
For example:
- $A: 47.4$%
- $B: 26.3$%
- $C: 26.3$%
In this case, I constructed a spreadsheet of votes vs total votes, and looked down until all the numbers were close to whole numbers (which occurs at total votes $= 19$, with $9$, $5$, $5$ respectively).
- Is there a mathematical way I can take these numbers and estimate the vote quantities - assuming those percentages are rounded?
I am willing to make the assumption it is the lowest time where values are close to whole numbers (ie at $19$ and not $38$, etc) as well as consider all numbers within $0.05$ of a whole number to be considered valid.
The context is an online game, where different groups often post election results in percentage form. Sometimes it can be strategically advantageous to approximate what percentage of their group voted from these results.
algebra-precalculus
$endgroup$
Let's say I have a results of a small vote - but only in percentage form and want actual vote counts (as well as total vote).
For example:
- $A: 47.4$%
- $B: 26.3$%
- $C: 26.3$%
In this case, I constructed a spreadsheet of votes vs total votes, and looked down until all the numbers were close to whole numbers (which occurs at total votes $= 19$, with $9$, $5$, $5$ respectively).
- Is there a mathematical way I can take these numbers and estimate the vote quantities - assuming those percentages are rounded?
I am willing to make the assumption it is the lowest time where values are close to whole numbers (ie at $19$ and not $38$, etc) as well as consider all numbers within $0.05$ of a whole number to be considered valid.
The context is an online game, where different groups often post election results in percentage form. Sometimes it can be strategically advantageous to approximate what percentage of their group voted from these results.
algebra-precalculus
algebra-precalculus
edited Feb 1 '13 at 18:04
enderland
asked Feb 1 '13 at 17:35
enderlandenderland
113110
113110
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
The continued fraction for $0.474$ is $(0,2,9,8,1,2)$. The approximants for the partial continued fractions are
$$
beginarray
&&0&2&9&8&1&2\
hline\
0&1&0&1&color#C000009&73&82&237\
1&0&1&2&color#C0000019&154&173&500
endarray
$$
The approximant $frac919=0.473684210526316$ is close enough to be rounded to $0.474$.
The continued fraction for $0.263$ is $(0,3,1,4,17,3)$. The approximants for the partial continued fractions are
$$
beginarray
&&0&3&1&4&17&3\
hline\
0&1&0&1&1&color#C000005&86&263\
1&0&1&3&4&color#C0000019&327&1000
endarray
$$
The approximant $frac519=0.263157894736842$ is close enough to be rounded to $0.263$.
Thus, the smallest number of total votes that gives the correct rounded results is $19$, with the votes being $9$, $5$, and $5$.
$endgroup$
$begingroup$
Continued fractions will not always work. Consider a case with $A=47.4%, B=24.4%$, where you'd find $frac01,frac12,frac919,frac73154,ldots$ and $frac01,frac14,frac1041,frac61250$ as approximants and would miss $color#C00000frac3778,frac1978$ (though admittedly the remaining $28.2%$ have $frac1139=frac2278$ as an approximant, but I'm sure a better counterexample can be found - I wanted to explicitly keep the $47.4%$ of the original question).
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:13
$begingroup$
The proper way to do it is to compute the continued fractions for $n-.05$ and $n+.05$; then any truncated continued fraction which is between those two will get rounded to $n$. For instance, if you obtained continued fractions of [0;1,2,2] and [0;1,2,4] then you would also have to consider [0;1,2,3].
$endgroup$
– half-integer fan
Feb 2 '13 at 12:45
$begingroup$
@HagenvonEitzen: Yes, these problems do not always have easy solutions. If the approximants did not work out, we would have to resort to half-integer fan's suggestion, and bracket the possible values between $0.4735$ and $0.4745$. Of course, this becomes as complicated as walking the Stern-Brocot Tree, as you did in your answer. Luckily, the simpler first attempt worked.
$endgroup$
– robjohn♦
Feb 2 '13 at 14:09
add a comment |
$begingroup$
First, let me state that if the number of votes are high enough, then you most likely can't get it anyway. For example, if you have three decimal places as above but the total vote counts are more than about 20 or 30, it might be impossible as some fractions will actually have the same decimal representation.
However, in this case, what you can do is try to find continued fraction approximations of each number, and pick a denominator that 1) is common to all the percentages, and 2) actually gives the correct rounded result.
$endgroup$
1
$begingroup$
My comment to robjohn's solution applies here as well. The smallest solution is not guaranteed to appear among the approximants.
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:53
add a comment |
$begingroup$
By rounding rules you know that the first value is somewhere between $u=0.4735$ and $v=0.4745$. Of course you can always find a valid fraction in $[u,v)$ if you select a denominator $ge frac1v-u$. You can use Farey sequence methods to find the fractions of minimal denominator that are within this range as well as all fractions with denominators $<frac1v-u$ in the range:
Start with the (very rough) approximation $frac 01<u<vle frac 11$. Now as long as you have an approximation $frac ab<u<vle frac cd$ compute the Farey sum $fraca+cb+d$; it is the only rational number between $frac ab$ and $frac cd$ with a denominator $le b+d$. If $fraca+c b+d<u$, replace $frac ab$ with $fraca+cb+d$; if $fraca+cb+dge v$, replace $frac cd$ with $fraca+cb+d$; otherwise you have the simplest candidate for a rational number corresponding to $47.4%$. If you check the other percentages, you may either find that the same denominator works for it or not.
You can continue to enumerate all feasible fractions ordered by ascending denominator:
We meanwhile have fractions
$$frac p_0q_0<ule frac p_1q_1<ldots <fracp_mq_m <vle frac p_m+1q_m+1$$
for some $mge 1$.
Determine $0le ile m$ such that $q_i+q_i+1$ is minimal and insert the Farey sum $fracp_i+p_i+1q_i+q_i+1$ into the sequence (kicking out $fracp_0q_0$ if it is $<u$, kicking out $frac p_m+1q_m+1$ if it is $ge v$, otherwise adding a new valid fration to our list). Repeat this until the next fraction would have denominator $ge frac1v-u$.
For each found fraction in $[u,v)$ check if the other percentages also allow this denominator (and there can be at most one matching numerator).
Example: With the above method, the fractions produced are (in this order) $frac 12, frac13, frac25, frac37,frac49,frac511,frac613,frac715,frac817$, after which we arrive at
$$tfrac01<tfrac13<tfrac25<tfrac37<tfrac49<tfrac511<tfrac613<tfrac715< frac817<ule frac 919<vle frac 12<tfrac11,$$
(fractions that got rejected are shown in smaller type) thus the first candidate is $frac919$. Next, we'll replace $frac12$ with $frac1021$, then $frac817$ with $frac1736$, then find $frac1940$ on the right, $frac2655$ on the left and again $frac2859$ on the right, then $frac3574$ on the left. The next step produces $frac3778$, which does lie in the interval and thus gives us the next smallest solution (apart from writing $frac919$ in non-smallest terms):
$$tfrac817<tfrac1736<tfrac2655<frac3574<ule frac 919<frac3778<vle frac 2859<tfrac1940<tfrac1021<tfrac12,$$
so it does take a few steps to find the next fraction in $[u,v)$. Next come $frac4493$ and then $frac4697$:
$$tfrac3574<frac4493<ule frac919<frac4697<frac3778<vle frac2859 $$
and then after a few more steps
$$tag1tfrac4493<tfrac53112<frac62131<ule frac919<frac64135<frac55116<frac4697<frac3778<frac65137<vle frac2859.$$
For completeness, this should be repeated until we reach denominators $ge 1000$.
Do the same with $26.3%$, i.e. with $u=0.2625$, $v=0.2635$:
$$tag2 tfrac01<tfrac14< tfrac623<tfrac1142<frac1661<ulefrac2180<frac519 <vle tfrac1972<tfrac1453<tfrac934<tfrac415<tfrac311<ldots$$
(merely continued until we find at least one more fraction in the interval).
By sheer luck, we find the same denominator $19$ in both (1) and (2), thus giving us an immediate solution $9:5:5$, as well as all multiples $18:10:10$, $27:15:15$ and so on.
But we may just as well and have to if there is no common denominator) pick any valid fraction from (1), any valid fraction from (2) and bring them to the $operatornamelcm$ of the denominators. For example $frac55116$ and $frac2180$ give us the solution $1100:609:611 $, which however is bad for one reasons: The $operatornamelcm$ is $2320>1000$, i.e. so big that we are in the realm of arbitrary denominators anyway.
At any rate, (1) alone shows that the next simplest solutions are with denominators $78, 97$ and then $>100$, but as (2) supports neither $78$ nor $97$, so that there definitely cannot exist any other small solution (less than $100$ people) apart from $9:5:5$ and its multiples.
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f292238%2fhow-to-find-whole-number-ratios-from-percentages%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
The continued fraction for $0.474$ is $(0,2,9,8,1,2)$. The approximants for the partial continued fractions are
$$
beginarray
&&0&2&9&8&1&2\
hline\
0&1&0&1&color#C000009&73&82&237\
1&0&1&2&color#C0000019&154&173&500
endarray
$$
The approximant $frac919=0.473684210526316$ is close enough to be rounded to $0.474$.
The continued fraction for $0.263$ is $(0,3,1,4,17,3)$. The approximants for the partial continued fractions are
$$
beginarray
&&0&3&1&4&17&3\
hline\
0&1&0&1&1&color#C000005&86&263\
1&0&1&3&4&color#C0000019&327&1000
endarray
$$
The approximant $frac519=0.263157894736842$ is close enough to be rounded to $0.263$.
Thus, the smallest number of total votes that gives the correct rounded results is $19$, with the votes being $9$, $5$, and $5$.
$endgroup$
$begingroup$
Continued fractions will not always work. Consider a case with $A=47.4%, B=24.4%$, where you'd find $frac01,frac12,frac919,frac73154,ldots$ and $frac01,frac14,frac1041,frac61250$ as approximants and would miss $color#C00000frac3778,frac1978$ (though admittedly the remaining $28.2%$ have $frac1139=frac2278$ as an approximant, but I'm sure a better counterexample can be found - I wanted to explicitly keep the $47.4%$ of the original question).
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:13
$begingroup$
The proper way to do it is to compute the continued fractions for $n-.05$ and $n+.05$; then any truncated continued fraction which is between those two will get rounded to $n$. For instance, if you obtained continued fractions of [0;1,2,2] and [0;1,2,4] then you would also have to consider [0;1,2,3].
$endgroup$
– half-integer fan
Feb 2 '13 at 12:45
$begingroup$
@HagenvonEitzen: Yes, these problems do not always have easy solutions. If the approximants did not work out, we would have to resort to half-integer fan's suggestion, and bracket the possible values between $0.4735$ and $0.4745$. Of course, this becomes as complicated as walking the Stern-Brocot Tree, as you did in your answer. Luckily, the simpler first attempt worked.
$endgroup$
– robjohn♦
Feb 2 '13 at 14:09
add a comment |
$begingroup$
The continued fraction for $0.474$ is $(0,2,9,8,1,2)$. The approximants for the partial continued fractions are
$$
beginarray
&&0&2&9&8&1&2\
hline\
0&1&0&1&color#C000009&73&82&237\
1&0&1&2&color#C0000019&154&173&500
endarray
$$
The approximant $frac919=0.473684210526316$ is close enough to be rounded to $0.474$.
The continued fraction for $0.263$ is $(0,3,1,4,17,3)$. The approximants for the partial continued fractions are
$$
beginarray
&&0&3&1&4&17&3\
hline\
0&1&0&1&1&color#C000005&86&263\
1&0&1&3&4&color#C0000019&327&1000
endarray
$$
The approximant $frac519=0.263157894736842$ is close enough to be rounded to $0.263$.
Thus, the smallest number of total votes that gives the correct rounded results is $19$, with the votes being $9$, $5$, and $5$.
$endgroup$
$begingroup$
Continued fractions will not always work. Consider a case with $A=47.4%, B=24.4%$, where you'd find $frac01,frac12,frac919,frac73154,ldots$ and $frac01,frac14,frac1041,frac61250$ as approximants and would miss $color#C00000frac3778,frac1978$ (though admittedly the remaining $28.2%$ have $frac1139=frac2278$ as an approximant, but I'm sure a better counterexample can be found - I wanted to explicitly keep the $47.4%$ of the original question).
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:13
$begingroup$
The proper way to do it is to compute the continued fractions for $n-.05$ and $n+.05$; then any truncated continued fraction which is between those two will get rounded to $n$. For instance, if you obtained continued fractions of [0;1,2,2] and [0;1,2,4] then you would also have to consider [0;1,2,3].
$endgroup$
– half-integer fan
Feb 2 '13 at 12:45
$begingroup$
@HagenvonEitzen: Yes, these problems do not always have easy solutions. If the approximants did not work out, we would have to resort to half-integer fan's suggestion, and bracket the possible values between $0.4735$ and $0.4745$. Of course, this becomes as complicated as walking the Stern-Brocot Tree, as you did in your answer. Luckily, the simpler first attempt worked.
$endgroup$
– robjohn♦
Feb 2 '13 at 14:09
add a comment |
$begingroup$
The continued fraction for $0.474$ is $(0,2,9,8,1,2)$. The approximants for the partial continued fractions are
$$
beginarray
&&0&2&9&8&1&2\
hline\
0&1&0&1&color#C000009&73&82&237\
1&0&1&2&color#C0000019&154&173&500
endarray
$$
The approximant $frac919=0.473684210526316$ is close enough to be rounded to $0.474$.
The continued fraction for $0.263$ is $(0,3,1,4,17,3)$. The approximants for the partial continued fractions are
$$
beginarray
&&0&3&1&4&17&3\
hline\
0&1&0&1&1&color#C000005&86&263\
1&0&1&3&4&color#C0000019&327&1000
endarray
$$
The approximant $frac519=0.263157894736842$ is close enough to be rounded to $0.263$.
Thus, the smallest number of total votes that gives the correct rounded results is $19$, with the votes being $9$, $5$, and $5$.
$endgroup$
The continued fraction for $0.474$ is $(0,2,9,8,1,2)$. The approximants for the partial continued fractions are
$$
beginarray
&&0&2&9&8&1&2\
hline\
0&1&0&1&color#C000009&73&82&237\
1&0&1&2&color#C0000019&154&173&500
endarray
$$
The approximant $frac919=0.473684210526316$ is close enough to be rounded to $0.474$.
The continued fraction for $0.263$ is $(0,3,1,4,17,3)$. The approximants for the partial continued fractions are
$$
beginarray
&&0&3&1&4&17&3\
hline\
0&1&0&1&1&color#C000005&86&263\
1&0&1&3&4&color#C0000019&327&1000
endarray
$$
The approximant $frac519=0.263157894736842$ is close enough to be rounded to $0.263$.
Thus, the smallest number of total votes that gives the correct rounded results is $19$, with the votes being $9$, $5$, and $5$.
answered Feb 2 '13 at 7:42
robjohn♦robjohn
271k27314643
271k27314643
$begingroup$
Continued fractions will not always work. Consider a case with $A=47.4%, B=24.4%$, where you'd find $frac01,frac12,frac919,frac73154,ldots$ and $frac01,frac14,frac1041,frac61250$ as approximants and would miss $color#C00000frac3778,frac1978$ (though admittedly the remaining $28.2%$ have $frac1139=frac2278$ as an approximant, but I'm sure a better counterexample can be found - I wanted to explicitly keep the $47.4%$ of the original question).
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:13
$begingroup$
The proper way to do it is to compute the continued fractions for $n-.05$ and $n+.05$; then any truncated continued fraction which is between those two will get rounded to $n$. For instance, if you obtained continued fractions of [0;1,2,2] and [0;1,2,4] then you would also have to consider [0;1,2,3].
$endgroup$
– half-integer fan
Feb 2 '13 at 12:45
$begingroup$
@HagenvonEitzen: Yes, these problems do not always have easy solutions. If the approximants did not work out, we would have to resort to half-integer fan's suggestion, and bracket the possible values between $0.4735$ and $0.4745$. Of course, this becomes as complicated as walking the Stern-Brocot Tree, as you did in your answer. Luckily, the simpler first attempt worked.
$endgroup$
– robjohn♦
Feb 2 '13 at 14:09
add a comment |
$begingroup$
Continued fractions will not always work. Consider a case with $A=47.4%, B=24.4%$, where you'd find $frac01,frac12,frac919,frac73154,ldots$ and $frac01,frac14,frac1041,frac61250$ as approximants and would miss $color#C00000frac3778,frac1978$ (though admittedly the remaining $28.2%$ have $frac1139=frac2278$ as an approximant, but I'm sure a better counterexample can be found - I wanted to explicitly keep the $47.4%$ of the original question).
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:13
$begingroup$
The proper way to do it is to compute the continued fractions for $n-.05$ and $n+.05$; then any truncated continued fraction which is between those two will get rounded to $n$. For instance, if you obtained continued fractions of [0;1,2,2] and [0;1,2,4] then you would also have to consider [0;1,2,3].
$endgroup$
– half-integer fan
Feb 2 '13 at 12:45
$begingroup$
@HagenvonEitzen: Yes, these problems do not always have easy solutions. If the approximants did not work out, we would have to resort to half-integer fan's suggestion, and bracket the possible values between $0.4735$ and $0.4745$. Of course, this becomes as complicated as walking the Stern-Brocot Tree, as you did in your answer. Luckily, the simpler first attempt worked.
$endgroup$
– robjohn♦
Feb 2 '13 at 14:09
$begingroup$
Continued fractions will not always work. Consider a case with $A=47.4%, B=24.4%$, where you'd find $frac01,frac12,frac919,frac73154,ldots$ and $frac01,frac14,frac1041,frac61250$ as approximants and would miss $color#C00000frac3778,frac1978$ (though admittedly the remaining $28.2%$ have $frac1139=frac2278$ as an approximant, but I'm sure a better counterexample can be found - I wanted to explicitly keep the $47.4%$ of the original question).
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:13
$begingroup$
Continued fractions will not always work. Consider a case with $A=47.4%, B=24.4%$, where you'd find $frac01,frac12,frac919,frac73154,ldots$ and $frac01,frac14,frac1041,frac61250$ as approximants and would miss $color#C00000frac3778,frac1978$ (though admittedly the remaining $28.2%$ have $frac1139=frac2278$ as an approximant, but I'm sure a better counterexample can be found - I wanted to explicitly keep the $47.4%$ of the original question).
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:13
$begingroup$
The proper way to do it is to compute the continued fractions for $n-.05$ and $n+.05$; then any truncated continued fraction which is between those two will get rounded to $n$. For instance, if you obtained continued fractions of [0;1,2,2] and [0;1,2,4] then you would also have to consider [0;1,2,3].
$endgroup$
– half-integer fan
Feb 2 '13 at 12:45
$begingroup$
The proper way to do it is to compute the continued fractions for $n-.05$ and $n+.05$; then any truncated continued fraction which is between those two will get rounded to $n$. For instance, if you obtained continued fractions of [0;1,2,2] and [0;1,2,4] then you would also have to consider [0;1,2,3].
$endgroup$
– half-integer fan
Feb 2 '13 at 12:45
$begingroup$
@HagenvonEitzen: Yes, these problems do not always have easy solutions. If the approximants did not work out, we would have to resort to half-integer fan's suggestion, and bracket the possible values between $0.4735$ and $0.4745$. Of course, this becomes as complicated as walking the Stern-Brocot Tree, as you did in your answer. Luckily, the simpler first attempt worked.
$endgroup$
– robjohn♦
Feb 2 '13 at 14:09
$begingroup$
@HagenvonEitzen: Yes, these problems do not always have easy solutions. If the approximants did not work out, we would have to resort to half-integer fan's suggestion, and bracket the possible values between $0.4735$ and $0.4745$. Of course, this becomes as complicated as walking the Stern-Brocot Tree, as you did in your answer. Luckily, the simpler first attempt worked.
$endgroup$
– robjohn♦
Feb 2 '13 at 14:09
add a comment |
$begingroup$
First, let me state that if the number of votes are high enough, then you most likely can't get it anyway. For example, if you have three decimal places as above but the total vote counts are more than about 20 or 30, it might be impossible as some fractions will actually have the same decimal representation.
However, in this case, what you can do is try to find continued fraction approximations of each number, and pick a denominator that 1) is common to all the percentages, and 2) actually gives the correct rounded result.
$endgroup$
1
$begingroup$
My comment to robjohn's solution applies here as well. The smallest solution is not guaranteed to appear among the approximants.
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:53
add a comment |
$begingroup$
First, let me state that if the number of votes are high enough, then you most likely can't get it anyway. For example, if you have three decimal places as above but the total vote counts are more than about 20 or 30, it might be impossible as some fractions will actually have the same decimal representation.
However, in this case, what you can do is try to find continued fraction approximations of each number, and pick a denominator that 1) is common to all the percentages, and 2) actually gives the correct rounded result.
$endgroup$
1
$begingroup$
My comment to robjohn's solution applies here as well. The smallest solution is not guaranteed to appear among the approximants.
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:53
add a comment |
$begingroup$
First, let me state that if the number of votes are high enough, then you most likely can't get it anyway. For example, if you have three decimal places as above but the total vote counts are more than about 20 or 30, it might be impossible as some fractions will actually have the same decimal representation.
However, in this case, what you can do is try to find continued fraction approximations of each number, and pick a denominator that 1) is common to all the percentages, and 2) actually gives the correct rounded result.
$endgroup$
First, let me state that if the number of votes are high enough, then you most likely can't get it anyway. For example, if you have three decimal places as above but the total vote counts are more than about 20 or 30, it might be impossible as some fractions will actually have the same decimal representation.
However, in this case, what you can do is try to find continued fraction approximations of each number, and pick a denominator that 1) is common to all the percentages, and 2) actually gives the correct rounded result.
answered Feb 1 '13 at 17:47
Joe Z.Joe Z.
4,85631836
4,85631836
1
$begingroup$
My comment to robjohn's solution applies here as well. The smallest solution is not guaranteed to appear among the approximants.
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:53
add a comment |
1
$begingroup$
My comment to robjohn's solution applies here as well. The smallest solution is not guaranteed to appear among the approximants.
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:53
1
1
$begingroup$
My comment to robjohn's solution applies here as well. The smallest solution is not guaranteed to appear among the approximants.
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:53
$begingroup$
My comment to robjohn's solution applies here as well. The smallest solution is not guaranteed to appear among the approximants.
$endgroup$
– Hagen von Eitzen
Feb 2 '13 at 11:53
add a comment |
$begingroup$
By rounding rules you know that the first value is somewhere between $u=0.4735$ and $v=0.4745$. Of course you can always find a valid fraction in $[u,v)$ if you select a denominator $ge frac1v-u$. You can use Farey sequence methods to find the fractions of minimal denominator that are within this range as well as all fractions with denominators $<frac1v-u$ in the range:
Start with the (very rough) approximation $frac 01<u<vle frac 11$. Now as long as you have an approximation $frac ab<u<vle frac cd$ compute the Farey sum $fraca+cb+d$; it is the only rational number between $frac ab$ and $frac cd$ with a denominator $le b+d$. If $fraca+c b+d<u$, replace $frac ab$ with $fraca+cb+d$; if $fraca+cb+dge v$, replace $frac cd$ with $fraca+cb+d$; otherwise you have the simplest candidate for a rational number corresponding to $47.4%$. If you check the other percentages, you may either find that the same denominator works for it or not.
You can continue to enumerate all feasible fractions ordered by ascending denominator:
We meanwhile have fractions
$$frac p_0q_0<ule frac p_1q_1<ldots <fracp_mq_m <vle frac p_m+1q_m+1$$
for some $mge 1$.
Determine $0le ile m$ such that $q_i+q_i+1$ is minimal and insert the Farey sum $fracp_i+p_i+1q_i+q_i+1$ into the sequence (kicking out $fracp_0q_0$ if it is $<u$, kicking out $frac p_m+1q_m+1$ if it is $ge v$, otherwise adding a new valid fration to our list). Repeat this until the next fraction would have denominator $ge frac1v-u$.
For each found fraction in $[u,v)$ check if the other percentages also allow this denominator (and there can be at most one matching numerator).
Example: With the above method, the fractions produced are (in this order) $frac 12, frac13, frac25, frac37,frac49,frac511,frac613,frac715,frac817$, after which we arrive at
$$tfrac01<tfrac13<tfrac25<tfrac37<tfrac49<tfrac511<tfrac613<tfrac715< frac817<ule frac 919<vle frac 12<tfrac11,$$
(fractions that got rejected are shown in smaller type) thus the first candidate is $frac919$. Next, we'll replace $frac12$ with $frac1021$, then $frac817$ with $frac1736$, then find $frac1940$ on the right, $frac2655$ on the left and again $frac2859$ on the right, then $frac3574$ on the left. The next step produces $frac3778$, which does lie in the interval and thus gives us the next smallest solution (apart from writing $frac919$ in non-smallest terms):
$$tfrac817<tfrac1736<tfrac2655<frac3574<ule frac 919<frac3778<vle frac 2859<tfrac1940<tfrac1021<tfrac12,$$
so it does take a few steps to find the next fraction in $[u,v)$. Next come $frac4493$ and then $frac4697$:
$$tfrac3574<frac4493<ule frac919<frac4697<frac3778<vle frac2859 $$
and then after a few more steps
$$tag1tfrac4493<tfrac53112<frac62131<ule frac919<frac64135<frac55116<frac4697<frac3778<frac65137<vle frac2859.$$
For completeness, this should be repeated until we reach denominators $ge 1000$.
Do the same with $26.3%$, i.e. with $u=0.2625$, $v=0.2635$:
$$tag2 tfrac01<tfrac14< tfrac623<tfrac1142<frac1661<ulefrac2180<frac519 <vle tfrac1972<tfrac1453<tfrac934<tfrac415<tfrac311<ldots$$
(merely continued until we find at least one more fraction in the interval).
By sheer luck, we find the same denominator $19$ in both (1) and (2), thus giving us an immediate solution $9:5:5$, as well as all multiples $18:10:10$, $27:15:15$ and so on.
But we may just as well and have to if there is no common denominator) pick any valid fraction from (1), any valid fraction from (2) and bring them to the $operatornamelcm$ of the denominators. For example $frac55116$ and $frac2180$ give us the solution $1100:609:611 $, which however is bad for one reasons: The $operatornamelcm$ is $2320>1000$, i.e. so big that we are in the realm of arbitrary denominators anyway.
At any rate, (1) alone shows that the next simplest solutions are with denominators $78, 97$ and then $>100$, but as (2) supports neither $78$ nor $97$, so that there definitely cannot exist any other small solution (less than $100$ people) apart from $9:5:5$ and its multiples.
$endgroup$
add a comment |
$begingroup$
By rounding rules you know that the first value is somewhere between $u=0.4735$ and $v=0.4745$. Of course you can always find a valid fraction in $[u,v)$ if you select a denominator $ge frac1v-u$. You can use Farey sequence methods to find the fractions of minimal denominator that are within this range as well as all fractions with denominators $<frac1v-u$ in the range:
Start with the (very rough) approximation $frac 01<u<vle frac 11$. Now as long as you have an approximation $frac ab<u<vle frac cd$ compute the Farey sum $fraca+cb+d$; it is the only rational number between $frac ab$ and $frac cd$ with a denominator $le b+d$. If $fraca+c b+d<u$, replace $frac ab$ with $fraca+cb+d$; if $fraca+cb+dge v$, replace $frac cd$ with $fraca+cb+d$; otherwise you have the simplest candidate for a rational number corresponding to $47.4%$. If you check the other percentages, you may either find that the same denominator works for it or not.
You can continue to enumerate all feasible fractions ordered by ascending denominator:
We meanwhile have fractions
$$frac p_0q_0<ule frac p_1q_1<ldots <fracp_mq_m <vle frac p_m+1q_m+1$$
for some $mge 1$.
Determine $0le ile m$ such that $q_i+q_i+1$ is minimal and insert the Farey sum $fracp_i+p_i+1q_i+q_i+1$ into the sequence (kicking out $fracp_0q_0$ if it is $<u$, kicking out $frac p_m+1q_m+1$ if it is $ge v$, otherwise adding a new valid fration to our list). Repeat this until the next fraction would have denominator $ge frac1v-u$.
For each found fraction in $[u,v)$ check if the other percentages also allow this denominator (and there can be at most one matching numerator).
Example: With the above method, the fractions produced are (in this order) $frac 12, frac13, frac25, frac37,frac49,frac511,frac613,frac715,frac817$, after which we arrive at
$$tfrac01<tfrac13<tfrac25<tfrac37<tfrac49<tfrac511<tfrac613<tfrac715< frac817<ule frac 919<vle frac 12<tfrac11,$$
(fractions that got rejected are shown in smaller type) thus the first candidate is $frac919$. Next, we'll replace $frac12$ with $frac1021$, then $frac817$ with $frac1736$, then find $frac1940$ on the right, $frac2655$ on the left and again $frac2859$ on the right, then $frac3574$ on the left. The next step produces $frac3778$, which does lie in the interval and thus gives us the next smallest solution (apart from writing $frac919$ in non-smallest terms):
$$tfrac817<tfrac1736<tfrac2655<frac3574<ule frac 919<frac3778<vle frac 2859<tfrac1940<tfrac1021<tfrac12,$$
so it does take a few steps to find the next fraction in $[u,v)$. Next come $frac4493$ and then $frac4697$:
$$tfrac3574<frac4493<ule frac919<frac4697<frac3778<vle frac2859 $$
and then after a few more steps
$$tag1tfrac4493<tfrac53112<frac62131<ule frac919<frac64135<frac55116<frac4697<frac3778<frac65137<vle frac2859.$$
For completeness, this should be repeated until we reach denominators $ge 1000$.
Do the same with $26.3%$, i.e. with $u=0.2625$, $v=0.2635$:
$$tag2 tfrac01<tfrac14< tfrac623<tfrac1142<frac1661<ulefrac2180<frac519 <vle tfrac1972<tfrac1453<tfrac934<tfrac415<tfrac311<ldots$$
(merely continued until we find at least one more fraction in the interval).
By sheer luck, we find the same denominator $19$ in both (1) and (2), thus giving us an immediate solution $9:5:5$, as well as all multiples $18:10:10$, $27:15:15$ and so on.
But we may just as well and have to if there is no common denominator) pick any valid fraction from (1), any valid fraction from (2) and bring them to the $operatornamelcm$ of the denominators. For example $frac55116$ and $frac2180$ give us the solution $1100:609:611 $, which however is bad for one reasons: The $operatornamelcm$ is $2320>1000$, i.e. so big that we are in the realm of arbitrary denominators anyway.
At any rate, (1) alone shows that the next simplest solutions are with denominators $78, 97$ and then $>100$, but as (2) supports neither $78$ nor $97$, so that there definitely cannot exist any other small solution (less than $100$ people) apart from $9:5:5$ and its multiples.
$endgroup$
add a comment |
$begingroup$
By rounding rules you know that the first value is somewhere between $u=0.4735$ and $v=0.4745$. Of course you can always find a valid fraction in $[u,v)$ if you select a denominator $ge frac1v-u$. You can use Farey sequence methods to find the fractions of minimal denominator that are within this range as well as all fractions with denominators $<frac1v-u$ in the range:
Start with the (very rough) approximation $frac 01<u<vle frac 11$. Now as long as you have an approximation $frac ab<u<vle frac cd$ compute the Farey sum $fraca+cb+d$; it is the only rational number between $frac ab$ and $frac cd$ with a denominator $le b+d$. If $fraca+c b+d<u$, replace $frac ab$ with $fraca+cb+d$; if $fraca+cb+dge v$, replace $frac cd$ with $fraca+cb+d$; otherwise you have the simplest candidate for a rational number corresponding to $47.4%$. If you check the other percentages, you may either find that the same denominator works for it or not.
You can continue to enumerate all feasible fractions ordered by ascending denominator:
We meanwhile have fractions
$$frac p_0q_0<ule frac p_1q_1<ldots <fracp_mq_m <vle frac p_m+1q_m+1$$
for some $mge 1$.
Determine $0le ile m$ such that $q_i+q_i+1$ is minimal and insert the Farey sum $fracp_i+p_i+1q_i+q_i+1$ into the sequence (kicking out $fracp_0q_0$ if it is $<u$, kicking out $frac p_m+1q_m+1$ if it is $ge v$, otherwise adding a new valid fration to our list). Repeat this until the next fraction would have denominator $ge frac1v-u$.
For each found fraction in $[u,v)$ check if the other percentages also allow this denominator (and there can be at most one matching numerator).
Example: With the above method, the fractions produced are (in this order) $frac 12, frac13, frac25, frac37,frac49,frac511,frac613,frac715,frac817$, after which we arrive at
$$tfrac01<tfrac13<tfrac25<tfrac37<tfrac49<tfrac511<tfrac613<tfrac715< frac817<ule frac 919<vle frac 12<tfrac11,$$
(fractions that got rejected are shown in smaller type) thus the first candidate is $frac919$. Next, we'll replace $frac12$ with $frac1021$, then $frac817$ with $frac1736$, then find $frac1940$ on the right, $frac2655$ on the left and again $frac2859$ on the right, then $frac3574$ on the left. The next step produces $frac3778$, which does lie in the interval and thus gives us the next smallest solution (apart from writing $frac919$ in non-smallest terms):
$$tfrac817<tfrac1736<tfrac2655<frac3574<ule frac 919<frac3778<vle frac 2859<tfrac1940<tfrac1021<tfrac12,$$
so it does take a few steps to find the next fraction in $[u,v)$. Next come $frac4493$ and then $frac4697$:
$$tfrac3574<frac4493<ule frac919<frac4697<frac3778<vle frac2859 $$
and then after a few more steps
$$tag1tfrac4493<tfrac53112<frac62131<ule frac919<frac64135<frac55116<frac4697<frac3778<frac65137<vle frac2859.$$
For completeness, this should be repeated until we reach denominators $ge 1000$.
Do the same with $26.3%$, i.e. with $u=0.2625$, $v=0.2635$:
$$tag2 tfrac01<tfrac14< tfrac623<tfrac1142<frac1661<ulefrac2180<frac519 <vle tfrac1972<tfrac1453<tfrac934<tfrac415<tfrac311<ldots$$
(merely continued until we find at least one more fraction in the interval).
By sheer luck, we find the same denominator $19$ in both (1) and (2), thus giving us an immediate solution $9:5:5$, as well as all multiples $18:10:10$, $27:15:15$ and so on.
But we may just as well and have to if there is no common denominator) pick any valid fraction from (1), any valid fraction from (2) and bring them to the $operatornamelcm$ of the denominators. For example $frac55116$ and $frac2180$ give us the solution $1100:609:611 $, which however is bad for one reasons: The $operatornamelcm$ is $2320>1000$, i.e. so big that we are in the realm of arbitrary denominators anyway.
At any rate, (1) alone shows that the next simplest solutions are with denominators $78, 97$ and then $>100$, but as (2) supports neither $78$ nor $97$, so that there definitely cannot exist any other small solution (less than $100$ people) apart from $9:5:5$ and its multiples.
$endgroup$
By rounding rules you know that the first value is somewhere between $u=0.4735$ and $v=0.4745$. Of course you can always find a valid fraction in $[u,v)$ if you select a denominator $ge frac1v-u$. You can use Farey sequence methods to find the fractions of minimal denominator that are within this range as well as all fractions with denominators $<frac1v-u$ in the range:
Start with the (very rough) approximation $frac 01<u<vle frac 11$. Now as long as you have an approximation $frac ab<u<vle frac cd$ compute the Farey sum $fraca+cb+d$; it is the only rational number between $frac ab$ and $frac cd$ with a denominator $le b+d$. If $fraca+c b+d<u$, replace $frac ab$ with $fraca+cb+d$; if $fraca+cb+dge v$, replace $frac cd$ with $fraca+cb+d$; otherwise you have the simplest candidate for a rational number corresponding to $47.4%$. If you check the other percentages, you may either find that the same denominator works for it or not.
You can continue to enumerate all feasible fractions ordered by ascending denominator:
We meanwhile have fractions
$$frac p_0q_0<ule frac p_1q_1<ldots <fracp_mq_m <vle frac p_m+1q_m+1$$
for some $mge 1$.
Determine $0le ile m$ such that $q_i+q_i+1$ is minimal and insert the Farey sum $fracp_i+p_i+1q_i+q_i+1$ into the sequence (kicking out $fracp_0q_0$ if it is $<u$, kicking out $frac p_m+1q_m+1$ if it is $ge v$, otherwise adding a new valid fration to our list). Repeat this until the next fraction would have denominator $ge frac1v-u$.
For each found fraction in $[u,v)$ check if the other percentages also allow this denominator (and there can be at most one matching numerator).
Example: With the above method, the fractions produced are (in this order) $frac 12, frac13, frac25, frac37,frac49,frac511,frac613,frac715,frac817$, after which we arrive at
$$tfrac01<tfrac13<tfrac25<tfrac37<tfrac49<tfrac511<tfrac613<tfrac715< frac817<ule frac 919<vle frac 12<tfrac11,$$
(fractions that got rejected are shown in smaller type) thus the first candidate is $frac919$. Next, we'll replace $frac12$ with $frac1021$, then $frac817$ with $frac1736$, then find $frac1940$ on the right, $frac2655$ on the left and again $frac2859$ on the right, then $frac3574$ on the left. The next step produces $frac3778$, which does lie in the interval and thus gives us the next smallest solution (apart from writing $frac919$ in non-smallest terms):
$$tfrac817<tfrac1736<tfrac2655<frac3574<ule frac 919<frac3778<vle frac 2859<tfrac1940<tfrac1021<tfrac12,$$
so it does take a few steps to find the next fraction in $[u,v)$. Next come $frac4493$ and then $frac4697$:
$$tfrac3574<frac4493<ule frac919<frac4697<frac3778<vle frac2859 $$
and then after a few more steps
$$tag1tfrac4493<tfrac53112<frac62131<ule frac919<frac64135<frac55116<frac4697<frac3778<frac65137<vle frac2859.$$
For completeness, this should be repeated until we reach denominators $ge 1000$.
Do the same with $26.3%$, i.e. with $u=0.2625$, $v=0.2635$:
$$tag2 tfrac01<tfrac14< tfrac623<tfrac1142<frac1661<ulefrac2180<frac519 <vle tfrac1972<tfrac1453<tfrac934<tfrac415<tfrac311<ldots$$
(merely continued until we find at least one more fraction in the interval).
By sheer luck, we find the same denominator $19$ in both (1) and (2), thus giving us an immediate solution $9:5:5$, as well as all multiples $18:10:10$, $27:15:15$ and so on.
But we may just as well and have to if there is no common denominator) pick any valid fraction from (1), any valid fraction from (2) and bring them to the $operatornamelcm$ of the denominators. For example $frac55116$ and $frac2180$ give us the solution $1100:609:611 $, which however is bad for one reasons: The $operatornamelcm$ is $2320>1000$, i.e. so big that we are in the realm of arbitrary denominators anyway.
At any rate, (1) alone shows that the next simplest solutions are with denominators $78, 97$ and then $>100$, but as (2) supports neither $78$ nor $97$, so that there definitely cannot exist any other small solution (less than $100$ people) apart from $9:5:5$ and its multiples.
edited Mar 25 at 2:37
Martin Sleziak
45k10122277
45k10122277
answered Feb 1 '13 at 18:25
Hagen von EitzenHagen von Eitzen
283k23273508
283k23273508
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f292238%2fhow-to-find-whole-number-ratios-from-percentages%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown