## How can I write a formula for this houseruled roll in AnyDice?

So here it goes:

1. The roll is a pool of dice of d6s, d8s, and d10s. The minimum dice pool is 1d6 and the maximum dice pool is 10 dice. It could be 2d6 + 2d8 + 1d10, for example.
2. Rolling 5+ is a success.
3. A number of successes is necessary equal or higher than the Difficulty (that ranges from 1 to 10) to have a successful check.
4. The maximum value of a die explodes: 6 in a d6, 8 in a d8, 10 in a d10. But there’s a limit by the character’s Protagonism (ranges 1 to 10). It’s like the level of the character, so one with Protagonism 3 could not explode any dice more than 3 times. The eventual 4th time counts only as a normal success, even if it has the maximum value again.

I see it can be very difficult to do this, so I thank anyone who may come up with something. Thanks so much!

## Is there an easy formula for multiple saving throws?

My issue: I am playing a druid and if I do something like summon 8 wolves I can end up forcing the DM into 8 saving throws each turn.

I mitigate this on my end with an app to roll lots of dice, I pre-roll my attacks and damage and all that, so my turns are quick, but the DM mentioned after the game that he doesn’t like having to roll so many saving throws, and worries it might slow things down.

Is there a reasonably simple formula to convert multiple saving throws into a single dice roll?

Example: 8 DC12 Strength saving throws becomes a single DC18 save – the outcome being that the target has a similar % chance of overall success, but with less dice.

My expectation is that given there are various throws of various difficulty, and each creature will have a different bonus that what I am asking for simply can’t be done, but I don’t have the maths to prove that.

What I am not looking for are ways to convince the DM that it isn’t too bad (It is no different than a well placed AoE for example), or to not summon so many wolves, spread the attacks around, or that I don’t get to pick what I summon, or any of the other usual advice about saving table time. My turns take seconds because I plan in advance, and I don’t think the DM wants to change what they do (IE: no using a dice roller for them), so this is just me looking to answer this one question.

## Trigonometric Simplification and Double Angle Formula

I am trying to achieve the formula hbar / 2 * cos(wt) * sin(theta). However, my Mathematica expression doesn’t seem to simplify the half/double angle formulas. I am wondering how I could refine my approach. Here’s my code:

Sz[J_] := \[HBar]*   Table[ KroneckerDelta[i, j]*(J + 1 - i), {i, 2*J + 1}, {j, 2*J + 1}] Sx[J_] := Chop[\[HBar]*.5*    Table[(KroneckerDelta[i, j + 1] +         KroneckerDelta[i + 1, j])*((J + 1)*(i + j - 1) - i*j)^.5, {i,       2*J + 1}, {j, 2*J + 1}]] Sy[J_] := \[HBar]*   Table[I/2*(KroneckerDelta[i, j + 1] -        KroneckerDelta[i + 1, j])*((J + 1)*(i + j - 1) - i*j)^.5, {i,      2*J + 1}, {j, 2*J + 1}] Sn[J_, theta_, phi_] :=   Simplify[Sx[J]*Sin[theta]*Cos[phi] + Sy[J]*Sin[theta]*Sin[phi] +     Sz[J]*Cos[theta],    Assumptions -> {0 <= theta <= Pi, 0 <= phi < 2*Pi,      Element[theta, Reals]}] U[H_, t_] :=   Simplify[Chop[ComplexExpand[MatrixExp[-I*H*t/\[HBar]]]],    Assumptions -> Element[t, Reals]]  {nvals, nvecs} = Eigensystem[Sn[.5, theta, 0]]; psi = Simplify[U[w Sz[.5], t].nvecs[[2]],     Assumptions -> Element[w, Reals]]; Simplify[ComplexExpand[Conjugate[psi].Sx[.5].psi]] 

And here’s my output:

(\[HBar] Sin[   theta] ((-2. - 2. Cos[theta]) Cos[(0.5 + 0. I) t w]^2 + (2. +        2. Cos[theta]) Sin[(0.5 + 0. I) t w]^2))/(-1. + Cos[2 theta]) 

## Is there anything preventing a first-level alchemist from buying a sixth-level alchemical formula?

The alchemist starts at level 1 with eight first-level alchemical formulae – two from their specialisation, four from their alchemical crafting feat, and two for free because they’re alchemists.

Alchemy alchemy alchemy.

But when I looked up purchasing formulae on page 293 of the CRB, I found that a sixth-level alchemical formula is only 13gp.

If a level 1 alchemist were to spend 13 of the 15 gold pieces they start with on such a formula, would they immediately be able to craft it and use it?

Alternatively, given that moderate versions of bombs are only level 3 formulae, could the alchemist purchase these formulae and start using them immediately with their infused reagents and quick alchemy, skipping the lesser versions entirely?

## Why does the formula floor((i-1)/2) find the parent node in a binary heap?

I learned that when you have a binary heap represented as a vector / list / array with indicies [0, 1, 2, 3, 4, 5, 6, 7, 8, …] the index of the parent of element at index i can be found with parent index = floor((i-1)/2)

I have tried to explain why it works. Can anyone help me verify this?

Took reference from Why does the formula 2n + 1 find the child node in a binary heap? thanks to @Giulio

## Edit Woocommerce Pricing Formula

I need to edit the way woocommerce calculates the price on a client’s website. It’s a site that allows customers to purchase products on credit by choosing the number of months they wish to make payment. However, in the cart, if the customer selects 2 or more of the quantity of the product they wish to purchase, the total amount of the products appears in the "Price" column of the cart instead of the unit price of that product. I would like to edit it such that the unit price shows in the price column no matter the quantity selected and then the total amount can then show in the total and subtotal columns. I have tried editing the woocommerce cart file and a couple of others but nothing seems to work. This is the site: www.appliancepointgh.com Any help on how i can do this would be deeply appreciated.

## Unarmored Movement Formula

I’m trying to plug in an equation for unarmored movement in DiceCloud, so that I don’t have to change the bonus value whenever it changes. i had a formula, but lost it. Does anyone know what the formula is?

## Can alchemists prepare alchemical items without reading their formula book?

The Pathfinder 2 alchemist class can prepare alchemical items if they have the item’s formula in their formula book. However, the class features never explicitly say that the alchemist needs to read the formula book, or have the formula book nearby, when crafting these items during their daily preparations.

You can use this feat to create alchemical items as long as you have the items’ formulas in your formula book.

… choose an alchemical item of your advanced alchemy level or lower that’s in your formula book …

You create a single alchemical item of your advanced alchemy level or lower that’s in your formula book…

The items you can select depend on your research field and must be in your formula book.

As a point of comparison, the wizard class explicitly requires that wizards must study their spellbook daily in order to prepare spells. So a wizard can’t feasibly go adventuring without it.

At 1st level, you can prepare up to two 1st-level spells and five cantrips each morning from the spells in your spellbook…

But the alchemist class has no such wording. Taken literally, this would mean that the alchemist can prepare items as long as (1) their formula book exists somewhere and (2) the item’s formula is written in the formula book. They could leave their 1-bulk formula book in a safe location and go adventuring without penalty.

In terms of rules-as-written, is this interpretation correct? Or do they need their formula book on hand during their daily preparations?

## Configurations and CNF formula for neighboring configuration

A configuration of a Turing machine $$M$$ which runs in space $$S(n)$$ contains the state, the head positions, and the content of non-blank cells of all the tapes. For $$M$$ and an input $$x$$, we define its configuration graph $$G_{M,x}$$ as a directed graph whose nodes correspond to all the possible configurations and there is an edge from a configuration $$C$$ to $$C’$$ if $$C’$$ can be reached from $$C$$ in one step.

First question: In Arora-Barak (snapshot below), they say that these nodes can be encoded in a binary string of length $$O(S(n))$$. Such encoding contains the state, all symbols under the head, and non-blank content of work tapes with special marking to denote the location of the head. I think this is not correct since such an encoding doesn’t contain the input head position. If we don’t store the input head position, which requires O(\log n) bits, then two nodes can map to the same encoding, which seems wrong. Am I right? Although storing the input head position will not increase the length of the encoding since we are assuming in the book that $$S(n) > \log n$$.

Second question: Next Arora-Barak says that we can construct a CNF formula $$\phi_{M,x}$$ such that for any two strings $$C$$ and $$C’$$, $$\phi_{M,x}(C,C’) = 1$$ iff $$C$$ and $$C’$$ encode two neighboring configuration in $$G_{M,x}$$. I am not able to figure out the proof of this claim with the kind of encoding that I have described above i.e. encoding in which we also store the index of input head. Suppose a configuration C has $$q_1, q_2, \dots, q_c$$ bits for state, $$h_1,h_2, \dots, h_{O(\log n)}$$ bits for input head positions, $$w_1, w_2, \dots, w_{S(n)}$$ bits for work tape content and $$wh_1, wh_2, \dots, wh_{S(n)}$$ bits for work tape head position, where $$wh_i$$ is equal to 1 if the head is on the $$i$$th cell, else it is equal to 0. Then how with such an encoding we can construct a CNF formula as described at the beginning of this question?

## What is the formula for damage per round?

I’m crating a web app to learn JS that will calculate damage per round but I’m stuck on adding criticals.

I have successfully created variables for: diceNumber, diceSides, bonuses, attacksPerRound, and criticalChance

What is the formula to add all of these together to get the average damage per round?