```
BeginPackage["CubicTheta`"];
Unprotect[CubicTheta, CubicThetaA, CubicThetaB, CubicThetaC, CubicThetaAPrime, CubicThetaBPrime, CubicThetaCPrime];
ClearAll[CubicTheta, CubicThetaA, CubicThetaB, CubicThetaC, CubicThetaAPrime, CubicThetaBPrime, CubicThetaCPrime];
Begin["`Private`"];
CubicTheta[u_, v_, q_] /;
(VectorQ[{u, v, q}, NumericQ] && Abs[q] < 1 && Precision[{u, v, q}] < Infinity) :=
Module[{p = q^3, t, a = u + v, b = u - v},
t = EllipticTheta[3, a, p]*EllipticTheta[3, b, q];
If[!PossibleZeroQ[p], t += EllipticTheta[2, a, p]*EllipticTheta[2, b, q]*q/(p^(1/4)*q^(1/4))];
Return[t];
];
CubicThetaA[q_] /;
(NumericQ[q] && Abs[q] < 1 && Precision[q] < Infinity) :=
(QPochhammer[q]^3 + 9*q*QPochhammer[q^9]^3) / QPochhammer[q^3];
CubicThetaA /: HoldPattern[Derivative[n_][CubicThetaA]] /; n > 0 := Derivative[n - 1][CubicThetaAPrime];
CubicThetaB[q_] /;
(NumericQ[q] && Abs[q] < 1 && Precision[q] < Infinity) :=
QPochhammer[q]^3 / QPochhammer[q^3];
CubicThetaB /: HoldPattern[Derivative[n_][CubicThetaB]] /; n > 0 := Derivative[n - 1][CubicThetaBPrime];
CubicThetaC[q_] /;
(NumericQ[q] && Abs[q] < 1 && Precision[q] < Infinity) :=
3 * q^(1/3) * QPochhammer[q^3]^3 / QPochhammer[q];
CubicThetaC /: HoldPattern[Derivative[n_][CubicThetaC]] /; n > 0 := Derivative[n - 1][CubicThetaCPrime];
CubicThetaAPrime[q_] /;
(NumericQ[q] && Abs[q] < 1 && Precision[q] < Infinity) :=
With[{a = CubicThetaA[q], c = CubicThetaC[q]},
(c^3/3 - a^3/12 + a*WeierstrassZeta[1, WeierstrassInvariants[{1, -I*Log[q]/(2*Pi)}]]/Pi^2)/q
];
CubicThetaAPrime /: HoldPattern[Derivative[1][CubicThetaAPrime]] :=
(With[{a = CubicThetaA[#], b = CubicThetaB[#], c = CubicThetaC[#], ap = CubicThetaAPrime[#]},
2*b^3*c^3/(a*(3*#)^2) - ap/# + 2*ap^2/a
] &);
CubicThetaBPrime[q_] /;
(NumericQ[q] && Abs[q] < 1 && Precision[q] < Infinity) :=
With[{a = CubicThetaA[q], b = CubicThetaB[q]},
b*(-a^2/12 + WeierstrassZeta[1, WeierstrassInvariants[{1, -I*Log[q]/(2*Pi)}]]/Pi^2)/q
];
CubicThetaBPrime /: HoldPattern[Derivative[1][CubicThetaBPrime]] :=
(With[{a = CubicThetaA[#], b = CubicThetaB[#], c = CubicThetaC[#], bp = CubicThetaBPrime[#]},
-a*b*c^3/(3*#)^2 - bp/# + 2*bp^2/b
] &);
CubicThetaCPrime[q_] /;
(NumericQ[q] && Abs[q] < 1 && Precision[q] < Infinity) :=
With[{a = CubicThetaA[q], c = CubicThetaC[q]},
c*(a^2/4 + WeierstrassZeta[1, WeierstrassInvariants[{1, -I*Log[q]/(2*Pi)}]]/Pi^2)/q
];
CubicThetaCPrime /: HoldPattern[Derivative[1][CubicThetaCPrime]] :=
(With[{a = CubicThetaA[#], b = CubicThetaB[#], c = CubicThetaC[#], cp = CubicThetaCPrime[#]},
-a*b^3*c/(3*#)^2 - cp/# + 2*cp^2/c
] &);
End[];
SetAttributes[{CubicTheta, CubicThetaA, CubicThetaB, CubicThetaC, CubicThetaAPrime, CubicThetaBPrime, CubicThetaCPrime}, {Listable, NumericFunction, ReadProtected}];
Protect[CubicTheta, CubicThetaA, CubicThetaB, CubicThetaC, CubicThetaAPrime, CubicThetaBPrime, CubicThetaCPrime];
EndPackage[];
```

]]>

The 80 by 80 matrix can be downloaded from here: matrix.txt

I solved it in Excel (spreadsheet), borrowing from the logic of my Excel solution for problem #81.

It was only marginally more challenging than #81 in Excel.

]]>

The 80 by 80 matrix can be downloaded from here: matrix.txt.

I solved it in Excel (spreadsheet), borrowing from the logic of my Excel solution for problem #81.

]]>

The 80 by 80 matrix can be downloaded from here: matrix.txt.

I managed to solve this one in Excel (spreadsheet). Had to google for a logic clue first, though, after failing with my attempts at M & BASIC code.

]]>

Not too big for my freeware Just BASIC program, though.

That's how I first solved it in M, but later improved it to follow the more standard M way with their functions.

]]>Problem 6 looked really easy so I solved it first.

Yes, that fell into place quite quickly in Excel.

M took me a bit longer to suss out, though.

]]>I did problem 2 on Excel too, manually. There are only 32 terms of that Fibonacci sequence less than four million.

Yes, I solved it with Excel...and just now in Mathematica.

]]>A way to do problem 8 occurred to me. Let's give it a go.

Edit: Problem 8 done. Still no coding used.

I solved it in Excel (spreadsheet), and this morning I worked out an M solution.

]]>Problem 11 could be done on Excel but I think it would take annoyingly long if I'm not missing something. I'm going to go ahead and guess that it's the diagonal 89 * 94 * 97 * 87.

That's what I got, using Excel.

Copy/paste into Excel via the Wizard refused to work, but first pasting into Notepad++ and then copy/paste from there woke the Wizard up, and the grid copied over properly with the numbers in their respective cells.

That helped greatly with finding the solution via formulas that I could copy/drag with the fill handle.

]]>I hope that this thread goes into the correct subforum - I was not sure where else to put it.

I’m not exactly a mathematician—more of a chemist who dabbles in coding and chess on the side. My chess club is gearing up to host a bughouse chess competition, which, if you’re not familiar, is a fun, fast-paced 2v2 version of chess (played on two boards in parallel).

Here’s our challenge: We want to pull off this 2v2 tournament but also come up with individual player rankings. We’re thinking of adapting a Swiss system where, besides getting a new opponent each round, players also get assigned a new partner. Wins and losses score points for both players in a team—1 point for a win, 0 for a loss. The trick is to set it up so that nobody teams up more than once or faces the same opponents too often (once as a partner and once as an opponent is okay).

This kind of setup already exists and is called "Draw Your Partner" (DYP), or "MonsterDYP" when you switch partners every round. But the random partner draw these systems use seems a bit hit-or-miss for our needs.

Here’s where I’m stuck: I understand how Swiss draws typically work—pairing the top player with the lowest-ranked player who has the same number of points and then working your way through the list. Last year we hosted such a tournament where I had the Swiss Algorithm implemented in a way, that it would first make pairs and then match the pairs against each other. The partner-search was done via Swiss Draw, while the Opponent search was trying to find the best matching ranking average between partners (like teaming up No. 1 and 4 to face No. 2 and 3).

For this year, I want to develop a system that's truly fair, but I'm hitting a wall figuring out the best approach. I’ve searched the internet looking for some game theory insights or related strategies, but haven’t found much that helps.

Does anyone here have experience with tweaking the Swiss system for 2v2 settings, or know of any resources that might shed some light on this? I’d really appreciate any advice or ideas on how to make the tournament as fair as possible.

Things I thought of for partner search:

*) Halving the field - Let the top seed from top half play with the best available seed from bottom half and so on. (So far I guess this is the best idea)

*) Having the top seed play with the bottom seed (not sure if this is fun for the good players to always have bad partners)

*) Find the opponent for each player first, then match opponent-pairs with each other so that the become partners. (Also very promising - however i am not sure on what criteria to judge matching of the opponent-pairs?)

Thanks in advance for your help!

Christoph

For the first value in the sequence (check #1), calculate it as follows:

Multiply the number of items by the number of checks per item.

Divide the result by 2.

For the second value in the sequence (check #2), calculate it as follows:

Multiply the number of items by the number of checks per item.

Divide the result by 2.

Add 1 to the result obtained from step 2.

Using this algorithm, you can determine the 2-sequence numbers for each check in the scenario provided.

In working through this mathematical problem, it's clear that precision and accuracy are key. For those seeking assistance or guidance with such calculations, I will suggest you **avoid** at all costs the **maths assignment help** website that can be incredibly valuable to them as they think it's ok to get free advertising here. Also, you can contact them at **more spam**.

Note by admin. I have deleted this 'person' twice before but 'he' keeps returning to advertise their assignment help company. For the following reasons I strongly recommend you to avoid them: (1) It looks like they use AI bots to generate the work. An AI detection site gives a high probability of this. It will be easy for a tutor to detect this by the same means so you will score zero. (2) Their 5 star recommendations also get a highly likely score for being robot generated. (3) They won't talk to me properly so I can stop them breaking our rules by trying to get free advertising. (4) You cannot contact a real person. When I had a chat with their robot Amy (who claims to be a manager) 'she' agreed to pay me $2000 for each month that they advertise here. Hmmm. Tempting. I wonder if that is legally binding? Watch this space.

]]>```
{
my(
isreal=((x)->my(t=type(x));t=="t_INT"||t=="t_FRAC"||t=="t_REAL"),
isscalar=((x)->my(t=type(x));t=="t_INT"||t=="t_FRAC"||t=="t_REAL"||t=="t_COMPLEX"),
isquaternion=((x)->my(t=type(x));if(t=="t_COL"&&#x==4,for(i=1,4,if(!isreal(x[i]),return(0)));1,0)),
isvalid=((x)->isscalar(x)||isquaternion(x)),
toquaternion=((x)->if(isquaternion(x),x,isscalar(x),[real(x),imag(x),0,0],[])),
Qapply_=((f,x)->if(isscalar(x),f(x),isquaternion(x),my(v=x[^1],r=norml2(v)^(1/2),res=f(x[1]+I*r));concat(real(res),imag(res)*if(r,v/r,[1,0,0]~)),error("invalid type in Qapply")))
);
Qabs=((x)->if(isscalar(x),abs(x),isquaternion(x),norml2(x)^(1/2),error("invalid type in Qabs")));
Qadd=((x,y)->if(isvalid(x)&&isvalid(y),algadd(,x,y),error("invalid type in Qadd")));
Qapply=Qapply_;
Qarg=((x)->if(isscalar(x),arg(x),isquaternion(x),arg(x[1]+I*norml2(x[^1])^(1/2)),error("invalid type in Qarg")));
Qconj=((x)->if(isscalar(x),conj(x),isquaternion(x),concat(x[1],-x[^1]),error("invalid type in Qconj")));
Qdivl=((x,y)->if(isvalid(x)&&isvalid(y),algdivl(,x,y),error("invalid type in Qdivl")));
Qdivr=((x,y)->if(isvalid(x)&&isvalid(y),algdivr(,x,y),error("invalid type in Qdivr")));
Qinv=((x)->if(isvalid(x),alginv(,x),error("invalid type in Qinv")));
Qmul=((x,y)->if(isvalid(x)&&isvalid(y),algmul(,x,y),error("invalid type in Qmul")));
Qneg=((x)->if(isvalid(x),algneg(,x),error("invalid type in Qneg")));
Qpoleval=((T,x)->if(isvalid(x),algpoleval(,T,x),error("invalid type in Qpoleval")));
Qpow=((x,y)->if(type(y)=="t_INT",if(isvalid(x),return(algpow(,x,y))),isscalar(x)&&isscalar(y),return(x^y),isreal(y),if(isvalid(x),return(Qapply_((x)->x^y,x))),isreal(x),if(isvalid(y),return(Qapply_((y)->x^y,y))));error("invalid type in Qpow"));
Qreal=((x)->if(isscalar(x),real(x),isquaternion(x),x[1],error("invalid type in Qreal")));
Qsign=((x)->if(isreal(x),sign(x),isvalid(x),if(x,x/norml2(x)^(1/2),0*x),error("invalid type in Qsign")));
Qslerp=((x,y,t)->if(isvalid(x)&&isvalid(y)&&isreal(t),if(t===0,x,t===1,y,if(norml2(x)<norml2(y),[x,y,t]=[y,x,1-t]);algmul(,x,Qapply_((x)->x^t,algdivl(,x,y)))),error("invalid type in Qslerp")));
Qslerpinv=((x,y,z)->x=toquaternion(x);y=toquaternion(y);z=toquaternion(z);if(x==[]||y==[]||z==[],error("invalid type in Qslerpinv"));my(a,b,c,d,na,nb,nc,nx,nx2);nx2=norml2(x);nx=sqrt(nx2);na=x*y~;nb=x*z~;a=x*(na/nx2);b=x*(nb/nx2);c=y-a;d=z-b;na/=nx;nb/=nx;nc=sqrt(norml2(c));arg(nb+I*if(nc,(c*d~)/nc,sqrt(norml2(d))))/arg(na+nc*I));
Qsqr=((x)->if(isvalid(x),algneg(,x),error("invalid type in Qsqr")));
Qsub=((x,y)->if(isvalid(x)&&isvalid(y),algsub(,x,y),error("invalid type in Qsub")));
}
```

]]>```
(* Differentiable function *)
MatrixSqrt[m_] := MatrixPower[m, 1/2]
MatrixSin[m_] := (MatrixExp[I*m]-MatrixExp[-I*m])/(2*I)
MatrixCos[m_] := (MatrixExp[I*m]+MatrixExp[-I*m])/2
MatrixTan[m_] := -I*(MatrixExp[I*m]-MatrixExp[-I*m]).Inverse[MatrixExp[I*m]+MatrixExp[-I*m]]
MatrixCot[m_] := I*(MatrixExp[I*m]+MatrixExp[-I*m]).Inverse[MatrixExp[I*m]-MatrixExp[-I*m]]
MatrixSec[m_] := Inverse[MatrixCos[m]]
MatrixCsc[m_] := Inverse[MatrixSin[m]]
MatrixSinh[m_] := (MatrixExp[m]-MatrixExp[-m])/2
MatrixCosh[m_] := (MatrixExp[m]+MatrixExp[-m])/2
MatrixTanh[m_] := (MatrixExp[m]-MatrixExp[-m]).Inverse[MatrixExp[m]+MatrixExp[-m]]
MatrixCoth[m_] := (MatrixExp[m]+MatrixExp[-m]).Inverse[MatrixExp[m]-MatrixExp[-m]]
MatrixSech[m_] := Inverse[MatrixCosh[m]]
MatrixCsch[m_] := Inverse[MatrixSinh[m]]
(* From polar decomposition *)
MatrixSign[m_] := Module[{u,s,v},{u,s,v}=SingularValueDecomposition[m];u.ConjugateTranspose[v]]
```

]]>