Random Algorithm Number & Letter

For Number
The Algorithm Method is Pseudo Random Number Method.
This is i make for number algorithm number, and the idea from this picture


A lot of smart people actually spend a lot of time on good ways to pick pseudo-random numbers.  They try a bunch of different complicated formulas, and try to make sure that patterns don’t pop up.  But we can build a simple one pretty easily to pick pseudo-random numbers from 1 to 10.  Here it is, in the programming language Haskell:

Example :

1 --> 7
2 --> 3
3 --> 10
4 --> 6
5 --> 2
6 --> 9
7 --> 5
8 --> 1
9 --> 8
10 --> 4

How can that's number changes, it's simple, just used this algorithm : random n = (7 * n) mod 11
So the calculation is like this :
random 1
= (7 * 2) mod 11 
= 14 mod 11
make it simple :
14  mod 11
= 14/11 = 1.272...
= (1.272...)-1
= (0.272...)*11
= 3
The result is 3

For Letter
The Algorithm Method is : First - Last Method

For Letter :
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Z Y X W V U T S R Q P O N M L K J I H G F E D C B A


Example :
MAGIC
become
NZTRX
Blogger
Disqus
Pilih Sistem Komentar Yang Anda Sukai

Tidak ada komentar

- Dilarang meletakkan link aktif pada komentar (SPAM)
- Sopan dan komentar sesuai dengan topik
- Dilarang promosi tanpa izin dari pemilik akun blog, langsung dihapus.
- NO SARA
- Segera laporkan jika ada link atau gambar yang rusak.