What is the difference between these two Edit Distance Algorithm

Edit Distance is very well known problem in computer science. Came up with following algorithm after reading through CLRS but it doesn’t work. Check the working algorithm below, I couldn’t find why first algorithm doesn’t work while second one does.

  public int find (String word1, String word2, int i, int j, int count) {     if (i >= word1.length()) return  count + word2.length() - j;     if (j >= word2.length()) return  count + word1.length() - i;      if (dp[i][j] != -1) return dp[i][j];      if (word1.charAt(i) == word2.charAt(j)) {         dp[i][j] = find(word1, word2, i+1, j+1, count);     } else {         int replace = find(word1, word2, i+1, j+1, count + 1);         int delete = find(word1, word2, i+1, j, count + 1);         int insert = find(word1, word2, i, j+1, count + 1);                  dp[i][j] = Math.min(replace, Math.min(delete, insert));     }      return dp[i][j]; } 

Notice, how I’m passing the cost of edit in method argument. Now, the algorithm which works. Here I’m not passing the edit distance in the method parameter instead of I’m adding 1 to recursive method.

  public int find (String word1, String word2, int i, int j) {     if (i >= word1.length()) return  word2.length() - j;     if (j >= word2.length()) return  word1.length() - i;      if (dp[i][j] != -1) return dp[i][j];      if (word1.charAt(i) == word2.charAt(j)) {         dp[i][j]  = find(word1, word2, i+1, j+1, count);     } else {         int replace = find(word1, word2, i+1, j+1, count + 1);         int delete = find(word1, word2, i+1, j, count + 1);         int insert = find(word1, word2, i, j+1, count + 1);                  dp[i][j] = 1 + Math.min(replace, Math.min(delete, insert));     }      return dp[i][j]; } 

I’m not able to think why first algorithm fails. Appreciate, if you can point my error in understanding.

What’s the difference in Geas saying it can be removed by Wish?

The text for geas says the following about removing the spell:

A remove curse, greater restoration, or wish spell also ends it.

However, you can already use wish to replicate remove curse or greater restoration and thus end geas. It seems redundant.

What’s the difference if it didn’t mention using Wish? Is there a genuine mechanical difference that I’m missing?

difference between two uncomputable functions

for $ L1$ regular language, $ L2$ some language, $ L1$ \ $ L2$ is regular, decidable. yet, the next transition function might not even be computable:

$ F′=$ {$ \,q:δ(q,w)∈F \, for\, some\, w∈ L2\,$ }$ .$

$ HALT\,=$ {$ <M,w>|M\,is\, a\, TM\, and\, M\, halts\, on\, w\,$ }

$ on (M,w):\, return\, 1\, is\, M\, halts\, on\, w\, \, return\, 0\, else\, $

this function is also well defined, but not computable. We know that the halting problem isn’t decidable. what is the difference? In both cases the functions are well defined, but the first case is decidable, and the second isn’t.

Is there a difference between “one round” and “until the end of your turn” in terms of duration?

I’m mainly concerned about the effects that last “one round” and “until the end of turn” (like Stone Bones ToB p.84 and Inferno Blade ToB p. 54, respectively). My guess is that “until end of turn” effects end after you’ve taken your “standard” actions (one swift action, one move action, one standard action, or whatever the duration equivalent would be, like a full-round action), so the reactions you take on that round are not affected by that effect. On the contrary “one round” effects would be in effect until it’s that PC’s turn again.

However, my DM insists that both effects would last until that PC’s turn comes again, having no distinction, even if it has different wording. So, really, what’s a round and what’s a turn in this case? Are they the same?

Simplify Difference of Conjugate Pairs

Is it possible to easily simplify the difference of conjugate pairs?

In particular, if there’s just a single variable, then

FullSimplify[a - Conjugate[a]] 
2 I Im[a] 

But trying to do the same thing with a slightly more complex expression fails:

FullSimplify[a Conjugate[b] - Conjugate[a] b] 
a Conjugate[b] - Conjugate[a] b 

I have found one solution (answered below) but it relies on a FullSimplify which doesn’t seem very optimal.

Is there supposed to be a huge difference in power between demon princes and archdevils?

The Book of Vile Darkness for 3e introduces statblocks for both demon princes and archdevils, and with a couple exceptions, they all have HDs in the mid-to-high 30s.

Then Fiendish Codex I comes along and says “nah, in 3.5 all the demon lords–princes included–have hit dice in the mid 20s. If you want to make them epic so that your epic-level players can enjoy a tough fight, though, here are some tips on how to do that.”

Obviously with fewer HDs, the demon lords have lower hit points, attack bonuses, and saves. So, okay. It seems like 3.5 just doesn’t want them to be quite as strong. Maybe 3.5 just squashes things down a little compared to 3e–it’s been a while since Deities and Demigods, so it’s possible that if the entities in that book were “updated to 3.5 standards”, they’d be weaker, too.

But then, in Fiendish Codex II, it basically says “these are only aspects for archdevils, because the real things are way stronger. If you want to make actual stats for archdevils, here are some tips on how to improve these aspects.”

And then the 3.5 archdevil aspects are at the same power level as 3.5 demon lords (if not slightly stronger), with basically the same guidelines to create “real archdevils” as the first book had to create “improved demon lords”!

So… What’s the deal with that? In the DnD canon, are archdevils just way stronger than demon princes? Did this happen at some point in the settings’ timelines between 3e and 3.5, or has it always been the case? Or did the bookwriters just change their minds midway through 2006 and decide to backpedal on giving nonepic archfiends, but never go back and change the now-weakened demon lords?