GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,755
Rep:
A mathematics question
I was trying to think of how I would calculate how long it would take me to get to 5000 posts based on how long I've been a member here and how many posts I've already made/make on average. But I really have no idea how I would work that out, but figure there must be a way, even if it's not 100% exact.
I should say that mathematics just isn't my strong suit, so please be clear in any answers given.
In any case, I'd like to know the calculation I'd have to make to work it out, not be given a time of how long it would take me to reach 5000 posts based on my current posting rate - I want to work out the answer myself, but I need some help to know how I figure it out. I'm not looking for any debates on the "best way" to do it; I'd just like to know a way(s) to calculate the answer.
According to vBulletin my "Posts Per Day" average is 0.86, if that's important to how I figure out the answer to my question (I think I know how it's calculates that for the record).
You have 3726 posts and joined March of 2009. So if in 143 months you made 3726 posts you average 3726/143 or ~26 posts per month. To get to 5000 you need 5000 - 3726 or 1274. At your current average rate it might take about 1276 / 26 or 49 months. That would be about 4 years (and one month) so march of 2025 might be a reasonable expectation. Naturally any change in average behavior could slow or accelerate the process, and the math is imprecise because the numbers are imprecise.
I did teach secondary field Mathematics and Science for some time, and this sounds exactly like the kind of question I might have put on a quiz (were I still teaching and giving quizes). It does not require very much mathematics skill, but does require that you think about how to approach the problem in the most simple way. I hope this has helped.
Example:
Calculate number of days, weeks, months, years, using posts per day.
Code:
start=3726
end=5000
diff=$(($end - $start))
#Per day, week, month, year
for i in {1..30}; do
echo "Needed for 5000"
echo "With an average "$i" posts per day."
a=$(("$diff"000/"$i"))
echo ""${a:0:-3}.${a: -3}" days to "$end""
b=$((("$diff"000/7)/"$i"))
echo ""${b:0:-3}.${b: -3}" weeks to "$end""
c=$((("$diff"000/30)/"$i"))
echo ""${c:0:-3}.${c: -3}" months to "$end""
d=$((("$diff"000/365)/"$i"))
echo ""${d:0:-3}.${d: -3}" years to "$end""
echo -e ''$_{1..40}'\b─'
done
If the average number of posts were a decimal number per day.
Code:
start=3726
end=5000
diff=$(($end - $start))
avpost=(.1 .2 .3 .4 .5 .6 .7 .8 .9)
for i in "${avpost[@]}"; do
echo "Needed for 5000"
echo "With an average "$i" posts per day."
n=${i:1:2}
a=$(("$diff"000/"$n"))
echo ""${a:0:-2}.${a: -2}" days for "$end""
b=$((("$diff"000/7)/"$n"))
echo ""${b:0:-2}.${b: -2}" weeks for "$end""
c=$((("$diff"000/30)/"$n"))
echo ""${c:0:-2}.${c: -2}" months for "$end""
d=$((("$diff"000/365)/"$n"))
echo ""${d:0:-2}.${d: -2}" years for "$end""
echo -e ''$_{1..40}'\b─'
done
You can also approach it from your posts/day figure:
Starting from the day you signed up, at 0.86 posts/day how long did it take you to post 86 times? 860 times? 1720 times? How many days in total to post 5000 times?
You've been posting for a while at an average 0.86 posts/day and you've posted 3727 times - how many days have you been posting?
It might look different, but this is basically what wpeckham said and the caveat they gave still applies.
(another ex-maths teacher, if you hadn't guessed by the way my answer was another question)
In any case, I'd like to know the calculation I'd have to make to work it out, not be given a time of how long it would take me to reach 5000 posts based on my current posting rate - I want to work out the answer myself, but I need some help to know how I figure it out. I'm not looking for any debates on the "best way" to do it; I'd just like to know a way(s) to calculate the answer.
( days / 5000 ) = ( number of days in forum now / total number of posts )
days = ( 5000 - number of posts now ) / posts per day
The expression is treated as if it were within double quotes, but a double quote inside the parentheses is not treated specially. All tokens in the expression undergo parameter and variable expansion, command substitution, and quote removal. The result is treated as the arithmetic expression to be evaluated.
The expression is treated as if it were within double quotes, but a double quote inside the parentheses is not treated specially. All tokens in the expression undergo parameter and variable expansion, command substitution, and quote removal. The result is treated as the arithmetic expression to be evaluated.
Which I take to mean a double quote is treated like any other character, i.e. not as an enclosing quote.
Did you try to run the script as posted? I get a bash error:
I was trying to think of how I would calculate how long it would take me to get to 5000 posts based on how long I've been a member here and how many posts I've already made/make on average. But I really have no idea how I would work that out, but figure there must be a way, even if it's not 100% exact.
The problem is a simple Progression problem but you're starting out half-baked as soon as you expect anything remotely "exact" when starting with an "average", especially when the progression extends into the future and is subject to change, and even more profoundly once a feedback loop is engaged. That's a far more complex equation.
Those scripts run fine for me. I tested them before posting.
Code:
Needed for 5000
With an average .1 posts per day.
12740.00 days for 5000
1820.00 weeks for 5000
424.66 months for 5000
34.90 years for 5000
────────────────────────────────────────
Needed for 5000
With an average .2 posts per day.
6370.00 days for 5000
910.00 weeks for 5000
212.33 months for 5000
17.45 years for 5000
────────────────────────────────────────
Needed for 5000
With an average .3 posts per day.
4246.66 days for 5000
606.66 weeks for 5000
141.55 months for 5000
...
Code:
bash -version
GNU bash, version 5.0.18(1)-release (x86_64-pc-linux-gnu)
...
If you run it line by line, by copying lines into the terminal, without the "$i", you'll get that, because there is no no "$i"
Code:
start=3726
end=5000
diff=$(($end - $start))
a=$(("$diff"000/"$i"))
echo ""${a:0:-3}.${a: -3}" days to "$end""
bash: 1274000/: syntax error: operand expected (error token is "/")
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,755
Original Poster
Rep:
wpeckham,
Thanks for that, it's really helpful. I was thinking that division had to be involved, but I just could figure out what the process(s) was though.
teckk,
I'm afraid my bash scripting skills aren't nearly as good as yours are. I do know that bash scripts can use variables and loops, like for loops and while loops, etc - although I also know that a bash script really just calls the for and while executables, and therefore the for and while loops aren't actually bash builtin commands (if my understanding is correct of course). Whereas, in something like C, they are a part of the language, not separate executables called by the compiler.
I could probably write a for loop in C for example based on what wpeckham said about the process to get to an answer to my question (even if it's imprecise as they point out). But my bash scripting capabilities would be too lacking to do the same in a bash script. I think I have some bash scripting tutorials somewhere or bookmarked, but I just never seem to find the time to learn it properly. But I'll have a look at your script later on anyhow.
fido_dogstoyevsky,
I think I'm too dumb to understand your post to a large extent. But thanks anyway.
rtmistler,
Thank you RT, I think I get what you're saying, thanks again.
astrogeek,
Funny you talk about parentheses, as I had trouble getting ffmpeg to convert a video the other day because bash couldn't understand the parentheses in the filename. I ended up just taking the easy way out and got rid of the parentheses in the filename - although as far as I know parentheses aren't illegal in a filename on an ext4 filesystem - so donno what bash's problem was there.
Quote:
Originally Posted by enorbet
The problem is a simple Progression problem but you're starting out half-baked as soon as you expect anything remotely "exact" when starting with an "average", especially when the progression extends into the future and is subject to change, and even more profoundly once a feedback loop is engaged. That's a far more complex equation.
Yes, that's why I said "even if it's not 100% exact" in the OP, and wpeckham also pointed it out, in that; if I were to post more or less, it would affect the answer.
Although, not really sure what you mean by "feedback loop"? Again, you'll have to forgive my lack of mathematical understanding, as it's far from the greatest.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.