Convert PDA to CFG – Language of Palindromes over $\{a,b\}^+$

I tried to convert the following PDA $ M$

to a CFG and got the following results. However I’m not quite sure if I did the algorithm the right way. I feel like I maybe misunderstood some the algorithm when it comes to the $ A_{p,q} \to xA_{r,s}y$ part. Could you help me to clear things up?

$ G = (V,\Sigma,P,S)$ with \begin{align*} V = \{&A_{0,0},A_{0,1},A_{0,2},A_{0,3},A_{0,4},A_{1,0},A_{1,1},A_{1,2},A_{1,3},A_{1,4},A_{2,0},A_{2,1},A_{2,2},A_{2,3},A_{2,4},\ &A_{3,0},A_{3,1},A_{3,2},A_{3,3},A_{3,4},A_{4,0},A_{4,1},A_{4,2},A_{4,3},A_{4,4},S\}, \end{align*} $ \Sigma = \{a,b\}$ , $ S = A_{0,4}$ and the following productions: \begin{align*} S &\to A_{0,4}\ A_{0,0} &\to \epsilon\ A_{1,1} &\to \epsilon\ A_{2,2} &\to \epsilon\ A_{3,3} &\to \epsilon\ A_{4,4} &\to \epsilon\ A_{0,0} &\to A_{0,0}A_{0,0} \vert A_{0,1} A_{1,0} \vert A_{0,2}A_{2,0} \vert A_{0,3}A_{3,0} \vert A_{0,4}A_{4,0}\ A_{0,1} &\to A_{0,0}A_{0,1} \vert A_{0,1} A_{1,1} \vert A_{0,2}A_{2,1} \vert A_{0,3}A_{3,1} \vert A_{0,4}A_{4,1}\ A_{0,2} &\to A_{0,0}A_{0,2} \vert A_{0,1} A_{1,2} \vert A_{0,2}A_{2,2} \vert A_{0,3}A_{3,2} \vert A_{0,4}A_{4,2}\ &\vdots\ A_{4,4} &\to A_{4,0}A_{0,4} \vert A_{4,1} A_{1,4} \vert A_{4,2}A_{2,4} \vert A_{4,3}A_{3,4} \vert A_{4,4}A_{4,4}\ A_{0,4} &\to A_{1,3}\ A_{1,3} &\to aA_{1,3}a\ A_{1,3} &\to bA_{1,3}b\ A_{1,3} &\to aA_{1,1}\ A_{1,3} &\to bA_{1,1} \end{align*}

Does the effects of a failed save versus disease or poison carry over into an alternate form?

Most diseases (mundane or magical) and poison deal ability damage upon a failed save after the incubation time.

Once the damage takes place, does the negative effects of a failed save versus disease or poison carry over into an alternate form?

This question is only asking about alternate forms, not wildshape or polymorph.

how to send prime and generator of diffie hell-men to client over network node js?

I am using crypto module of node js for exchanging key using diffie-hellman algorithm.


const crypto = require("crypto");  const alice = crypto.createDiffieHellman(512);  const aliceKey = alice.generateKeys(); 


const bob = crypto.createDiffieHellman(alice.getPrime(), alice.getGenerator());  const bobKey = bob.generateKeys();  const aliceSecret = alice.computeSecret(bobKey);  const bobSecret = bob.computeSecret(aliceKey); 

The above example is taken from node.js documentation as shown the client uses servers prime number for generating the prime number.

my question is how should I securely send the prime number and the other parameter to client over internet? are there any other alternatives?

and another question is that I am generating keys using generate keys function but I have already generated private-key.pem and public-cert.pem file. can I use those if yes then how?, if no then what is difference between those keys?

Disagreement with professor over NP reduction problem

I’m a slight disagreement with my professor over whether or not a certain reduction is possible. He asked us to reduce the problem of 3-Coloring to the problem of 3-Clique. The problem is that I’m fairly confident that 3-Coloring is NP-Complete, while 3-Clique is P. Correct me if I’m wrong (which is very likely), but for any k-clique where the k is fixed, is $ V^k$ , meaning the 3-clique is $ V^3$ , right? I asked my professor about this and his response was:

“3-clique is definitely not in P. You (apparently) have to examine all thrices of vertices to settle the matter.”

And I still don’t understand how this is not a $ V^3$ operation.

If I figured out a way to reduce 3-coloring to 3-clique wouldn’t I be millionaire?

Does the DICOM file header gets lost when transferred over the network?

I am currently investigating the PEDICOM vulnerability CVE-2019-11687 where I am trying to reassemble the P-DATA DICOM fragments from a PCAP. Since the vulnerability takes advantage of writing bytes onto the header, I want to investigate this. When sniffing the network and trying to capture and reassemble the file, when sent over the network using the DICOM protocol does it loose its header and the only information is sent are the different data elements?

Does Sacred Flame or Firebolt do more damage on average to a Shadow over an arbitrary but finite number of rounds?

Assume the following character build:

Level 2 Variant Human Wild Magic Sorcerer with Magic Initiate Feat; relevant spells are Sacred Flame and Fire Bolt. While I don’t think character level is relevant, it is included in case an ability plays a larger roll than anticipated.

Ability Scores:
STR: 8 (-1)
DEX: 14 (+2)
CON: 14 (+2)
INT: 10 (+0)
WIS: 12 (+1)
CHA: 14 (+2)

Spell Save DC: 8 + 2 + 2 = 12
Spell Attack Modifier: 2 + 2 = 4

Spell Save DC for Sacred Flame: 8 + 2 + 1 = 11

Magic Initiate (5e PHB page 168):

Choose a class{cleric}: You learn two cantrips of your choice from that class’s spell list. … Your spellcasting ability for these spells depends on the class you chose: … Wisdom for cleric

Sacred Flame (5e PHB page 272):

Casting Time: 1 action.
Flame-like radiance descends on a creature that you can see within range. The target must succeed on a Dexterity saving throw or take 1d8 radiant damage. The target gains no benefit from cover for this saving throw.

Firebolt (5e PHB page 242):

Casting Time: 1 action
You hurl a mote of fire at a creature or object within range. Make a ranged spell attack against the target. On a hit, the target takes 1d10 fire damage. A flammable object hit by this spell ignites if it isn’t being worn or carried.

Shadow (53 MM page 269),

Armor Class 12
Hit Points 16 (3d8 + 3)
DEX: 14 (+2)
Damage Vulnerabilities radiant
Damage Resistances … fire …

Damage Resistance and Vulnerability (53 PHB page 197)

If a creature or an object has resistance to a damage type, damage of that type is halved against it. If a creature or an object has vulnerability to a damage type, damage of that type is doubled against it.

Assuming that we don’t have to worry about the Sorcerer taking any damage (just for the sake of the question, otherwise it boils down to the Sorcerer dying after a few rounds), which spell would be the better choice to deal the maximum amount of damage on average within an arbitrary but finite amount of rounds?

Does the Message spell truncate messages over 6 seconds long?

The Message spell’s duration is “1 round” (PHB, p. 259) and a round “represents about 6 seconds in the game world.” (PHB, p. 189)

Is a message longer than “about 6 seconds” truncated? Does the caster know it’s been truncated? Does the spell accept the too-long message anyway, or is the caster forced to limit their utterance to 6 seconds to start with?

What DnD 5e build (with minimum number of combined levels over all classes) is needed to summon all summonable monsters?

What build would make if you just want to be able summon all monsters (of the summonable monsters) without a general purpose spell like wish or special equipment – how many levels of a multiclass do you need at minimum? Specify background. I believe a Wizard (Summoning school) can nearly summon all monster types with CR limits but for instance has to choose between demons and animals at level 4.