I'm reading a specific excerpt from the Bible per week based on a schedule posted on jw.org .
I made a javascript script that takes the paragraphs and verses from each chapter and shows the sum of the verses.
So I have this entry: (The excerpts are divided into paragraphs, and the number in parentheses is the number of verses.)
1:1 (1)
1:2-6 (5)
1:7-10 (4)
1:11-12 (2)
1:13-17 (5)
2:1-10 (10)
2:11-16 (6)
2:17-18 (2)
3:1-7 (7)
3:8-9 (2)
3:10-13 (4)
3:14 (1)
3:15-17 (3)
4:1 (1)
4:2-5 (4)
4:6 (1)
4:7 (1)
4:8 (1)
4:9-10 (2)
4:11-18 (8)
4:19-22 (4)
5:1-3 (3)
5:4-10 (7)
5:11-14 (4)
As I read in 7 days I need not only distribute the 74 verses for 7 days, but find the best stop between paragraphs.
How to decide the best stop between paragraphs? We should take the average number of verses per day. For example 14.6. So each day we will try to get as close to 14.6. If on a day the closer it is to 13, the next time we will try to get closer to 15.6. And so on. But ... doing this on paper you will realize that sometimes it is necessary to decide between reading less one day and more in another to later have a more balanced average.
Currently I'm doing this manually because I could not figure out an algorithm to do this.
But I'm going to use python to process the input and I'm thinking of doing a brute-force algorithm that will pick up all the possibilities of distributing the number of paragraphs in 7 sections, eg (3, 2, 3, 5, 5, 2, 3) That's what I found in my hand.
After I had these numbers I could pass on a function that would see what the best alternative was. But I do not know what algorithm to use to do this. Maybe the median algorithm ? The average is not because it will always give the same number.
I found this site: Purple Math that talks about "Mean, Median, Mode, and Range" (in English). I'm thinking of using all but the average to find the best value.
Does anyone have any tips?