Is it valid to simulate a Poisson process with a sequence of Bernoulli trials? In order to better understand some statistical concepts I generally try to run simulations to get to those results and see how the results match the theory.
While reviewing the Poisson and the Exponential distributions I decided to simulate a Poisson process following my understanding of it. However I ended up using Bernoulli trials and I have doubts I might be missing something.
As far as I understood the idea behind this model is that we have some events occurring at an average constant rate, so that on any time slot $t$ (of fixed size $s$) we have on average $\lambda$ events ocurring.
To replicate this scenario I ended up using a sequence of Bernoulli trials $B_1, B_2,... B_n$ with probability $\lambda/s$. Then, for every timestamp $t_i$ if $B_{t_i}$ = 1 then the event takes place, otherwise that timestamp is spent waiting.
In this way I feel I ensure a constant rate and it also seems that the results I get are in line with the probability mass function of a random variable $\sim Poisson(\lambda)$, which is where I wanted to get. However, I cannot stop thinking that I am using Bernoulli trials and that maybe I am rather modelling a Bernoulli process, making a small conceptual mistake somewhere.
Can someone tell me if my implementation is wrong and where?

Your simulation looks like a good approximation of a Poisson process. Of course, it can only be an approximation since the Poisson process is a continuous process while your simulation is discrete.
A case in point is the event count random variable for any given interval, which, as you have mentioned, would have to be Poisson and thus give positive probabilities for arbitrarily large counts. Your simulation can only approximate this. But, of course, no simulation would be able to accurately produce this behavior.
Another possibility to simulate a Poisson process would be to use the fact that the length of the time interval between two consecutive events would be an exponential random variable. So you might sample from the exponential distribution and simulate the time of the $k$th event as the sum of your first $k$ samples from the exponential random variable.
