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: Any help on how i can do this would be deeply appreciated.

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…

You start with a spellbook worth 10 sp or less, which you receive for free and must study to prepare your spells each day.

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?

enter image description here

Inhomogeneous Heat Equation Formula Not Satisfying IVP

From Wikipedia,


However, when I plug the formula of $ u(x,t)$ into Mathematica 12, it doesn’t seem to satisfy the PDE (does not give $ 0$ ):

enter image description here

Here is the code:

G[x_, t_] := 1/Sqrt[4*Pi*k*t]*Exp[-x^2/(4*k*t)]  u[x_, t_] := Integrate[G[x - y, t - s]*f[y, s], {y, -Infinity, Infinity}, {s, 0, t}]  FullSimplify[D[u[x, t], t] - k*D[u[x, t], {x, 2}] - f[x, t], Assumptions -> t > 0] 

Is there a formula or method of planning a flexible homebrew campaign or session?

When ever I’m planning a session for my campaign I tend to plan a very strict plot. It makes me feel comfortable, and though you can never feel ready; it makes me feel ready to play when I have a plan.

If the players go off of the plot it really messes me up.

Is there a specific planning process or formula that most DMs use in planning a session? Put another way: is there a way to plan a session, that is flexible to what the players do.

Is there a formula (or something similar) that most DMs use?