What minimal space can a creature go through when squeezing?

A creature "squeezes" when going through a smaller space. PHB p. 193 "Creature size":

A creature can squeeze through a space that is large enough for a creature one size smaller than it.

Presumably, that means a creature can go through a space small enough for it to squeeze in, but not smaller. But how small this space can be? "A space that is large enough for a creature one size smaller" is unclear. How large is "large enough"? The same chapter says

A creature’s space is <…> not an expression of its physical dimensions. A typical Medium creature isn’t 5 feet wide, for example.

So if not 5 feet wide, how small that space can be? The answer to Can Medium creatures squeeze into smaller spaces? partially answers this by saying

While the small creature would be able to do it easily, the medium creature would need to squeeze.

But this is basically redefining what "squeezing" means for Medium creature through what it does for Small ones.

Filter records and find those with minimal date

I have the following tables in Microsoft SQL Server:

  1. Users: Includes uID (primary key), birthDate, name
  2. Conversations: Includes convID (primary key), hostID (foreign key for uID in Users)
  3. Participants: Includes uID (foreign key for uID in Users), convID (foreign key for convID in Conversations).

I need to write a query which finds the name, ID and birth date of the oldest user who didn’t participate in any conversation, and that his name contains the letter ‘b’. If there is more than one user, I need to return all of them.

I don’t know how to both filter the users, and than find those with the minimal birth date (the oldest).

Transition multiple independent WP sites to one WP multisite on the server with minimal downtime

I currently have three independent WordPress blogs hosted on a single shared server.

The main domain (we’ll call domain-A is sitting in the public_html folder. domain-B and domain-C are separate WP installs residing as subfolders within public_html. Each of the installs is mapped to its own, unique URL.

Here’s the structure of the server:

/public_html     ..core WP files, etc     /domain-B         ...WP install core files     /domain-C         ...WP core... 

I am attempting to set up a WP multisite, incorporating all 3 blogs under domain-A as my main parent site.

My plan is to create the multisite in another subfolder in public_html and once the site is configured, I want to seamlessly – with minimal downtime – swap out the independent sites for the one multisite.

How would I do that?

Here’s what the new server config might look like:

/public_html     ..core WP files, etc     /domain-B         ...WP install core files     /domain-C         ...WP core...     /new_multisite 

Ideally, it would be great if I just had one wp multisite install in the root folder and could remove the other independent installs, e.g:

/public_html     ... wp multisite core files, etc.. 

I read some stuff about configuring my local hosts file on my system to be able to re-route the IP address to a domain URL (still a little fuzzy on some of the details of that) but I don’t see how that helps with a live site and/or a remote server.

Also, is it safe to create a "sandbox" site in a subfolder on the shared server? How can I keep this folder undiscovered or inaccessible? I am considering doing the setup on my local computer using WAMP as a dry run but I’ll still have to contend with uploading it to the live server, testing it, then making the switch from 3 independent blogs to one multisite.

Edit: I’m learning now that .htaccess can be used to control redirects to a subdomain, so theoretically, all requests to the original domain(s) can be redirected to sites/domains within the multisite. Obviously, the specifics of this starts to get a little hairy.

Thanks in advance,

Finding the upper bound of states in Minimal Deterministic Finite Automata

I have a task to determine the upper bound of states in the Minimal Deterministic Finite Automata that recognizes the language: $ L(A_1) \backslash L(A_2) $ , where $ A_1 $ is a Deterministic Finite Automata(DFA) with $ n$ states and $ A_2$ is Non-deterministic Finite Automata(NFA) with $ m$ states.

The way I am trying to solve the problem:

  1. $ L(A_1) \backslash L(A_2) = L(A_1) \cap L(\Sigma^* \backslash L(A_2)$ , which is language, that is recognised by automata $ L’$ with $ n*m$ states
  2. Determinization of $ L’$ which has $ (n*m)^2$ states and it is the upper bound of states.

Am I right?

Finding minimal degree for a B-Tree

We are given 44,000,000 elements. We want to store them in a B-Tree so that his height is 5 (no more than 5).
We are asked: “What is the minimal t we can choose?”

($ t$ is the minimal degree, in each vertex that is not the root we have at least $ t-1$ keys but no more than $ 2t-1$ )

We have a debate whether the minimal $ t$ for the minimal height is $ 10$ or $ 30$ :

Some calculated as so: $ 5 = \log_t(22,000,000)$
which gives us $ t \approx 29.4$ and so $ t = 30$

However then a some good questions were asked whether we know the inserting order or not, if we know then it may be $ t=10$ and if we do not it may be $ t=30$

The TA answered that while we show that we can insert all the elements under the constraints, it is valid, the height should not be more than $ 5$ . Given we know all the elements and now you create the tree, your task is to show how to build a B-Tree (the exact calculation for the minimal $ t$ )

We are stuck from here, we do not know which way is correct.
Thank you!

Number of minimal perfect hash functions that are order preserving- why is it true?

Suppose we have a universe of $ u=|U|$ elements. We called a set of $ H$ function $ (U,m)$ order-preserving minimal perfect hash family (OPMPHF) if for every subset $ M\subset U$ of size $ m$ has at least one function $ h\in H$ which is an over preserving minimal prefect hash. It is shown in [1,2] that for every
$ (U,m)$ -OPMPHF $ H$ obeys:

$ $ H=m! \cdot {u \choose m}/(\frac{u}{m})^m $ $

Thus, the program length for any order preserving minimal perfect hash function should contain at least $ \log_2 |H|$ bits.

In partiular, if $ m=3,u=8$ , we have that $ |H|\geq 17.7$ .

However, I think I can create as set of $ |H|=6$ functions for such family. For every $ 2\leq i\leq 7$ we define $ f_i(x)$ to be equal $ 1$ if $ x<i$ , equal $ 2$ if $ x=i$ and equal $ 3$ if $ x\geq i$ . Every function $ f_i$ is order-preserving, and for each set $ M$ with second element $ i$ has a perfect function $ f_i$ .

Do I miss something in my analysis?

[1]- http://160592857366.free.fr/joe/ebooks/ShareData/Optimal%20algorithms%20for%20minimal%20perfect%20hashing.pdf [2]-K. Mehlhorn. Data Structures and Algorithms 1: Sorting and Searching, volume 1. Springer-Verlag, Berlin Heidelberg, New York, Tokyo, 1984

MST with possibly minimal diameter

I am working with some research problem connected loosely to TSP which requires to find the Minimum Spanning Tree of a fully connected, weighted graph, where all the weights are positive and the graph is undirected (just like in Christofides algorithm). The point is, the problem I am working on requires me to find the MST with possibly lowest diameter (the number of nodes on the longest path between any two leaf nodes, equivalently, for the purpose of measuring the diameter one can treat all the edges of the MST as if they had the weight equal to 1).

I know that Boruvka’s, Prim’s and Kruskal’s algorithm can be used to find some MST, but can I influence them somehow to prefer the shortest (in the terms of the diameter) trees possible?

If the answer to the question above is negative, are there any algorithms or methods which either yield MST with some bounds on the tree diameter or, at least, are there any known methods of obtaining a bound on MST diameter for a given graph?

algorithm that finds minimal vertex cover of a given vertex

i am looking for a simple algorithm that gets as an input an undirected graph and a vertex in the graph and outputs the minimal vertex cover that v belongs to.

not sure on how to do it correctly, here’s my attempt:

for a given undirected graph $ G=(V,E)$ and a vertex $ v \in G$

1)$ edges \leftarrow \emptyset $

2)remove adjacent edges to given vertex v(given in the input)

3)while there are edges in graph G:

3.1)$ edges \leftarrow {u,v}$

3.2)$ G\:\leftarrow \:G\:\:\ \:\:\left\{u,v\right\}$ (doesn’t let me mark it correctly, but i meant remove {u,v} from G. doesn’t give me to write \ correctly

3.3)return |x|+1 (including v we got from the input)

how to make it better? would appreciate seeing better algorithms for this and explanations/insights so i can learn

thank you for your efforts

Find the minimal subset of rows of some matrix such that the sum of each column over this rows exceeds some threshold

Let $ A$ be a an $ n\times m$ real valued matrix. The problem is to find the minimal subset $ I$ of rows (if there is any) such that the sum of each column $ j$ over the corresponding rows exceeds some threshold $ t_j$ , i.e. $ \sum_{i\in I}A[i,j]>t_j$ for all $ j\in\{1,\dots m\}$ .

Or, stated as optimization problem:

Let $ A\in\mathbb{R}^{n\times m}, t\in\mathbb{R}^m$ . Now solve \begin{align}\min_{\xi\in\{0,1\}^n}&\sum_{i=1}^n\xi_i\\text{s.t.}&\,A^\top\xi>t\,.\end{align}

Actually, i would need a solution only for $ m=2$ , but the general might be interesting too.