I have a college job and it's hard to solve ... it's kind of the wordlists that hackers use, but it's for teaching.
QT: Generate a file with all possible groupings using the concept of simple arrangements in which we have n elements arranged p to p, with n> = p. Before generating the file, report an output saying how many arrangements and size the file has.Ex:
x Arrays have been generated and the file size is y (bytes, MB, GB, or ALSO). Do you want to continue, [S] im or [No]?
I do not even know how to start, because how do I calculate the total bytes without even having created the file. Complicated. The way I thought it was to compute the total of arrangements that would give "so many" lines and in each line would have 7 bytes, if each line is 7 bytes, multiply by the total of possible arrangements.
Formula:
A (n! / (n-p)!)
Ex:
A (22! / (22-7)!) = A (22! / (15)!) = 859.541.760 million words arranged 7 to 7 of 22 elements
Now I get this result and multiply by 7 that would give the total bytes and I would do the conversion to the other sizes. Now why did I multiply by 7? Because each character is 1 byte, taking the characters with accents and the arrangement of all lines are 7 characters long.
The same problem is this, calculate the file size.