From: fenthe@drycas.club.cc.cmu.edu
Newsgroups: rec.juggling
Subject: Siteswap valuer
Date: 6 Sep 92 23:30:46 GMT
Organization: Carnegie Mellon Computer Club


 Well, I gave this some thought and I think I've come up with at
least a start for this.

 Basically, to my way of thinking, the number of balls in a given
pattern makes far more difference than anything else; however, the
difference between consecutive throws should also be taken into
account (as throwing high then low from the same hand is difficult);
also, the length of the pattern, to allow for the increased
complexity. However, it's only the difference between consecutive
throws /from the same hand/ that matters; as, after all, in a shower,
whilst the throws may be very different, all one hand does is is to
shovel across, and one to throw high.

 The valuings that came out as roughly working out are:
   balls-3
 10	   x

 product of the difference between throws from the same hand,
fourth-rooted, and tweaked a bit (*) x
 
 the square root of the length of the pattern.

 (*) The tweaks are that the actual difference has 1 added to it; so
if there's no difference between two throws, it makes no difference
to the difficulty. Also, if a throw is a 0 or a 2, the difference is
automatically 2; otherwise, patterns such as 5 5 5 0 0 wind up with
overly large (IMHO) difficulties. The pattern is also put in twice;
this means that every pair of differences is covered (some twice,
unfortunately; this is fixable, but doesn't make that much
difference. Also, to keep the code below vaguely short, it's simpler
to leave it as this for now - I'll fix it for any final version that
might happen)

 So, for instance, 5 3 1 gets:
   0 
 10  x 4th-root-of(5x3x3x5) x sqrt(3) = 6.7
                   ^^^^^^^
                   these from: 5 3 1 5 3 1
              (5-1)+1 = 5      ^   ^
              (5-3)+1 = 3        ^   ^
              (3-1)+1 = 3          ^   ^
              (5-1)+1 = 5            ^   ^

 The C program below is almost certainly clearer than any of the
explanations I've come up with, and should be intelligible to anyone
who doesn't know C, with luck.

 It's minimalist; run it with command line arguments of the
site-swap you want to value; it doesn't check for validity at /all/,
and is easily fooled; for instance, 3 3 3 3 3 counts as harder than 3..

-----cuthere-----

#include <math.h>
#include <float.h>
#include <stdlib.h>

main(int argc, char *argv[])
{
	float val=1;
	int i,j,a[256],l,b=0,t1,t2;

	for(i=1;i<argc;i++)
	{
		a[i-1]=atoi(argv[i]);
	}

	l=argc-1;

	for(i=0;i<l;i++)
	{
		b+=a[i];
		a[i+l]=a[i];
	}

 	b/=l;
	val*=pow(10,(float)b-3);

	for(i=1;i<2*l-1;i++)
	{
		t1=a[i-1];
		t2=a[i+1];
		j=abs(t1-t2)+1;
		if (t1==0 || t2==0 || t1==2 || t2==2) j=2;
		val*=pow((float)j, .25);
	}

	val*=pow((float)l, .5);

	printf("Difficulty: %f",val);
}


-----cuthere-----

 To give a few examples of what this system gives:

pattern value
 3         1
 4         10
 5         100
    .etc.
 5 3 1     6.7
 4 4 1     4.9
 5 5 5 0 0 6.3
 7 1       14.1
 5 5 2     29.1
 5 5 5 1   66.9
 5 5 5 5 0 37.6

 These seem (to me) to be vaguely sensible ratings; certainly,
there's no major discrepancies between this and what I see as the
difficulties of the varying patterns. 

 It does undervalue showers, and whilst I suspect this is
surmountable, it seems to have unfortunate side-effects - any pattern
where one hand does the same thing every throw will suffer equally.
I've tried things such as adding in a factor for the difference
between the highest and lowest throws, and it's more trouble than
it's worth, frankly.. <grin>

 It also undervalues any pattern which is 'number with a hole';
5 5 5 5 0 gets too low a value, but this is one of the compromises
that seemed inevitable; without the 2/0 check, then 5 5 5 5 0 gets a
value of 85.7, which seems fairer; unfortunately, 5 5 5 0 0 gets 32.9,
which makes it far harder than it seems to merit, unfortunately..

 Anyway; what are people's thoughts about this method? It's pretty
much arbitrary, but there is a great deal of room for adjustments;
adding emphasis to the number of balls/pattern length/difference
between throws is all simple - adding new considerations should be
equally easy.

 Similarly, if the 2/0 removal seems unneeded, then that's equally
simple to do - if there's general approval, then I'll tidy this
version up, add checks and such, and put it on moocow. It seems like
something that would definitely benefit from some sort of public check
before that; I've almost certainly missed out something important
which I've completely overlooked..


--
Daniel Mitchell |fenthe@drycas.club.cc.cmu.edu| 18, High St
     aka        |m91djm@ecs.ox.ac.uk          | Earls Colne
Fenthe Marten   |dmitchell@cix.compulink.co.uk| Essex CO6 2PA
                `---bisexual furry juggler----' ENGLAND
Newsgroups: rec.juggling