Deriving the Time Complexity of Ryser’s Algorithm for Evaluating the Permanent of a Matrix

Ryser has shown that the permanent of an $ n \times n$ matrix $ A=(a_{ij})$ can be expressed as

\begin{align} Perm(A) = (-1)^n \sum_{s \subset [n]} (-1)^{|s|} \prod_{i=1}^n \sum_{j \in s} a_{ij}, \end{align}

where $ [n]=\{1,2,\dots,n\}$ . This algorithm runs in $ \mathcal{O}(2^{n-1}n^2)$ time. I’ve been trying to derive this, but can’t quite get the result. Here’s my work so far.

The outer sum is over all non-empty subsets of $ [n]$ , of which there are $ 2^n-1$ . We recall that the number of subsets of size $ r$ is $ {n \choose r}=\frac{n!}{r!(n-r)!}$ .

For each set $ s$ in the outer sum we compute $ \sum_{j \in s} a_{ij}$ , which uses $ |s|-1$ additions. Next, this sum sees the product $ \prod_{i=1}^n$ , which takes $ n-1$ multiplications. This happens for each non-empty subset of $ [n]$ , so there are the following number of total additions:

\begin{align} \sum_{s \subset [n]} \left(|s|-1\right) &= \sum_{k=1}^n (k-1) {n \choose k} \ &= \sum_{k=1}^n k {n \choose k} – \sum_{k=1}^n {n \choose k} \ &= n \sum_{k=1}^n {n-1 \choose k-1} – \left(2^n – 1\right) \ &= n \left( 2^{n-1}-1 \right) – \left(2^n – 1\right) \ &=n2^{n-1} – 2^n -n +1. \end{align}

The total number of multiplications is $ (n-1)(2^n-1)$ .

There is also the $ (-1)^{|s|}$ , which takes another $ 2^n-1$ operations in total.

This gives us a grand total of $ n2^n + n 2^{n-1} – 2^n -2n+1$ , which is not correct. It looks like I’m off by a factor of $ n$ on the second term here. Where am I going wrong?

What are the permanent effects of a vampire bite if the character doesn’t die?

According to the Monster Manual entry for vampires, the Bite attack has the following effects, once successful:

Hit: 7 (1d6 + 4) piercing damage plus 10 (3d6) necrotic damage. The target’s hit point maximum is reduced by an amount equal to the necrotic damage taken, and the vampire regains hit points equal to that amount. The reduction lasts until the target finishes a long rest. The target dies if this effect reduces its hit point maximum to 0. A humanoid slain in this way and then buried in the ground rises the following night as a vampire spawn under the vampire’s control.

If the player character doesn’t die and is able to retreat (or defeat the vampire) and take a long rest, are there any long-term or permanent consequences of this bite? Besides the mental trauma, of course?

What happens to the target of a “permanent” True Polymorph spell, when its caster dies

The description of the spell says specifically that after the caster has maintained it’s concentration for an hour, the spell can be dispelled.

The transformation lasts for the duration, or until the target drops to 0 hit points or dies. If you concentrate on this spell for the full duration, the spell lasts until it is dispelled.

In another question it was specified that spells which can be dispelled, will last until its effect ends. While spells which requires concentration, will end upon death. However it does not specify what happens with a spell that initially requires concentration.

If the caster dies after this duration, what happens to the target?

  • Does the target retain its current form?
  • Does the target revert back to the previous form?

What permanent spells would I be able to cast to make demiplane into a true base? [closed]

The character is a lvl 20 hexblade warlock who has an 8th level spell as a mystic arcanum. The DM is very open to homebrew. That’s how this game was described.

If it’s not broken and if the spell is mostly flavor text, it doesn’t matter if it’s on the warlock spell list – I could probably use it. For context, the party wizard has cure wounds.

What spells would I cast together to make a really good base?

Is crafting permanent items supposed to take this long?

One of my players in an upcoming game came up to me and noted that crafting items takes a ridiculously long time and/or is not much cheaper than just buying the item. This got me to look into the crafting system a bit deeper.

This is question #2, dealing with crafting times. Here is #1, about profits/costs.

I looked at the Earn Income table on page 236, and the prices of magic items, in the table starting on page 536 of the Core rulebook. Eyeballing the average price of a permanent item and assuming the highest proficiency level possible I made a quick excel table.

Assuming a normal success on the skill roll, getting the full price reduction on an item you craft (to half price) takes you:

  • lv 1: 37 days
  • lv 2-7: ~ 2 months
  • lv 8-13: ~ 3 months
  • lv 14-18: ~ 4 months
  • lv 19-20: 5+ months

Crafting an item 3 levels below you takes:

  • lv 1: 10 days
  • lv 2-4: ~ 2 weeks
  • lv 5-8: ~ 3-4 weeks
  • lv 9-17: ~ 1 month
  • lv 18: ~2 months
  • lv 19: 100 days
  • lv 20: 175 days

(Plus the 4 days to start crafting in every case.)

These numbers make it really impractical for a generic adventurer to create an item suitable for their own use (ie. of their level). Even if they settle for half the reduction they can get, it will take time on the scale of months, even on fairly low levels.

Are there rules or factors I did not take into account? How do these times line up with the downtime that a PC might expect or that the GM is advised to give?

How permanent are these changes to a PC when they attune to this weapon in Descent into Avernus?

In Baldur’s Gate: Descent Into Avernus, on pages 226-227, the

is described. The weapon is listed as a

and has the following property (given a bold italics header):

Briefly, these traits include (give bold headers):

The next header is written in bold italics, so I believe this is a new property that is unrelated to the Attunement property.

My question is about the part that says:

As I understand it, this means that you are permanently given all of the various traits, regardless of whether you remain attuned to the weapon or not, or whether or not

Is this interpretation correct? Does that even mean that an entire party could pass the weapon around (assuming that

and all gain these traits, even if

forever afterwards?

What happens when a permanent True Polymorphed creature drops to 0? [duplicate]

This question already has an answer here:

  • When true polymorphed creature dies, does it revert to its original form? 3 answers

Assume that a creature was True Polymorphed for the entire duration of the spell and is thus permanently transformed.

When said creature drops to 0, does the creature revert to it’s previous form or does it die?

Can you stack True Polymorphs to create an possibly infinite HP pool?