Page 1 of 2

Math thread

Posted: Sat Nov 12, 2022 9:48 am
by hobartmariner
Not sure if it's for the pit but...any interesting math[/phys/stats/cs] stuff?

Been going thru Richard Kaye's math logic book and just started the M. Lothaire book on combinatorics on words. The logic book is a great intro but he has no feel for what constitutes a reasonable exercise. Some are too easy and others way too hard lol. Lothaire book very orderly and dense. Morse-Thue sequence has really stuck itself in my brain...I'm convinced there should be a nicer proof of the cube-free property.

Also have Apostol's baby number theory book on back burner, an all-time great.

Re: Math thread

Posted: Sat Nov 12, 2022 5:08 pm
by samsam
Math! Algorithms! This is maybe not a truly "mathy" problem, maybe more of a CS one, but I've been trying to think of a more rigorous way to approach this one problem at work. See, we've got this parametric 3d model with 11 parameters that can be changed. It's for a tooth job thing, so the parameters are like, "how many degrees to skew this part of the braces," "diameter of the metal archwire thing," "thickness of pad that goes on the patient's tooth."

Sometimes you give the 3d model your parameters and the 3d model builds successfully, sometimes it does not build successfully. At the moment, the way I determine if a set of parameters will work or not is to just put them in the model and check. They're all so weirdly dependent on the other parameter values that I can't get an intuitive sense of what will or won't work just from looking at the values.

So, like, in my mind I'm thinking of this as eleven continuous-over-a-limited-range variables going into a nonlinear binary function. And then there's an 11-dimensional volume that holds all the combinations of parameters where the function outputs a "build successful" result. Can I do something to get a decent approximation of the volume, which I can use to predict future build failures? What's a clever way of doing it that doesn't require testing 10 ghjpillion combinations, one at a time? I can't do something like gradient-descent because "build" and "doesn't build" are the only options, right? Is this a thing where Monte Carlo methods would be good? I dunno, it's hard to explain on a forum but if anyone wants to ponder it with me I'm happy to go into more detail somewhere

Re: Math thread

Posted: Sat Nov 12, 2022 5:27 pm
by hobartmariner
samsam wrote: Sat Nov 12, 2022 5:08 pm I can't do something like gradient-descent because "build" and "doesn't build" are the only options, right?
I'm a total scrub when it comes to applications, but you sure can apply gradient descent to a binary classifier if you model it as logistic regression. Just googling "logistic regression binary classifier" will probably find you good stuff. Another approach is a nearest neighbors model, which might make more sense, because I'm guessing you have an extremely curvy/non-linear decision boundary. (You can model a curvy or irregular decision boundary with log-reg, you just have to include some artificial variables like (length of tooth)^3 or ln(incisor gap) or whatever -- there exist packages that find these for you.)

It might be something where if you could look at the software you could see where the errors get flagged, maybe there are natural or contrived ranges for different input parameters (likely depending on some secondary derived quantities) and anytime the parameters are out of range it won't build.

With caveat that I'm no good at anything CS I'd be happy to delve deeper.

Re: Math thread

Posted: Mon Nov 14, 2022 7:34 am
by betapersei
If your goal is to get an estimate of where the valid configurations are its going to be hard to avoid taking a lot of samples, especially if you dont have any prior knowledge that the problem is linear or convex or something. If you just want to explore the space you can try something like bisection, taking a very coarse grid of points and making it finer as you go. You can be strategic about how you make it finer depending on the density of hits etc.

Re: Math thread

Posted: Mon Nov 14, 2022 11:08 am
by slug
I have a math question and no real idea how to solve it. If A, B, and L are matrices ( jones transmission matrices fwiw) then what are the possible relationships between A and B if

(I+A)^{-1}(I+B)L(I-B)(I-A)^{-1}=L

where I is the identity. They're 2x2 and complex if it matters, and I don't think there are any other constraints on them. By inspection, A=B is a solution (which is a good one for me) but is there anything else, or even a good way to tell if other solutions exist? If I start cranking through the algebra things get stupid.

Re: Math thread

Posted: Mon Nov 14, 2022 11:15 am
by betapersei
It seems like the family of matrices in question are pretty constrained. If you can find a parametrization of the set I think the algebra would get a lot easier.

Re: Math thread

Posted: Mon Nov 14, 2022 11:21 am
by slug
betapersei wrote: Mon Nov 14, 2022 11:15 am It seems like the family of matrices in question are pretty constrained. If you can find a parametrization of the set I think the algebra would get a lot easier.
Part of the problem is that I lied and B and A are jones reflection matrices (light bouncing off the thing), which can be surprisingly different from the transmission matrices (light going through the thing), so I'm not sure if they can be parameterized the same way. But now that you mention it they probably do have some parameterization and if I can find that it would be a good place to start.

Re: Math thread

Posted: Mon Nov 14, 2022 11:33 am
by betapersei
You might also be able to work out the number of solutions? Like if the reflection matrices have a similar relation to the transmission matrices you can get a quadratic matrix equation for A in terms of L and B, and there are probably ways of working out when those have nonunique solutions and if so how many (presumably up to some equivalence relation since I guess the matrices can be singular?). Those sorts of relations exist for polynomial equations so I assume something similar exists for matrix equations due to Cayley-Hamilton.

Re: Math thread

Posted: Mon Nov 14, 2022 10:11 pm
by hobartmariner
If L commutes with A then setting B=-A gives another solution. Is there a good reference for these reflection matrices? A lot of stuff seems older and paywalled.

Re: Math thread

Posted: Wed Nov 16, 2022 10:40 am
by betapersei
It looks like a lot of the usual transmission matrices are projectors onto some basis element (either linear or circular polarization) which means that they should commute since each unique projector is in the null space of each other one. So if the reflection matrices are similar you could have a lot of commutation.