0

I don't know if the title is the most correct, if not I apologise.

I have a project with files that I have to translate, each file can vary in terms of the percentage that ALREADY HAS BEEN TRANSLATED, example:

  • File1: 38%
  • File2: 12%
  • File3: 94%
  • File4: 1%.

I would like to know what is the overall percentage of the project. I'm not very mathematically savvy, so I'm not doing much on my own, just the following:

t1 = (25 * 38) / 100
t2 = (25 * 12) / 100
t3 = (25 * 94) / 100
t4 = (25 * 1) / 100

25, according to my logic, represents the overall percentage that covers each file in the project, that was all I could do according to my little knowledge.

Jalkhov
  • 109
  • 1
    Well, if you know that all the files have equal size, this is fine. But do you know that? If, say, File $#3$ is very tiny compared to the others, then you would not want to weight it equally. – lulu Sep 16 '21 at 17:27
  • 1
    Are the files equal in size? If not, suppose you have a million-letter file 0% done, and a hundred-letter file 100% done. Do you think you are 50% done? – Jukka Kohonen Sep 16 '21 at 17:28
  • The files are indeed not the same size. – Jalkhov Sep 16 '21 at 18:54

1 Answers1

1

...25, according to my logic, represents the overall percentage that covers each file in the project...

A better way to do this (unless you know the four files are all the same size, and know you'll never have to add more files to the project later on) would be to use a metric like "file size" or "word count".

Then, you could define a number for the total size of the entire project $S_{T}$ by adding up sizes of the individual sub-projects:

$$S_T = S_1 +S_2 + S_3 + S_4 + \ ....$$

Then, you could define a number for the total size of the completed portions of the individual projects like so:

$$C_T = C_1 +C_2 + C_3 + C_4 + \ ....$$

where each $C_i=S_i\cdot(\frac{P_i}{100})$ is defined by the size of each sub-project multiplied by what percentage ($P_i$) of that sub-project is complete. In other words:

$$C_T = S_1\cdot(\frac{38}{100}) +S_2\cdot(\frac{12}{100}) + S_3\cdot(\frac{94}{100}) + S_4\cdot(\frac{1}{100}) + \ ....$$

Then, your overall project completion fraction is given by $C_T/S_T$ (and then multiplied by 100 to convert that to a percentage).

DotCounter
  • 1,139
  • Ok, I'm still a bit lost. The files vary in size, however I can easily get the size of the files (in bytes). Would that help in the equation? And indeed, the project can vary in the amount of files it has, specifically it can increase, but not decrease. – Jalkhov Sep 16 '21 at 18:50
  • 1
    Yeah, that's my point. Say that your four files take up 10KB, 20KB, 30KB, and 40KB of disk space. Then you have a total of 100KB worth of files to translate, right? And if the 10KB file is 38% done, then that's basically 3.8KB complete... and so on. – DotCounter Sep 16 '21 at 19:08