How to plot a set of complex numbers with given argument and absoulute value bounds

I want to plot the following complex numbers $$z \in \text{(complex numbers)}:\pi/4 < \arg (z) \leq 5 \pi/4,\ 1 \leq |z| < 2$$

I don’t know how to graph it so that it would look like 2D without any unecessary details. The closest I found how I want it to look is, when I looked at how graphing of parametric function looks. I tried to use contour plot to graph it, but I just can’t seem to do it…

ContourPlot[ Im[F[z[x, y]]], {3 pi/4 < arg (z) <= 5 pi/4, 1 <= abs (z) < 2}, {x, -.2, .2}, {y, -.2, .2}, PlotRange -> All, Contours -> Range[-5, 5, .5], ContourLabels -> True]

Does anybody know how to graph my set?

How to convert a Dataset into an indexed dataset / association-of-associations given a column header?

Given a dataset as such

If "letter" is the header that is chosen, how do I convert it into an indexed dataset / association-of-associations?

i.e. How do I define f such that f[dataset_,columnHeader_] produces the following?

Please note GroupBy is close but fails as you are unable to use Part to work with the result to extract column data. eg:

data = {<|"letter" -> "a", "foo" -> 1, "bar" -> 2|>, <|"letter" -> "b", "foo" -> 3, "bar" -> 4|>, <|"letter" -> "c", "foo" -> 5, "bar" -> 6|>}; dataDS = Dataset[data]; dataDSg= GroupBy[dataDS, Key["letter"]]; dataDSg[All, "foo"] (* <- produces an error *) 

Where as data in the format of an association-of-association works fine

data2 = <|"a" -> <|"foo" -> 1, "bar" -> 2|>, "b" -> <|"foo" -> 3, "bar" -> 4|>, "c" -> <|"foo" -> 5, "bar" -> 6|>|>; data2DS = data2 // Dataset; data2DS [All, "foo"] (* <- returns a dataset with 1,3,5 *) 

What challenge rating (‘CR’) is a Medusa given the textbook NPC-Diviner-Wizard casting ability?

I wanted to give a recurring villain / anti-hero medusa some (15th level) wizard abilities, a.k.a. the N.P.C. Diviner as featured in Vole’s or Xanathar’s or Tasha’s or somewhere. She can use this NPC class to ‘reset’ her Portent ability with every (re)cast of any 1st lvl+ Divination spell. This is handy for Petrification management for both attacks &/or mistakes.

Basic question: what is her total Challenge Rating? Clearly not 6 (‘Medusa’s CR’) + 8 (Divination Wizard’s CR) = 14 (sum total). It seems the Monster Manual, the DM’s Guide and Players Handbook (and other guides) all offer tip-suggestions – yet I remain challenged by Challenge Rating.

Why I Require This ‘True’ Challenge Rating:

With a ‘true’ medusa-wizard CR the P.C. group will:

• gain the ‘appropriate’ treasure(s) considered fair &/or balanced;
• also gain matching-appropriate ‘x.p.’ rewards, and;
• (most importantly) the player-group will be slightly less bitter encountering a ‘monster’ with approximately an arch-mage’s firing power backed by with her Clone-able immortal body.

How to change color of points and lines in the given code?

Using this code

data = Table[{n, Sin[2 n]/n}, {n, 1, 100}]; ListLogPlot[data,    Joined -> True,    Mesh -> All,    PlotMarkers -> {"•", 9},    PlotStyle -> Thickness[0],    BaseStyle -> 10] 

I get

How can I control and change the color of points and lines? For example, how can I have black points with gray lines? or any other colors.

What can cause higher CPU time and duration for a given set of queries in trace(s) ran on two separate environments?

I’m troubleshooting a performance issue in a SQL Server DR environment for a customer. They are running queries that consistently take longer in their environment than our QA environment. After analyzing traces that were performed in both environments with the same parameters/filters and with the same version of SQL Server (2016 SP2) and the exact same database, we observed that both environment were picking the same execution plan(s) for the queries in question, and the number of reads/writes were close in both environments, however the total duration of the process in question and the CPU time logged in the trace were significantly higher in the customer environment. Duration of all processes in our QA environment was around 18 seconds, the customer was over 80 seconds, our CPU time was close to 10 seconds, theirs was also over 80 seconds. Also worth mentioning, both environments are currently configured to MAXDOP 1.

The customer has less memory (~100GB vs 120GB), and slower disks (10k HHD vs SSD) than our QA environment, but but more CPUs. Both environments are dedicated to this activity and should have little/no external load that wouldn’t match. I don’t have all the details on CPU architecture they are using, waiting for some of that information now. The customer has confirmed they have excluded SQL Server and the data/log files from their virus scanning. Obviously there could be a ton of issues in the hardware configuration.

I’m currently waiting to see a recent snapshot of their wait stats and system DMVs, the data we originally received, didn’t appear to have any major CPU, memory or Disk latency pressure. I recently asked them to check to see if the windows power setting was in performance or balanced mode, however I’m not certain that would have the impact we’re seeing or not if the CPUs were being throttled.

My question is, what factors can affect CPU time and ultimately total duration? Is CPU time, as shown in a sql trace, based primarily on the speed of the processors or are their other factors I should be taking in to consideration. The fact that both are generating the same query plans and all other things being as close as possible to equal, makes me think it’s related to the hardware SQL is installed on.

as a Sorcerer, given that I can’t multiclass or take feats, how successful can I be at passing concentration checks starting at level 15 [closed]

I’m doing a melee sorcerer, but I’m afraid of losing my concentration in combat because in the higher levels the damage is too big and the concentration check is too difficult.
My campaign dosen’t allow feats and multiclassing, only ASI.
Is the haste spell worth it at higher levels?

not worth it to cast only to lose it in one round because I was hit and lost concentration – that’s what I mean by "Is it worth it?"

dex- (+2) str- (+2) / int – (0) / wis- (-1) / const (+5)

prof- (+5)

Given a row sum vector and a column sum vector, determine if they can form a boolean matrix

For example, for a boolean matrix of size $$3×4$$, the row sum vector $$R = (3, 3, 0, 0)$$ and the column sum vector $$C = (2, 2, 2)$$ form a match because I can construct the boolean matrix:

$$\begin{matrix} & \begin{bmatrix} 1 & 1 & 0 & 0\ 1 & 1 & 0 & 0\ 1 & 1 & 0 & 0 \end{bmatrix} & \begin{pmatrix} 2\2\2 \end{pmatrix} = C \ R = &\begin{pmatrix} 2 & 2 & 0 & 0 \end{pmatrix} \end{matrix}$$

However, the column vector $$C’ = (4, 1, 1)$$ doesn’t form a match with $$R$$.

So given two vectors whose values are sorted in descending order $$R_{1, w}$$ and $$C_{h, 1}$$, and whose accumulated sum is the same, $$T = \sum_jR[1, j] = \sum_iC[i, 1]$$, how can I polynomically check if $$R$$ and $$C$$ form a matching because I can form a matrix $$M_{h,w}$$ having $$R$$ and $$C$$ as row and column sum vectors?

More specifically, in case it can help to make the check algorithm faster, in my specific case, R and C has the following properties:

• $$h \leq w$$
• The number of positive values of $$R$$ and $$C$$ is $$> w$$. For example, $$R$$, in the example, has two positive values and $$C$$ has three positive values, and it happens that $$2 + 3 > w = 4$$.

Finding the most frequent element, given that it’s Theta(n)-frequent?

We know [Ben-Or 1983] that deciding whether all elements in an array are distinct requires $$\Theta(n \log(n))$$ time; and this problem reduces to finding the most frequent element, so it takes $$\Theta(n \log(n))$$ time to find the most frequent element (assuming the domain of the array elements is not small).

But what happens when you know that there’s an element with frequency at least $$\alpha \cdot n$$? Can you then decide the problem, or determine what the element is, in linear time (in $$n$$, not necessarily in $$1/\alpha$$) and deterministically?

How to compute a vector V when N points are given and V satisfies given properties

We are given N points P1,P2,…,PN in a 2D plane(All points are distinct and N is as large as 10^5). For each valid i, the coordinates of the point Pi are (xi,yi). Help me to find a vector V = (a, b) ( where |a|, |b| <= 1e9) such that the following holds:

For each i (1 ≤ i ≤ N), let Si= dot(V, G(Pi, Pi+1)). lets assume PN+1=P1. where G(v1, v2) = ((v2(x) – v1(x)), (v2(y) – v1(y)) and dot(V1, V2) denotes dot product of two vectors

How to choose V such that It is possible to find two integers l and r (1 ≤ l ≤ r ≤ N) such that:

Si < 0 if(i <= r and i >= l) and Si > 0 otherwise

(or)

Si > 0 if(i <= r and i >= l) and Si < 0 otherwise

I need to know if there is a way of choosing vector (a, b) to satisfy the above conditions(If the solution is possible)

Determine if there is a subset of the given set with sum divisible by a given integer

I’ve been given a question to solve:

Given a set of non-negative distinct integers, and a value $$m$$, determine if there is a subset of the given set with sum divisible by $$m$$.

For this question the answer is here

I don’t understand the part after if DP[j]==True
what is actually the intuition behind this code. Please explain in detail.