Distribution generator
Here is a simple generator which can build some distributions with given properties.
Distributions generator (compile with -lm)
Typical use might be:
./distributions -u -m 1 -M 10 -n 100 -s 500
Generates a distribution of 100 uniform random numbers between 1 and 10, such that the sum of numbers is 500.
./distributions -p -2.2 -m 1 -M 100 -n 200 -s 500
Idem with 200 numbers between 1 and 100 following a power law with exponent -
To date tests are still the best solution mankind has found to deliver working software.
This book is the sum of four years of research and practice in the testing
field. The practice comes from my IT consulting background, first at Octo Technology
and then at Pivolis the research comes from my involvement with open
source development at night and on weekends.
北京大學ACM比賽題目
In 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture:
Every even number greater than 4 can be
written as the sum of two odd prime numbers.
For example:
8 = 3 + 5. Both 3 and 5 are odd prime numbers.
20 = 3 + 17 = 7 + 13.
42 = 5 + 37 = 11 + 31 = 13 + 29 = 19 + 23.
Today it is still unproven whether the conjecture is right. (Oh wait, I have the proof of course, but it is too long to write it on the margin of this page.)
Anyway, your task is now to verify Goldbach s conjecture for all even numbers less than a million.
KMEANS Trains a k means cluster model.CENTRES = KMEANS(CENTRES, DATA, OPTIONS) uses the batch K-means
algorithm to set the centres of a cluster model. The matrix DATA
represents the data which is being clustered, with each row
corresponding to a vector. The sum of squares error function is used.
The point at which a local minimum is achieved is returned as
CENTRES.
ClustanGraphics聚類分析工具。提供了11種聚類算法。
Single Linkage (or Minimum Method, Nearest Neighbor)
Complete Linkage (or Maximum Method, Furthest Neighbor)
Average Linkage (UPGMA)
Weighted Average Linkage (WPGMA)
Mean Proximity
Centroid (UPGMC)
Median (WPGMC)
Increase in Sum of Squares (Ward s Method)
Sum of Squares
Flexible (ß space distortion parameter)
Density (or k-linkage, density-seeking mode analysis)
Genetic Algorithm example using Java
You have 10 cards numbered 1 to 10.
You have to divide them into 2 piles so that:
The sum of the first pile is as close as possible to 36 and the product of all in second pile is as close as poss to 360.