Well, maybe what you did is correct, but here's a better way...
I'm having some doubts with the following problem:
Let X denote the execution time of a job rounded to the nearest second. The charges are based on a linear function Y = mX + n of the execution time for suitably chosen nonnegative integers m and n. Given the PGF (probability generating function) of X, find the PGF and pmf of Y.
I will write (shorty) what I have tried. If someone could confirm my solution or give me some hint I would appreciate that.
I started with
Hence we have that . By the euclidian algorithm exist k and r<m such that and since the time is rounded to the nearest second I considered for
With this I got
And then using the sum of the geometric progression and rearranging the terms I got
p.s. sorry for my English.
I have an intuitive idea (and this doesn't include you have done) about expectation, but in the book that I'm using it is only treated in chapter 4, and I'm in chapter 2.
Also does your solution takes into account the fact that X takes only integers values, and that non integers are rounded?
p.s. Doing exercises late at night is not good. Plugging m=1 and n=0 in my formula clearly shows that there is a problem with my result.
The probability generating function only holds if X has integer values. And the properties of the expectation hold whether X is an integer or not.Also does your solution takes into account the fact that X takes only integers values, and that non integers are rounded?
Okay then it looks like you can't really use the properties of expectation...
Your problem is that if Y=mX+n, with m and n integers, then Y doesn't take all the nonnegative integer values ! So in your sum there will be some (many) i such that .
Which makes your final result quite false
Sorry I have to go (Chinese new year's eve ) so I'll explain you quickly.. Think that you make X vary and hence the pgf of Y is something like
Okay, so to be more precise... :
In general, when dealing with random variables, the first thing to do is to define the set in which it takes its values.
This is the set of values for Y.
Let's assume that n<m, so that there is no redundancy (it's just more painful if it's not, but still doable)
So the probability generating function of Y will be :
Since n<m, for any , there is a unique k such that (Euclidean division, as you said)
So does it look logical to you that ?
Thank you, Moo.
Actually it's even simpler with your tip of defining the set because since and are fixed numbers regardless of whether or not.
So the outcome of any requires that the time taken is one and only one , which implies that the probability of the cost being is the same as the probability of the time being , i.e. .
My mistake was to make Y take on all integers value. Again thank you for your help!