public:the_number_of_people_voted_in_an_instagram_poll
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
public:the_number_of_people_voted_in_an_instagram_poll [2019/04/12 12:34] – [Mathematical model of Instagram's polling feature] fangfufu | public:the_number_of_people_voted_in_an_instagram_poll [2019/04/12 13:30] – [Example scenario] fangfufu | ||
---|---|---|---|
Line 10: | Line 10: | ||
$$ poll(a,\ b) = \Big(nint(\frac{100a}{a+b}), | $$ poll(a,\ b) = \Big(nint(\frac{100a}{a+b}), | ||
- | where $nint$ is the nearest integer function, such that $nint(x)$ is the nearest integer to $x$. | + | where $a$ and $b$ are the number of audiences picked each of the option. |
- | The domain of $poll(a,\ b)$ is: $\mathbb{N}$. | + | ===== Solution strategy ===== |
+ | It is clear that $poll(a, b)$ has many-to-one mapping. This means that it cannot have an inverse function. The range of the function | ||
===== Matlab implementation ===== | ===== Matlab implementation ===== | ||
+ | I wrote the following Matlab functions to generate the look-up table and perform the search. The function '' | ||
+ | |||
<code matlab> | <code matlab> | ||
function [x] = IPRL(yes, total) | function [x] = IPRL(yes, total) | ||
%IPRL Instagram Poll Reverse Lookup | %IPRL Instagram Poll Reverse Lookup | ||
- | % Detailed explanation goes here | + | % Parameters : |
+ | % - yes : the number of audiences selected one of the options | ||
+ | % - total : the maximum potential number of audiences participated in the poll | ||
tbl = GenTable(total); | tbl = GenTable(total); | ||
[x, ~] = find(tbl == yes); | [x, ~] = find(tbl == yes); | ||
Line 23: | Line 28: | ||
function [tbl] = GenTable(n) | function [tbl] = GenTable(n) | ||
- | %GENTABLE Generate | + | %GENTABLE Generate |
tbl = zeros(n); | tbl = zeros(n); | ||
for i = 1:n | for i = 1:n | ||
Line 32: | Line 37: | ||
end | end | ||
</ | </ | ||
+ | |||
+ | ==== Example scenario ==== | ||
+ | I saw a poll with 27% of the users picked one option, and I suspect that maximum 30 users participated in the poll, so I run: | ||
+ | < | ||
+ | >> IPRL(27,30) | ||
+ | ans = | ||
+ | 11 | ||
+ | 15 | ||
+ | 22 | ||
+ | 26 | ||
+ | 30 | ||
+ | </ | ||
+ | |||
+ | Then I get a friend of mine to vote in the option that had 27%, and now it changes to 33%. | ||
+ | |||
+ | < | ||
+ | >> IPRL(33,30) | ||
+ | ans = | ||
+ | 3 | ||
+ | 6 | ||
+ | 9 | ||
+ | 12 | ||
+ | 15 | ||
+ | 18 | ||
+ | 21 | ||
+ | 24 | ||
+ | 27 | ||
+ | 30 | ||
+ | </ | ||
+ | |||
+ | It is clear that after I first voted, the number of participants could have been either 11 or 26. After my friend voted, the number of participants could have been 12 or 27. The idea is that the second look-up should produce numbers that have increased by 1, compared to the first look-up. However from personal experiences, | ||
+ | |||
+ | ===== Other Strategies and Future Improvement ===== | ||
+ | Perhaps I can record how the how the percentage number change over time, and automatically give a list of the most likely number. The number of participant monotonically increases over time. This property can help the search. Perhaps I can write a function that automate this process. | ||
+ | |||
+ | Finally, it would be great to implement this whole idea using Javascript, so people can run it without Matlab. | ||
+ | |||
+ | ===== Ethical Consideration ===== | ||
+ | Well, if you do not want people to find out how many people have voted in your poll, do not do an Instagram poll. This work does not gather more information than what is already in the public. | ||
+ | |||
+ | ===== Acknowledgement ===== | ||
+ | I came up with this idea, after seeing an Instagram poll from the girl who gave me a toblerone. So, thank you for the inspiration. :-) |
public/the_number_of_people_voted_in_an_instagram_poll.txt · Last modified: 2019/04/16 10:46 by fangfufu