Asymptotic of divide-and-conquer type recurrence with non-constant weight repartition between subproblems and lower order fudge terms

While trying to analyse the runtime of an algorithm, I arrive to a recurrence of the following type :

$ $ \begin{cases} T(n) = \Theta(1), & \text{for small enough $ n$ ;}\ T(n) \leq T(a_n n + h(n)) + T((1-a_n)n+h(n)) + f(n), & \text{for larger $ n$ .} \end{cases}$ $ Where:

  • $ a_n$ is unknown and can depend on $ n$ but is bounded by two constants $ 0<c_1\leq a_n \leq c_2 < 1$ .
  • $ h(n)$ is some “fudge term” which is negligeable compared to $ n$ (say $ O(n^\epsilon)$ for $ 0\leq \epsilon < 1$ ).

If $ a_n$ was a constant, then I could use the Akra-Bazzi method to get a result. On the other hand, if the fudge term didn’t exist, then some type of recursion-tree analysis would be straight-forward.

To make things a bit more concrete, here is the recurrence I want to get the asymptotic growth of:

$ $ \begin{cases} T(n) = 1, & \text{for n = 1;}\ T(n) \leq T(a_n n + \sqrt n) + T((1-a_n)n+\sqrt n) + n, & \text{for $ n \geq 2$ } \end{cases}$ $ Where $ \frac{1}{4} \leq a_n \leq \frac{3}{4}$ for all $ n\geq 1$ .

I tried various guesses on upper bounds or transformations. Everything tells me this should work out to $ O(n\log(n))$ and I can argue informaly that it does (although I might be wrong). But I can only prove $ O(n^{1+\epsilon})$ (for any $ \epsilon>0$ ), and this feels like something that some generalization of the Master theorem à la Akra-Bazzi should be able to take care of.

Any suggestions on how to tackle this type of recurrence?

Please explain me this question in very simple terms

Consider the following snapshot of a system running n processes. Process i is holding Xi instances of a resource R, 1 <= i <= n. currently, all instances of R are occupied. Further, for all i, process i has placed a request for an additional Yi instance while holding the Xi instances it already has. There are exactly two processes p and q such that Yp = Yq = 0. Which one of the following can serve as a necessary condition to guarantee that the system is not approaching a deadlock? (A) min (Xp, Xq) < max (Yk) where k != p and k != q (B) Xp + Xq >= min (Yk) where k != p and k != q (C) max (Xp, Xq) > 1 (D) min (Xp, Xq) > 1

What’s the best bucket fill algorithm in terms of efficiency?

I am looking for an algorithm that fills a given region of connected particular nodes in minimum time. I have tried using flood flow algorithm but it’s too slow and inefficient for large array, it checks each pixel more than once. Is there any algorithm that is more efficient than flood flow algorithm.

If that helps, i want to implement this algorithm for a paint filling app

Does hiding variables work in terms of blocks or line-by-line?

Let’s assume I have the following code:

declaration of a declaration of b ..a..b {   ..a..b   declaration of a    declaration of b   ..a } 

In this code {} represent the inner block. declaration represents binding occurrence, and .. represent applied occurrence.

So my question is that is it legal to use the outer scope variables inside an inner scope and then redeclare them ? If so how does the hiding of outer variables system work (Does it start to work when it sees a redeclaration)? Thanks in advance.

In terms of optimisation, what’s the point of Ruathar?

I’ve often seen three levels of Ruathar come up in level 20 Cleric builds. Obviously, there’s no real disadvantages to taking the class (e.g. it advances spellcasting), but why would an optimiser actually take it? Considering how late it is likely to be taken, its class features seem to offer little to nothing over its three levels.

Taking some terms from a polynomial

I have a polynomial like this:

ser = 1 - x/2 - x^2/8 - x^3/16 + y/2 + (3 x y)/4 + (23 x^2 y)/16 + ( 27 x^3 y)/32 - y^2/8 - (31 x y^2)/16 - (127 x^2 y^2)/64 - ( 351 x^3 y^2)/128 + y^3/16 + (35 x y^3)/32 + (407 x^2 y^3)/128 + ( 1915 x^3 y^3)/256; 

Now I want to extract the terms with total degree smaller than 4. Using patterns, I can realize the goal.

Cases[ser, (_*x^m_.*y^n_. /; m + n < 5) | (_?NumericQ*y^j_. /; j < 5) | (_?NumericQ*x^i_. /; i < 5) | _?NumericQ] 

But I think my method is a little tedious. I have two questions: 1. can my method be simplified? 2. are there other simple methods to do the job?

How are swarms considered in terms of number of creatures?

There is, in Adventurers League Dnd, a monster statblock with the following ability :

At the start of his turn, every living creature within 100 feet must succeed on a DC 15 Constitution saving throw or they lose 5 hit points and [he] regains 5 hit points.

That monster also has an ability to spawn Swarms of Rot Grubs (Medium swarms of Tiny Beasts). I am thus wondering how those two abilities interact.

More generally : how are swarms considered vis-à-vis creatures ?

  1. Considered as a single creature [here, would be a single CON save]
  2. Considered as many creatures (how do you say how many?) [here, would be X CON saves]
  3. Considered as no creature [here, would be 0 CON saves]

How can I plot this function in terms of R?

I have a function:

$ $ V(r)=\left( 1-\dfrac{2m}{r} \right)\left( \dfrac{l(l+1)}{r^2}-\dfrac{6m}{r^3} \right)$ $

I have to plot it in terms of the coordinate $ R=r+2m \ln(r-2m)$ . I thought I could use

M = 10; l = 1; V[R_] := (1 - 2 (M)/(r)) (l/r^2 + l^2/r^2 - 6M/r^3); R[r_] := r + 2 M Log[r - 2 M]; ParametricPlot[{V[r], R[r]}, {r, 0, 1}] 

but I get an empty plot.