How do you get substitution to recognized a derivative?

I have a simple expression involving a derivative:

x[t_] = Q/T[t]; Simplify[Derivative[1][x][t] /. Q -> x T[t]] 

That produces:$ $ -\frac{x T'[t]}{T[t]}$ $ I have another relation: $ T=a^{-1}$ . When I make the substitution, I get this:

FullSimplify[-((x*Derivative[1][T][t])/T[t]) /. T[t] -> 1/a[t]] 

$ $ -x a[t] T'[t]$ $

But what I want is this: $ $ -\frac{x a[t]}{a'[t]}$ $ I know I can force the issue with an additional substitution of $ T'[t]=a'[t]^{-1}$ , but it seems to me that I’ve already given Mathematica everything it needs to make that substitution on it’s own. How do I force MMa to recognize this kind of substitution in the derivative?

Substitution of expressions in a symbolic expression

I define tables of symbolic variables in the following form (for convenience)

X = Table[Symbol["x" <> ToString[i]], {i, 1, num}]; Y = Table[Symbol["y" <> ToString[j]], {j, 1, num}];  

And after that, in cycles, I create some expressions. For example, here is one of them

Expon := Exp[ - ((X[[1]] * Y[[1]]) / 4) ];  For[i = 2, i <= num, i++,  Expon = Expon * Exp[ - ((X[[i]] * Y[[i]]) / 4)] ]  

After that, I want to act by some differential operator on my symbolic expression (let’s call it $ \Psi$ ) and substitute in the final expression some tables of numbers X1 and Y1 (here they are not symbolic, but filled by real numbers). I tried to use ReplaceAll ./ command, but it didn’t work. Could you tell me please, how can I substitute two or more tables of real numbers in symbolic expression? Long story short, how to calculate something like $ \Psi(X1, Y1)$ ?

Choosing Constant for Last Step in Substitution METHOD $T(n)= 5T(n/4) + n^2$

I figured out a solution to a recurrence relation, but I’m not sure what the constant should be for the last step to hold.

$ T(n)= 5T(n/4) + n^2$

Guess: $ T(n) = O(n^2)$

Prove: $ T(n) \leq cn^2 $


$ T(n) \leq 5(c(n/4)^2) + n^2 $

$ = (5/16)cn^2 + n^2 $

$ \leq cn^2 $

For the last step to hold I’m not sure what the value of c should be because of the (5/16). My guess would be c >= 1 and I’m not sure if that would hold.

Substitution of monomorphic type variables in generalized Hindley–Milner

I am trying to understand the constraints-based Hindley–Milner type inference algorithm described in the Generalizing Hindley-Milner paper. The function $ \text{S}\small{\text{OLVE}}$ is defined as follows:

$ $ \begin{array}{l} \text{S}\small{\text{OLVE}} :: Constraints → Substitution \ \text{S}\small{\text{OLVE}} (\emptyset) = [\ ] \ \text{S}\small{\text{OLVE}} (\{ \tau_1 \equiv \tau_2 \} \cup C) = \text{S}\small{\text{OLVE}} (\mathcal{S} C) \circ \mathcal{S} \ \quad \quad \quad \text{where}\ \mathcal{S} = \text{mgu}(\tau_1, \tau_2) \ \text{S}\small{\text{OLVE}} (\{ \tau_1 \leq_M \tau_2 \} \cup C) = \text{S}\small{\text{OLVE}} (\{ \tau_1 \preceq \text{generalize}(M, \tau_2) \} \cup C) \ \quad \quad \quad \text{if}\ (\text{freevars}(\tau_2) − M) \cap \text{activevars}(C) = \emptyset \ \text{S}\small{\text{OLVE}} (\{ \tau \preceq \sigma \} \cup C) = \text{S}\small{\text{OLVE}} (\{\tau \equiv \text{instantiate}(\sigma)\} \cup C) \ \end{array} $ $

Most of this is clear, but where I am confused is around how substitution is defined for the monomorphic set $ M$ . The paper explains that

For implicit instance constraints, we make note of the fact that the substitution also has to be applied to the sets of monomorphic type variables.

$ $ S(\tau_1 \leq_M \tau_2) =_{def} \mathcal{S} \tau_1 \leq_{\mathcal{S} M} \mathcal{S} \tau_2 $ $

but I don’t find any details of how $ \mathcal{S} M$ is defined. Based on Example 3, I think we should get something like:

$ $ \text{S}\small{\text{OLVE}} (\{\tau_4 \leq_{\{ \tau_1 \}} \tau_3, \text{Bool} \rightarrow \tau_3 \equiv \tau_1 \}) \ = \text{S}\small{\text{OLVE}} (\{\tau_4 \leq_{\{ \tau_3 \}} \tau_3 \}) \circ[\tau_1 := \text{Bool} \rightarrow \tau_3] $ $

In this step, unifying $ \text{Bool} \rightarrow \tau_3 $ and $ \tau_1 $ gives a substitution $ \mathcal{S} = [ \tau_1 := \text{Bool} \rightarrow \tau_3 ] $ , and $ M = \{ \tau_1 \} $ , and so apparently $ \mathcal{S} \{ \tau_1 \} = \{ \tau_3 \} $ , but how do we arrive at that? Maybe there is something obvious I have overlooked here.

How to solve this recurrence relation using substitution method

Can anyone explain to me how to demonstrate that,

T (n, d) ≤ T (n − 1, d) + O(d) + d/n (O(dn) + T (n − 1, d − 1))

is solved by

T (n, d) ≤ bnd! (b is a constant)

using the substitution method?

I have done this but I don’t know if it is correct.

  • T (n-1, d) ≤ b(n-1)d!
  • O(d) ≤ bd
  • d/n (O(dn) + T (n − 1, d − 1)) ≤ d/n (bnd + b(n-1)d(n-1)!)

How does substitution work?

There is an example of applying a substitution to an expression, and I am having a problem with it. let $ \theta = \{ x/f(y), y/z \}$ , and $ E=p(x,y,g(z))$ , then $ E\theta = p( f(y),z,g(z) )$ .

why is $ y/z$ not applied to $ E$ after using $ x/f(y)$ , so that the answer would be $ E\theta = p( f(z),z,g(z) )$ .

Inheritance: Folders and Files & Liskov Substitution Principle

Based on what I have been reading about the Liskov Substitution Principle, I understand that a square and rectangle class cannot be a part of the same inheritance tree.

I would like to apply these ideas to a Folder and a File, as they commonly exist on disk. Is there a property of one or the other or both which would force a conclusion they too should not be part of the same inheritance tree according to Liskov?

What are some properties we could consider?

  1. The data. Files consist of bytes. However, Folders can be considered to consist of the bytes of the files they contain.

  2. Access to both is defined by permissions

I suppose the property where inheritance breaks down would be one concerning containment. A folder contains files. A file does not.

How does the spell “Extract water elemental” interact with the energy substitution class feature of elemental savant?

Basically as the title states.

The elemental savant energy substitution states that any damaging spell of a certain type is converted to a chosen type (in my instance, fire).

Will this spell instead extract a fire elemental somehow if the creature is slain? Or will the substitution not take place since the damage of the spell deals is untyped?

Spell in question: “Extract water elemental” Spell compendium Page 86

Prestige Class Elemental Savant -> 3.5 Complete Arcane page 32-34 Class feature in question: Elemental specialty

What is the correct interaction between the spell and the mentioned class ability?