Expected value of random variables
I'm new to SAGE and just getting my feet wet. Would greatly appreciate if someone could point me to how to calculate the following using SAGE:
Say I have an event drawn from a Poisson distribution that happens on average once a year. I'd like to define a random variable and then calculate the following:
Probability the event will occur after 1 month (1/12th of a year)
Probability the event will not occur for 2 years but will occur during the third year.
I've searched unsuccessfully for how to do this and would greatly appreciate any help.
Is it homework ? Before trying to solve such a problem with Sage, how would you have solved it by hand ?
It’s not homework. I created the toy problem myself and can easily solve it by hand using the poisson equation (and it’s clear to me how to write code to do that in SAGE). I was just under the impression that there’s some library that will do all this for you in SAGE but maybe I’m wrong? Just want to reiterate this is a toy problem that I made to illustrate my question, which was mostly about SAGE’s built in support for reasoning with random variables.
Please then provide code that declares the distribution. Or just describe the model, the distribution exactly (in mathematical terms). There is a way from "Say I have an event drawn from a Poisson distribution that happens on average once a year" to a declared distribution of a random variable.