Monday, April 28, 2014

Uniform random number generation in Computer

Let's, have a generator, Ui(Rmax+1), to generate uniform random integer r ∈ [0...Rmax].
We can construct Ui(N) in following way,

Ui(N) =
  1. Range = Rmax - ( Rmax )mod N
  2. do
    1. r = U(Rmax+1);
  3. while( r  ≥  Range );
  4. Return(r);
Similarly, we can further construct a real random number generator Ur(N), which generates random real r ∈ [0,1]. using  Ui(N).

Ur(N) = (N-1)/Ui(N);

Ber(p) = ( Ur(N) ≤ p ) + (Ur(N) > p) ;
Binomial(n,p) =
  1. y = 0
  2. for(i = 0; i < n; i = i + 1)
    1. y = y + Ber(p)
  3. Return y 

Tuesday, April 22, 2014

Fermat's Last Theorem

Pierre de Fermat in 1637, had made a conjecture that there is no integer a,b,c,n if n > 2 s.t an + bn = cn
become true.

This was open problem to prove through centuries. At last  Andrew Wiles had proved it in 1995. 
For n = 2 we have infinite many such tuple. But for n = 3 no such tuple exist.