Last change
on this file since 403 was 2, checked in by Rick van der Zwet, 15 years ago |
Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)
|
File size:
312 bytes
|
Line | |
---|
1 | #!/usr/bin/env perl
|
---|
2 | from decimal import *
|
---|
3 |
|
---|
4 | # yi = 2xi - 1
|
---|
5 | def merit(y):
|
---|
6 | n = len(y)
|
---|
7 |
|
---|
8 |
|
---|
9 | e = Decimal(0)
|
---|
10 | for k in range(1,n):
|
---|
11 | t = 0
|
---|
12 | for i in range(0,n-k):
|
---|
13 | t += y[i] * y[i+k]
|
---|
14 | e += t ** 2
|
---|
15 | f = (n ** 2) / ( 2 * e)
|
---|
16 | return(f)
|
---|
17 |
|
---|
18 | y = [1,-1,1,-1]
|
---|
19 | print merit(y)
|
---|
20 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.