How to divide a list in linear time where every element in the first part is smaller than every element in the second list

How to divide a list into to equal part (even-number list size) in linear time where every element in the first part is smaller than every element in the second part

I tried to use QuickSort but in can result in $ O(n^2)$ time complexity.

Does every specialization of Craft you take get the class skill bonus, or just the first?

Suppose I’m playing a character with Craft as a class skill. I put 1 rank in it, select Weaponsmith to fit my background and end up with Craft (Weapons) +4. Now, if I later decide I want to be able to make bows and arrows, do I also get another +3 bonus on Craft (Bows) when I invest a new rank? There are different kinds of craft, just like there are different kinds of knowledge, but the class skill bonus for craft is completely unspecified.

what happens to max flow if we decrease the capacity of every edge by some constant?

Given a graph $ G = (V,A)$ , with source $ s$ , sink $ t$ , edge capacity larger than 1 (but not all equal), I know that if we decrease the capacity of one edge by 1, the $ s,t$ -maximum flow decreases by at most 1. But I would like to know what happens to max flow if we decrease (or increase) the capacity of all edges by 1. I’d appreciate any comments/insights on this. Thanks!

Why am I ranking on last page in SERP for every keyword? [closed]

I couldn’t find this question anywhere. Everyone is talking about ranking and how to rank on top in SERPs. I used to rank on top 2 or 3 pages a lot but Now I don’t rank anymore. My content is authoritative and the site is also well optimized. Any suggestions?


Keyboard- Vivo y5s full specification, Location – India

Can Programmed Illusion respond to its environs, or must it perform the same thing every time?

Programmed Illusion:

You create an illusion of an object, a creature, or some other visible phenomenon within range that activates when a specific condition occurs. The illusion is imperceptible until then. It must be no larger than a 30-foot cube, and you decide when you cast the spell how the illusion behaves and what sounds it makes. This scripted performance can last up to 5 minutes. When the condition you specify occurs, the illusion springs into existence and performs in the manner you described. Once the illusion finishes performing, it disappears and remains dormant for 10 minutes. After this time, the illusion can be activated again. The triggering condition can be as general or as detailed as you like, though it must be based on visual or audible conditions that occur within 30 feet of the area. For example, you could create an illusion of yourself to appear and warn off others who attempt to open a trapped door, or you could set the illusion to trigger only when a creature says the correct word or phrase. Physical interaction with the image reveals it to be an illusion, because things can pass through it. A creature that uses its action to examine the image can determine that it is an illusion with a successful Intelligence (Investigation) check against your spell save DC. If a creature discerns the illusion for what it is, the creature can see through the image, and any noise it makes sounds hollow to the creature.

I suppose this really revolves around what the spell description means by “scripted performance”. Is this a script as in like a play, where it is acted out verbatim from start to finish, no matter how it is triggered? Or is it “scripted” in the sense of a bash script, where parameters can be specified such that it can respond to the environment? Can you have a conversation with this illusion? Can you have it refer to the weather or the time of day?

The thespian interpretation is supported by the fact that it calls it a “performance”.

The computational interpretation is supported by the fact that the spell is called “programmed illusion”. Also, the major image spell is able to carry on conversations, so it would seem silly to not allow programmed illusion to do that as well.

My instinct is that the spell would be worded differently if it was intended to be able to respond to the environment, but I am not sure.

Which is it?

Is it unbalanced to start players off with Inspiration every session?

I’d like to push my players to try and do more heroic things and take fun risks in every session. I’m considering having each player start with Inspiration to encourage this – but they can still get more in-session as well to do it again if earned.

I’m not sure if this un-balances the dice or not, or if it’s such a small change that it’ll be okay. In addition, are there any classes/races that could use this to their advantage more than others (aka is it balanced for all?)

I aim for 4-5 encounters per adventuring day with about 2-3 encounters per session. Encounters are generally at a ratio of 2:1 in terms of Combat to Roleplay.

Note: I also allow using Inspiration to force Disadvantage on a save or attack by an enemy.

Does every potion require an Action to consume?

The PHB description of a Potion of Healing states:

A character who drinks the magical red fluid in this vial regains 2d4+2 hit points. Drinking or administering a potion takes an action.

(emphasis mine)

My question is does this final sentence apply to all potions or just healing potions.

The DMG Description of a Potion of Healing does not explicitly specify that it requires an action to drink or administer.

The DMG p. 141 states that:

If an item requires an action to activate, that action isn’t a function of the Use an Item action…

But the “if” there clearly implies that there are magic items that do not require an action to activate.

The section on consumables on the same page says nothing about how long an item takes to activate.

We know that one could, for example, “drink all the ale in a flagon” as a free object interaction (PHB p. 190) but we know that a Healing Potion, at least, is an exception to that rule and always requires a full Action to consume.

This came up at the table with a potion of fire breathing. I made an at-the-table ruling that since healing potions require an action to consume, that one would as well. But is there clear guidance somewhere in the rules that I’ve missed? Or are we meant to take the final sentence of the PHB description of a Potion of Healing as the general rule?

Can every regular expression be written as sum of products?

I was trying to prove that Parikh Image of every regular language is semi-linear. Even though it is true for CFL, but this question was about regular languages. To prove this, I decided to proceed as follows:

Lemma 1: Every regular expression can be written as sum of products with star, i.e., $ R = R_1 + R_2+ … +R_n $ where each $ R_i$ is a regular expression not involving any $ +$ .

Lemma 2: The Parikh image of a language corresponding to a regular expression that doesn’t involve any $ +$ is linear.

I proved the lemma 2 by induction on the structure of this specific type of regular expression. (which was easy and correct, by the way).

After proving (allegedly) these, it was easy to state that the Parikh image of the language defined by $ R$ is just the union of linear sets, hence it is semi-linear.

I proved the lemma 1, again, using induction on the structure of the regular expression, but I am not sure if it is correct. Moreover, I am not sure if the Lemma 1 is even valid or not!

My proof was as follows:

  1. $ R = a $ where $ a \in \Sigma$ or $ a=\epsilon$ . This is already in the same form we required.

  2. $ R = R_1.R_2$ . This is also in required form.

  3. $ R = (R_1 + R_2).R_3$ . Replace by $ R_1.R_3 + R_2.R_3$ .

  4. $ R = (R_1 + R_2)^* $ Replace by $ (R_1^*.R_2^*)^*$

Do you think this proof is wrong, or even worse, the statement if wrong!