I am summing over percentages list Per = [5,6,1,4] this list has 4 elemets so I am summing as follows :
$\sum_{i=1}^{4} per(i)$
the sum is 16 and the half of this sum is 8
$1/2\sum_{i=1}^{4} per(i)$
now I want to sum over the same list to find a k index such that at which the sum >= the half like this
$\sum_{i=1}^{k} per(i)$
so in this example the k=2 since 5+6 >= 8
is there a mathematical formula I can represent k with ? in the form k= ....
instead of having it in the upper limit ?
It should work for any list of any size. I just provided the 4 element list as an example
Asked
Active
Viewed 24 times
0
Cav
- 37
-
No, there is no such closed formula that works for any list, as you can "craft" lists that will give difference $k$ values. Consider the four lists: $[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]$. If this is about programming, you can use two pointers to find $k$. – Gareth Ma May 10 '22 at 01:17
-
Or perhaps if you just want to write it as mathematical notation, you can write $k = \inf {i \leq n : 2\sum_{i=1}^i per(i) \geq \sum_{i=1}^n per(i) }$ – Gareth Ma May 10 '22 at 01:19
-
the list is constant I wont craft ir and the elements are in the same place – Cav May 10 '22 at 01:19
-
@Gareth Ma yeah I want to write it as mathematical notation. can u please explain what you have written ? – Cav May 10 '22 at 01:21
-
$\inf$ means minimum of the list. You can read on infimum online. – Gareth Ma May 10 '22 at 01:21
-
what about the others in the braces ? – Cav May 10 '22 at 01:22
-
You use the same notation so I believe you will understand it if you spend more than half a minute and try to understand. – Gareth Ma May 10 '22 at 01:23
-
@Gareth Ma I am not a mathematician so why are u finding the minimum ? and the first summation you wrote is from i to i is that correct ? – Cav May 10 '22 at 01:32
-
Well, when you said "find a k index" I assumed you want to find the minimum, and it always exists anyways. The i to i is a typo, every i except for the upper bound should be another variable $j$ – Gareth Ma May 10 '22 at 01:34
-
minimum of what ? can u please clarify ? – Cav May 10 '22 at 02:23