Solving symoblic system of non-linear equations takes too long

I am trying to solve a set of system of symbolic non-linear equations:

g1 = ptz + pz + 2 pty q0 q1 - 2 ptz q1^2 + 2 px q0 q2 - 2 pz q2^2 -     2 px q1 q3 - 2 pty q2 q3 - 2 ptz q3^2 - 2 pz q3^2 ; g2 = 2 (ptx q0 q1 + px q0 q1 + ptz q1 q2 - pz q1 q2 + ptz q0 q3 +       pz q0 q3 - ptx q2 q3 + px q2 q3); g3 = ptx + px - 2 ptx q1^2 - 2 px q1^2 - 2 pz q0 q2 - 2 pty q1 q2 -     2 px q2^2 - 2 pty q0 q3 - 2 pz q1 q3 - 2 ptx q3^2 ; g4 = -2 pty q0 q2 - 2 py q0 q2 + 2 ptz q1 q2 - 2 pz q1 q2 -     2 ptz q0 q3 - 2 pz q0 q3 - 2 pty q1 q3 + 2 py q1 q3 ; g5 = ptz + pz - 2 py q0 q1 - 2 pz q1^2 - 2 ptx q0 q2 - 2 ptz q2^2 -     2 ptx q1 q3 - 2 py q2 q3 - 2 ptz q3^2 - 2 pz q3^2 ; g6 = -pty - py - 2 pz q0 q1 + 2 py q1^2 + 2 ptx q1 q2 + 2 pty q2^2 +     2 py q2^2 - 2 ptx q0 q3 + 2 pz q2 q3 + 2 pty q3^2 ; g7 = q0^2 + q1^2 + q2^2 + q3^2;  NSolve[{g1 == 0, g2 == 0, g3 == 0, g4 == 0, g5 == 0, g6 == 0,    g7 == 1}, {q0, q1, q2, q3}, Reals] 

Here all variables except q0, q1, q2 and q3 are considered fixed. The variables represent a unit quaternion. Testing for corner cases (by setting single element of quaternion to 0) reveals that these set of equations don’t have a solution, which is what I intend to prove. But the code takes too long to run. Any suggestions would be appreciated.

I could treat the elements of quaternion and the permutations of the elements as separate variable and solve the system as Linear Equations, which I did for the corner cases. But here I don’t have enough constraints (10 unknowns with 7 constraints) and hence can’t employ that method.

Do monsters with a spellcasting trait get spell slots back after a long rest?

Some monsters, like a lich, have the Spellcasting trait. This trait allows such monsters to cast spells using spell slots, much as spellcaster player characters do.

However, taking the lich as an example, the trait does not mention how spell slots are regained (I’m ignoring their Lair Actions for the purposes of this question). Looking at the general rules on monsters’ Spellcasting trait in the Special Traits section:


A monster with the Spellcasting class feature has a spellcaster level and spell slots, which it uses to cast its spells of 1st level and higher. The spellcaster level is also used for any cantrips included in the feature.

The monster has a list of spells known or prepared from a specific class. The list might also include spells from a feature in that class, such as the Divine Domain feature of the cleric or the Druid Circle feature of the druid. The monster is considered a member of that class when attuning to or using a magic item that requires membership in the class or access to its spell list.

A monster can cast a spell from its list at a higher level if it has the spell slot to do so. For example, a drow mage with the 3rd-level lightning bolt spell can cast it as a 5th-level spell by using one of its 5th-level spell slots.

You can change the spells that a monster knows or has prepared, replacing any spell on its spell list with a spell of the same level and from the same class list. If you do so, you might cause the monster to be a greater or lesser threat than suggested by its challenge rating.

There is no mention of spells slots coming back on a long rest. Elsewhere in the general rules, this is explicitly mentioned for other traits (such as X/Day traits):

For example, "1/Day" means a special ability can be used once and that the monster must finish a long rest to use it again.

It’s reasonable to assume that monsters with the Spellcasting trait do probably get their spell slots back on a long rest because that’s how it works for PCs, but on the other hand, monsters and PCs don’t necessarily use the same rules. So, does anything explicitly state that monsters with the Spellcasting trait get their spell slots back on a long rest?

How long could a dragon survive if it were trapped in its lair?

Pretty much just what the title says. Would it just starve and die over time, or would it be able to survive in some way?

Some clarifications:
I’m assuming a red dragon, and the lair being something in line with the description in the MM: "Red dragons lair in high mountains or hills … Caves with volcanic or geothermal activity…"

So something in line with this, a cave in some high mountains.

For this case, I am assuming the standard rules (not the spellcasting variant).

Do sorcery points made from converted spell slots vanish after a long rest?

Sorcerers are able to turn sorcery points into spell slots, but the same conversion rate applies to turn spell slots into sorcery points. If, by the end of the day, you have unused spell slots and you wanted to risk the overnight ambush, could you turn them into sorcery points to be used the next day? Or would they disappear anyway? Sorcery points are replenished after a long rest, but that only infers to ones that have been expended, and ones created by spell slots are theoretically one-use, so do they disappear daily or can they stack?

Has it ever been officially stated how long it takes for a soul to transform into an outsider after death?

Okay, correct me if I’m wrong:

In the Pathfinder Universe, souls travel along the River of Souls after death, then hang around Pharasmas Boneyard for a while, get judged and then get send to whichever Outer Sphere plane matches their alignment. There, they become so-called petitioners, suffer/enjoy themselves for a while and with sufficient piety/malice/effort, eventually turn into a plane-appropriate outsider.

Now, has is ever been stated how long this process roughly takes? Years, decades, centuries, millennia? The only reference to time I found was about hammer archons:

Those archons who continually proves themselves in battle, either by striking down hordes of demons or by holding back a single pit fiend long enough for reinforcements to arrive, may get promoted to the rank of hammer archon. This process can take centuries, even millennia, but the lawful-aligned outsiders would brook no shortcuts. Many hound archons and shield archons with martial inclinations ceaselessly endeavor to rise to the heights of power that being a hammer archon represents.

But this is more about “rising in the ranks”, so to speak. And “brook no shortcuts” implied that shortcuts are apparently a thing(?).

(Honestly, the most interesting question to me is – would it be feasible for someone’s wise old mentor figure to return as an archon or for a former BBEG to reappear as a devil? I know they don’t really keep any proper memories of their old selves, but it would still be cool!)

What benefit (if any) do horses or carriages offer when travelling long distances?

The rules for Travel Pace in the PHB and Basic Rules are good and straightforward, with players able to travel on foot for 8 hours per day without over-exerting themselves, choosing a pace of Slow (2 miles/hour, 18 miles/day; can move stealthily), Normal (3 m/h, 24 m/d) or Fast (4 m/h, 30 m/d, take a penalty to pass Perception).

In this same section, there are two paragraphs about mounts and vehicles; they specify that mounts can gallop at twice the normal fast pace for an hour, and with frequently freshened mounts – typically only available in highly populated areas – a rider can travel fast over long distances. However when it comes to vehicles, only water going vessels or flying mounts get you travelling faster; for commonly available forms of transport:

Characters in wagons, carriages, or other land vehicles choose a pace as normal.

Is this right? Rules as written it seems there is no benefit to travelling by wagon or carriage, and certainly it takes the same amount of time as walking. In my current game of Dragon of Icespire Peak, the players have spent quite a bit of time demanding horses or a carriage in order to travel the 65 miles from Phandalin to Butterskull Ranch, believing it would get them there faster (as the quest there seems urgent). But looking up the travelling rules it really seems there’s no speed benefit to them paying for a ride or hiring horses, except that they might shave an hour off their travel time each day in the latter case. That makes sense for a wagon which is designed only for hauling stuff, not speed, but what about a carriage or a riding horses?

I’d like to know if there are any additional benefits (beyond the purely narrative) that I am missing for travel by carriage, or any ways that mounts or vehicles can decrease their travelling time (beyond the double fast pace for one hour).

I’m also interested in any house rules you may have used to give players a speed boost through riding over walking.

Long Division when dividend and divisor are of same size (same number of digits)

I want to know if there is some optimized method (constant complexity preferred) to obtain the quotient when the dividend and the divisor contain the same number of digits. I know about algorithm D of “The Art of Computer Programming” but there Knuth describes how to find quotient digit when the dividend is $ n+1$ in length and divisor is $ n$ . Is there any method of finding the quotient digit when they both are of the same length? Obviously I can search linearly from $ 1$ to $ base$ or use Binary search for the same but I was looking for something more optimal as my Base is very large $ (\approx 10^{18})$

If the daughter of a night hag avoids her mother long enough can she delay becoming one too?

The daughters of other hags all seem to fully turn into them automatically once 13, except with night hags according to lore. With them it’s said that there must be 13 rituals done on their daughters or the transformation doesn’t occur.

So for campaign purposes I have to ask: does this mean that it’s possible for a daughter of a night hag to be encountered who is older than 13 and thus far been able to evade their mother and being converted? Can it be delayed with them from the usual mandatory age?

And as an aside, if it is possible and such one is encountered, would they be a regular human e.g. stats wise or would there be differences? And would spells used by a party that could detect and reveal a hag also detect them?

Does a monk’s Step of the Wind affect High Jump or just Long Jump?

At 2nd level, monks can spend a ki point to use Step of the Wind:

Step of the Wind

You can spend 1 ki point to take the Disengage or Dash action as a bonus action on your turn, and your jump distance is doubled for the turn.

What is meant by “jump distance”, exactly?

The rules on Jumping state:

Long Jump. When you make a long jump, you cover a number of feet up to your Strength score if you move at least 10 feet on foot immediately before the jump. When you make a standing long jump, you can leap only half that distance. Either way, each foot you clear on the jump costs a foot of movement. […]

High Jump. When you make a high jump, you leap into the air a number of feet equal to 3 + your Strength modifier (minimum of 0 feet) if you move at least 10 feet on foot immediately before the jump. When you make a standing high jump, you can jump only half that distance. Either way, each foot you clear on the jump costs a foot of movement. […]

You can extend your arms half your height above yourself during the jump. Thus, you can reach above you a distance equal to the height of the jump plus 1 1/2 times your height.

Both Long Jump and High Jump mention distance, so does that mean a monk who uses Step of the Wind can jump twice as high? I ask because my DM and other players in the group who spoke up are under the impression it only affects the Long Jump, and that a High Jump is unaffected by Step of the Wind…