Demo entry 6646149

c

   

Submitted by anonymous on Oct 15, 2017 at 15:01
Language: C. Code size: 424 Bytes.

r = 4					//Logistic参数
N = 64800 				//Logistic序列元素个数

sensitivity = 10^(-39)	//初值敏感度
a0 = rand()/INT_MAX;	// 生成区间(0,1)的随机数a0,作为第一个Logistic序列初值
b0 = x1 - sensitivity	//第二个Logistic序列初值

Common = 0 				//两个Logistic序列对应元素相同的个数
For i = 1 : n
	Ai= r * Ai-1 * (1 - Ai-1)
	Bi= r * Bi-1 * (1 - Bi-1)
	If((Ai > 0.5 And Bi > 0.5) Or (Ai < 0.5 And Bi < 0.5))
		Common = Common + 1
	End
End

Ratio = Common /N		//混沌序列差异率

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).