## How should one interpret the word “identical” in the initiative rule?

The rule for initiative in PHB read (emphasis mine)

Initiative determines the order of turns during combat. When combat starts, every participant makes a Dexterity check to determine their place in the initiative order. The DM makes one roll for an entire group of identical creatures, so each member of the group acts at the same time.

I usually thought that identical creature stands for creatures of the same type and with the same name: for example, in a situation where a party is fighting 3 trolls and 2 ogres I read the above rule as rolling one d20 for the trolls’ group and one d20 for the ogres’.

Other DMs would extend identical to a wider meaning (see enkryptor’s answer to "Is this house-rule that has each monster/NPC roll initiative separately (even when there are multiple creatures of the same kind) game-breaking?"): for example, a dragon and their kobolds army fighting the party may be considered identical creatures in the sense that they are allies, as belonging to the same group of enemies.

Is there any RAW interpretation of the word identical in this context of initiative roll?

## Do identical bonuses from random properties of different Artifacts stack?

Some Artifacts have Major/Minor Beneficial/Detrimental Properties, rolled from the appropriate table.

If I were to have two attuned Artifacts, both with, say, the Minor Beneficial Property of "While attuned to the artifact, you gain a +1 bonus to Armor Class.", would I have a +2 or +1 AC bonus?

From the DMG Errata on Combining Game Effects (p. 252):

Different game features can affect a target at the same time. But when two or more game features have the same name, only the effects of one of them—the most potent one—apply while the durations of the effects overlap. […] Game features include spells, class features, feats, racial traits, monster abilities, and magic items.

"Artifact property" isn’t listed, which is evidence for +2. But Artifacts are magic items, which may mean it should only be +1 instead. Which is correct?

## For every imperative function, is there a functional counterpart with identical performance or even instructions?

Currently, I haven’t learned about a functional language that can achieve the same performance as C/C++. And I have learned that some languages that favor functional programming to imperative programming, such as Scala and Rust, use imperative ways to implement their library functions for better efficiency.

So here comes my question, on today’s comptuters that execute imperative instructions, is this a limitation of the compiler or functional programming itself? For every imperative function with no side effects, either in a language without GC such as C/C++/Rust/assembly or one with GC such as Java, is there a pure functional counterpart in Haskell, Scala, etc. that can be compiled to run with identical performance in time and space (not just asymptotic but exactly the same) or even to the same instructions, with an optimal functional compiler that utilizes all modern and even undiscovered optimization techniques such as tail recursion, laziness, static analysis, formal verification, and so on which I don’t know about?

I am aware of the equivalence between λ-computable and Turing computable, but but I couldn’t find an answer to this question online. If there is, please share a compiler example or a proof. If not, please explain why and show a counter-example. Or is this a non-trivial open question?

## Near identical MySQL deployments behaving very different – High CPU Usage problem

So I have five identical websites, running on five machines provisioned in the same way. The only thing that differs between these installations are the language files and the languages of the text stored in MySQL tables.

Four of them have no problems what so ever. One is struggling a LOT under the same or somewhat less load than the other four.

I cannot understand why this is.

Things I’ve done so far:

1. Checked slow queries. All queries uses indexes and are in the realm of 0.0008 Sec execution time i.e. very fast
2. I’ve noticed that the thing that causes most trouble for this MySQL instance is UPDATE and INSERT, so much so, I’ve turned off the UPDATE’s that were there, for this instance. Bear in mind that these UPDATE’s doesn’t cause a blip on the other servers.
3. Tried to eliminate external factors i.e. noisy neighbours (moved host) etc.

Worth noticing is that the machines are deployed the same i.e. a vanilla Debian 10 installation with a LEMP stack, nothing out of the ordinary at all.

Still, the problem persists. I can see the load of the machine struggling to keep under 1.00. The other machines are in the 0.10 – 0.20 range all the time.

Looking at CPU for the MySQL process on this machine (with 2 CPU cores as the other machines have as well) it is quite often above 100%. The other machines are never – EVER – over 60% for the MySQL process.

So, any help is much appreciated.

Please do let me know if you need me to run a command that you need to see the output from in order to help.

Thanks.

EDIT Spelling and clarifications

## If an NPC and a PC roll identical initiative who goes first?

Normally, when 2 players roll identical initiative in combat, they decide between themselves the order they do things in and then stick to that on subsequent rounds.

How should the DM handle it if the NPC rolls the same initiative, especially if they are in combat directly with the player who rolled the identical initiative?

If rolling bulk initiative for a group of NPCs, how should identical rolls with players be handled here? It feels like a lot can swing on whether the GM chooses for the group of NPCs to attack the player before he can decide his action.

## Order of resolution of several identical initiative Attacks

It sometimes happens that several identical monsters, all using the same initiative, attack a single character.

In my games, this is often a volley of missile fire at a caster.

For pure practicality, I typically roll all the attack rolls together, count up the hits, and then roll all the damage, and assign it to the player as a single total. If the potential damage total is less than their current hit points, there is little difference between this approach and RAW.

However, when there is a potential for damage to render a character unconscious, this approach does differ substantially from RAW, at least for my understanding of them. RAW, I should roll each attack and record each instance of damage separately. Upon the first hit that renders the character unconscious, they immediately drop prone. The subsequent attacks, although occurring on the same initiative, in some sense come ‘after’ the character has fallen prone. Thus they are at disadvantage to hit (assuming missile attacks) but each one that does hit indicates a failed death save, so that three such hits would result in the character’s death.

Questions:

1. Is my understanding of the situation with RAW correct?

2. Is there any difference in this situation between multiple attackers on the same initiative and an attacker with multiattack?

3. Suppose I choose to roll all attacks and damage at once, even in situations where the potential damage was more than a PC’s current hp. [In this case, the chance of the attackers hitting would increase, the chance of the PC going unconscious would increase, but the chance of the PC dying from failed death saves would decrease.] Can this decision be reconciled with (Initiative; PHB, p. 189):

If a tie occurs, the DM decides the order among tied DM-controlled creatures,

that is, I have decided to resolve these ties simultaneously? Or would such a choice violate RAW and require me to invoke Rule 0?

Related: How do creatures moving on the same initiative handle the effects of Sleep and Hypnotic Pattern?

## Scheduling jobs online on 3 identical machines – a lower bound of 5/3

Consider the Online Scheduling Problem with $$3$$ identical machines. Jobs, with arbitrary size, arrive online one after another and need to be scheduled on one of the $$3$$ machines without ever moving them again.

How can I show, that there can’t be any deterministic Online-Algorithm which achieves a competitive ratio of $$c<\frac{5}{3}$$.

This should be solved by just giving some instance $$\sigma$$ and arguing that no det. algorithm can do better. Same can easily be done for $$2$$ machines and $$c<\frac{3}{2}$$. Sadly I can’t find any solution to this (more or less) textbook answer.

## What happens when identical overlapping effects have their end-condition met?

The Dungeon Master’s Guide errata (direct download) added the “Combining Game Effects” section which states (emphasis mine):

Different game features can affect a target at the same time. But when two or more game features have the same name, only the effects of one of them—the most potent one—apply while the durations of the effects overlap. […]

So with overlapping things, one instance will be “active” (will have effects) and the other will be “inactive” (won’t have effects). That said, I think my question will make more sense with examples:

1. The Fire Elemental’s Fire Form trait:

[…] The first time it enters a creature’s space on a turn, that creature takes 5 (1d10) fire damage and catches fire; until someone takes an action to douse the fire, the creature takes 5 (1d10) fire damage at the start of each of its turns.

If a creature is under the effects of multiple instances of Fire Form, and somebody uses their action to douse the fire, are both instances removed or only one?

[…] If the target willingly moves before then, it immediately takes 1d8 thunder damage, and the spell ends. […]

If a creature is under the effects of multiple instances of booming blade, and they move, are both instances removed or only one?

3. The hold monster spell:

[…] At the end of each of its turns, the target can make another Wisdom saving throw. On a success, the spell ends on the target. […]

If a creature is under the effects of multiple instances of hold monster, and they succeed on a save, are both instances removed or only one?

Can an “inactive” effect end when its end-condition is met (letting them end simultaneously), or do these sorts of things always end one at a time? Or perhaps the answer is something in-between?

There is also the following related question:

• Can multiple creatures grapple a single target?

Both answers there supports that if you are grappled by multiple creatures and you make a check to remove a grapple, you only remove one of the grapples. It’s not perfectly analogous situation but it is somewhat similar.

## Identical records in IIS logs

I am not very knowledgeable about IIS 7, so I thought this was the right place to ask.

While inspecting the web server logs, I came across several instances of separate records that look just the same. For example:

#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken 2020-04-21 00:00:10 ABC.128.138.15 GET /MY/API/HERE departmentId=&prodLineId=&prodUnitId=&puGroupId=&FLId=null&startTime=2019-09-08T21:00:00.000Z&endTime=2019-09-09T21:00:00.000Z&status=null&itemType=&itemComponent=&howFound=&priority=&foundBy=&fixedBy=&flList= 80 - ABC.128.138.15 Apache-HttpClient/4.5.6+(Java/1.8.0_92) - 200 0 0 1453 2020-04-21 00:00:10 ABC.128.138.15 GET /MY/API/HERE departmentId=&prodLineId=&prodUnitId=&puGroupId=&FLId=null&startTime=2019-09-08T21:00:00.000Z&endTime=2019-09-09T21:00:00.000Z&status=null&itemType=&itemComponent=&howFound=&priority=&foundBy=&fixedBy=&flList= 80 - ABC.128.138.15 Apache-HttpClient/4.5.6+(Java/1.8.0_92) - 200 0 0 1453 

The question is – do those records correspond to two actual separate requests, or perhaps it was just one that for some reason got duplicated? This is not an isolated occurrence (there are hundreds more). Just for the record, these are all GET requests coming from the same source (an Apache Tomcat-based application that resides in the same web server and is invoking APIs in different application pools).

Gabriel

## Is multiplying hashes a valid way to ensure two sets of data are identical (but in arbitrary order)

Let’s say “User A” has a set of data like below. Each entry has been hashed (sha256) to ensure integrity within a single entry. You can’t modify data of a single entry without also modifying the corresponding hash:

[ { data: "000000", hash: "91b4d142823f7d20c5f08df69122de43f35f057a988d9619f6d3138485c9a203" },  { data: "111111", hash: "bcb15f821479b4d5772bd0ca866c00ad5f926e3580720659cc80d39c9d09802a" },  { data: "345345", hash: "dbd3b3fcc3286d927ec214c5648fbb226353a239789750f51430b1e6e9d91f4f" },  ] 

And “User B” has the same data but in a slightly different order. Hashes are the same of course:

[ { data: "345345", hash: "dbd3b3fcc3286d927ec214c5648fbb226353a239789750f51430b1e6e9d91f4f" },  { data: "111111", hash: "bcb15f821479b4d5772bd0ca866c00ad5f926e3580720659cc80d39c9d09802a" },  { data: "000000", hash: "91b4d142823f7d20c5f08df69122de43f35f057a988d9619f6d3138485c9a203" },  ] 

I want to allow both users to verify they have the exactly same set of data, ignoring sort order. If, as an extreme example, a hacker is able to replace User B’s files with otherwise valid-looking data, the users should be able to compare a hash of their entire datasets and detect a mismatch.

I was thinking to calculate a “total hash” which the users could compare to verify. It should be next to impossible to fabricate a valid looking dataset that results in the same “total hash”. But since the order can change, it’s a bit tricky.

I might have a possible solution, but I’m not sure if it’s secure enough. Is it, actually, secure at all?

My idea is to convert each sha256 hash to integer (javascript BigInt) and multiply them with modulo to get a total hash of similar length:

 var entries = [ { data: "345345", hash: "dbd3b3fcc3286d927ec214c5648fbb226353a239789750f51430b1e6e9d91f4f" },  { data: "111111", hash: "bcb15f821479b4d5772bd0ca866c00ad5f926e3580720659cc80d39c9d09802a" },  { data: "000000", hash: "91b4d142823f7d20c5f08df69122de43f35f057a988d9619f6d3138485c9a203" },  ];  var hashsize = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); var totalhash = BigInt(1); // arbitrary starting point  for (var i = 0; i < entries.length; i++) {   var entryhash = BigInt("0x" + entries[i].hash);   totalhash = (totalhash * entryhash) % hashsize;  } totalhash = totalhash.toString(16); // convert from bigint back to hex string 

This should result in the same hash for both User A and User B, unless other has tampered data, right? How hard would it be to create a slightly different, but valid-looking dataset that results in the same total checksum? Or is there a better way to accomplish this (without sorting!).