brian bovril

914 Reputation

16 Badges

18 years, 164 days

MaplePrimes Activity


These are replies submitted by brian bovril

thanks 4 the code (and everyones responses)

i can't wait to play with it,  but am overseas (Bangers) at the moment with no access to Maple.

rgds

thanks 4 the code (and everyones responses)

i can't wait to play with it,  but am overseas (Bangers) at the moment with no access to Maple.

rgds

Sorry for being thick, but i wouldnt know how to code Floyd's Algorithm.

Sorry for being thick, but i wouldnt know how to code Floyd's Algorithm.

thanks everyone
along those lines
Thanks for the input!
thanks for the tip. the problem concerns minimizing the variance between table tennis teams. P is the players %age successs rate. rgds
thx for your efforts Roman
thanks
Fantastic. Does the method work when the solutions are probably not exact? Example for n teams (n<9) the following generates the objective function to minimize and the constraints: restart with(Statistics) Pl := [2, 6, 7, 8, 15, 16, 19, 21, 23, 25, 25, 27] k := Count(Pl) TeamNo := 1/4*k q := [a, b, c, d, e, f, g, h] T := seq(add(Pl[n]*seq(q[m][n], n = 1 .. k)[n], n = 1 .. k), m = 1 .. 8) Obj := add((1/4*T[n]-add(1/4*T[n], n = 1 .. TeamNo)/TeamNo)^2, n = 1 .. TeamNo) #Mind you I could try a variant on Obj to get rid of the squared function: # Obj2 := add(abs(1/4*T[n]-add(1/4*T[n], n = 1 .. TeamNo)/TeamNo), n = 1 .. #TeamNo) ConstCol := seq(add(seq(q[m][n], n = 1 .. k)[n], n = 1 .. k) = 4, m = 1 .. TeamNo) ConstRow := seq(add(q[m][n], m = 1 .. TeamNo) = 1, n = 1 .. k) ConstBin := seq(seq(seq(q[m][n], n = 1 .. k)[n]*(seq(q[m][n], n = 1 .. k)[n]-1) = 0, n = 1 .. k), m = 1 .. TeamNo) F := expand(map(lhs-rhs, [ConstCol, ConstRow, ConstBin])) #And I duplicated the below commands, modifying procedure M (please #check) #Basically the prime decomposition step takes forever. Maybe my #computer needs upgrading… I gave up getting a solution # factor the system of constraints with(PolynomialIdeals): infolevel[GroebnerBasis] := 4: J := PolynomialIdeal(F): P := Simplify(PrimeDecomposition(J)); # evaluate the function and sort by value S := seq(solve(Generators(i)), i=P); M := sort([seq([subs(i,Obj), i], i=S)], proc(a,b,c) evalb(a[1] < b[1]) end proc): M[1]; # min M[-1]; # max
Fantastic. Does the method work when the solutions are probably not exact? Example for n teams (n<9) the following generates the objective function to minimize and the constraints: restart with(Statistics) Pl := [2, 6, 7, 8, 15, 16, 19, 21, 23, 25, 25, 27] k := Count(Pl) TeamNo := 1/4*k q := [a, b, c, d, e, f, g, h] T := seq(add(Pl[n]*seq(q[m][n], n = 1 .. k)[n], n = 1 .. k), m = 1 .. 8) Obj := add((1/4*T[n]-add(1/4*T[n], n = 1 .. TeamNo)/TeamNo)^2, n = 1 .. TeamNo) #Mind you I could try a variant on Obj to get rid of the #squared function: # Obj2 := add(abs(1/4*T[n]-add(1/4*T[n], n = 1 .. TeamNo)/TeamNo), n = 1 .. TeamNo) ConstCol := seq(add(seq(q[m][n], n = 1 .. k)[n], n = 1 .. k) = 4, m = 1 .. TeamNo) ConstRow := seq(add(q[m][n], m = 1 .. TeamNo) = 1, n = 1 .. k) ConstBin := seq(seq(seq(q[m][n], n = 1 .. k)[n]*(seq(q[m][n], n = 1 .. k)[n]-1) = 0, n = 1 .. k), m = 1 .. TeamNo) F := expand(map(lhs-rhs, [ConstCol, ConstRow, ConstBin])) #And I duplicated the below commands, modifying procedure M (please check) #Basically the prime decomposition step takes forever. Maybe my #computer needs upgrading… I gave up getting a solution # factor the system of constraints with(PolynomialIdeals): infolevel[GroebnerBasis] := 4: J := PolynomialIdeal(F): P := Simplify(PrimeDecomposition(J)); # evaluate the function and sort by value S := seq(solve(Generators(i)), i=P); M := sort([seq([subs(i,Obj), i], i=S)], proc(a,b,c) evalb(a[1] < b[1]) end proc): M[1]; # min M[-1]; # max
First 23 24 25 26 Page 25 of 26