## time complexity – Finding \$l\$ subsets such that their intersection has less or equal than \$k\$ elements NP-complete or in P?

I have a set $$M$$, subsets $$L_1,…,L_m$$ and natural numbers $$k,lleq m$$.

The problem is:

Are there l unique indices $$1leq i_1,…,i_lleq m$$, such that

$$hspace{5cm}left|bigcap_{j=1}^{l} L_{i_{j}}right| leq k$$

Now my question is whether this problem is $$NP$$-complete or not. What irritates me is the two constraints $$l$$ and $$k$$ because the NP-complete problems that were conceptually close to it that I took a look on (set cover, vertex cover) only have one constraint respectively that also appears in this problem.

I then tried to write a polynomial time algorithm that looks at which of the sets $$L_1,…,L_m$$ share more than $$k$$ elements with other sets but even if all sets would share more than $$k$$ elements with other this wouldn’t mean that their intersection has more than $$k$$ elements…

This question kind of comes close but in it there is no restriction on the amount of subsets to use and the size of the intersection should be exactly $$k$$, but maybe this could be useful anyways.

Can somebody further enlighten me ?

## complex numbers – When is \$(a^b)^c\$ not equal to \$a^{bc}\$?

In this dsp.SE answer, the subtle point that $$e^{-jomega t} ne ({e^{jomega}})^{-t}$$ is made. At school I learned that $$(a^b)^c = a^{bc}$$, which is also supported by answers like this one.

When does it not work? Is it when $$b c$$ is a complex number? Or is it when $$b c$$ is not an integer? Or both? The linked dsp.SE answer hints at these, but I am looking for the technically strict version of the rule with all the gotchas I should be aware of.

Also, is there a name for this rule?

## How to find the size of gaps between entries in an array so that the first and last element of the array is filled and the gaps are all of equal size?

I have an array a of n entries. I need to place a token on the first and last position of that array, so `a(0) = 1` and `a(n-1) = 1`.

I now want to place additional tokens into that array with a distance inbetween each index i where `a(i) = 1` that is greater than 2 (so placing a token on every index is invalid as well as alternating using and not using an entry is invalid). Phrazed differently: I want that `sum(a) < n/2` . The gap inbetween each token should be the same, so say with an array of size 16,

`a(0) = 1, a(3) = 1, a(6) = 1, a(9) = 1, a(12) = 1, a(15) = 1`

would be a solution with a gap size of 2 (distance of 3).

How do I find all gap sizes that are possible to fill said array with the given constraints?

Imagine a street inbetween two crossroads where a lamppost should be placed on each crossroad and then additional lampposts should be placed equidistant to each other and for some reason only natural number distances are allowed.

(The actual problem I want to solve is where to place Sea Lanterns in my Minecraft Project so do not disregard this problem as an assignment question I want a solution for.)

## complexity theory – Is my reasoning wrong that \$PSPACE\$ should not equal \$EXPTIME\$?

It’s impossible for a problem to require exponential space without being exponential-time.

1. Consider that if an $$EXPSPACE~~complete$$ problem can be solved in $$2^n$$ time. It will now fall into the class $$EXPTIME$$.
2. Then $$EXPSPACE~~complete$$ problems are in $$EXP$$ if they can be solved in $$2^n$$ time. This means they can reduce into $$EXP~~complete$$ problems and vice versa.

To me, this should be easy to write a proof that $$EXPTIME$$ = $$EXPSPACE$$.

My intuition tells me that if $$Exptime$$ = $$Expspace$$; then $$PSPACE$$ != $$EXPTIME$$,

Because $$PSPACE$$ already is not equal to $$EXPSPACE$$.

## Question

As an amateur, what would make this reasoning be wrong or right?

## lens – Does the Nikon 35-70mm really equal the newer 24-70mm in image quality and sharpness?

I know this is an answer to an old question, but my response may be helpful to others who come here later. I recently picked up a very clean 35-70 f2.8D for the grand sum of \$200, which included shipping and the Nikon lens hood. I also at the same time picked up a 24mm f2.8D from Japan, mint in box for \$125. My thought was to use the 35-70 on camera, and carry the 24mm in a pocket to use when 35mm isn’t wide enough. This combination is within one ounce of the weight of the 24-70 2.8 Nikon zoom and costs \$1,000 less when comparing clean used lenses. At an event, I’m also carrying about ten ounces less around my neck compared to the 24-70.

I’m really happy with this combination on my D700 and my D600 in real picture taking. Honestly, the 24mm wide open is weaker in the corners than the 24mm setting of the 24-70mm zoom wide open that I have borrowed from my friend. Other than that, I can’t see a difference that matters to me. The “push-pull” zoom is not my favorite, but for a thousand bucks saved, I’ll live with it.

In terms of image quality and sharpness, the 24mp sensor of my D600, when I look at 100% and really pixel peep, I see a very slight improvement in favor of the 24-70 in terms of sharpness over the 35-70 in their shared focal length range that has yet to manifest itself in any real way in the photos I take or print, which are usually no larger than 20×30. The 35-70 gets a very, very slight boost in sharpness when stopping down from f2.8 to f4 if you are pixel peeping, but it is excellent at 2.8 and the difference almost isn’t worth mentioning. Stopping down further yields no additional improvement that I can see. There may be some differences on a 36 mp sensor, but I don’t know. Color rendition between the two lenses seems identical. The 35-70 has less distortion than the 24-70 at the wide end, but distortion is usually correctable later on.

Focus speed seems about the same between the 24-70 and the 35-70 to me, although the 24-70 is almost completely silent. Neither is objectionable though, even for quiet environments like a wedding ceremony. Another plus in favor of the 35-70 is that there is not AF-S motor to ever have to replace. On an unrelated note, the 35-70 retains an aperture ring, making it useful for manual focus film cameras. This was a concern for me because I still shoot those.

On the downside, the 35-70 is not at all happy being shot into the sun or a light source, flare is an issue even with a lens hood. Since I use this primarily for indoor events, this is of little concern to me, but may be significant to others. The 24-70 seems better in this regard.

Hope that helps.

## Split date range (timestamp) into equal parts by Month- SQL Server

Experts,
Have a question regarding splitting a date range into equal parts by months including the time part

example – fromdate – 06/29/2020 09:00:00 and todate – 06/29/2021 09:00:00

Want to split this date range into twelve equal parts like below

``````06/29/2020 09:00:00 - 06/30/2020 12:59:59
07/01/2020 00:00:00 - 07/31/2020 12:59:59
.........
.......
06/01/2021 00:00:00 - 06/29/2021 09:00:00
``````

I cant write recursive CTE as this is a sql synapse module I am running against..

With below query I am able to split the date part, but time part is not coming properly as above.. Please help me as this is a blocking my development

``````declare @FromTs DATETIME
declare @ToTs DATETIME
SET @FromTs = GetDate()
SET @ToTs = DATEADD(month, 12, @FromTs)

;WITH n(n) AS
(
SELECT ROW_NUMBER() OVER (ORDER BY (object_id))-1 FROM sys.all_columns
),
d(qi,qrt,qtt,n,f,t,md,bp,ep,rn) AS
(
SELECT
,n.n, @FromTs, @ToTs,
DATEDIFF(MONTH, @FromTs, @ToTs),
FROM n INNER JOIN <datetbl> AS d
ON @ToTs >= DATEADD(MONTH, n.n-1, @FromTs)
)
SELECT qi,qrt,qtt,
new_from_date = CASE n WHEN 0  THEN f ELSE bp END,
new_to_date   = CASE n WHEN md THEN t ELSE ep END,rn
FROM d WHERE md >= n
``````

## Split date range (timestamp) into equal parts by Month- SQL Server Synapse

Experts,
Have a question regarding splitting a date range into equal parts by months including the time part

example – fromdate – 06/29/2020 09:00:00 and todate – 06/29/2021 09:00:00

Want to split this date range into twelve equal parts like below

``````06/29/2020 09:00:00 - 06/30/2020 12:59:59
07/01/2020 00:00:00 - 07/31/2020 12:59:59
.........
.......
06/01/2021 00:00:00 - 06/29/2021 09:00:00
``````

I cant write recursive CTE as this is a sql synapse module I am running against..

With below query I am able to split the date part, but time part is not coming properly as above.. Please help me as this is a blocking my development

``````declare @FromTs DATETIME
declare @ToTs DATETIME
SET @FromTs = GetDate()
SET @ToTs = DATEADD(month, 12, @FromTs)

;WITH n(n) AS
(
SELECT ROW_NUMBER() OVER (ORDER BY (object_id))-1 FROM sys.all_columns
),
d(qi,qrt,qtt,n,f,t,md,bp,ep,rn) AS
(
SELECT
,n.n, @FromTs, @ToTs,
DATEDIFF(MONTH, @FromTs, @ToTs),
FROM n INNER JOIN <datetbl> AS d
ON @ToTs >= DATEADD(MONTH, n.n-1, @FromTs)
)
SELECT qi,qrt,qtt,
new_from_date = CASE n WHEN 0  THEN f ELSE bp END,
new_to_date   = CASE n WHEN md THEN t ELSE ep END,rn
FROM d WHERE md >= n
``````

## physics – Equal point charges on the sphere

I have coded a simulation where $$n$$ equal charges are randomly placed on the surface of the conducting sphere. I added a damping term proportional to velocity so that the charges arrange in a stable configuration. Then the graphics of polyhedron with charges as vertices is displayed.

It works for every number of charges less than 78. It takes my computer around 20 seconds for 77 but for 78 or greater it just freezes.

Below is the code. Under each defined function there is a description of what it does

Is there a way to fix it?

``````NaključnaTNaKrogli(r_: 1) := {
{x, y, z} = {RandomReal({-1, 1}), RandomReal({-1, 1}),
RandomReal({-1, 1})};
If(x^2 + y^2 + z^2 < 1,
r {x, y, z}/Sqrt(x^2 + y^2 + z^2),
NaključnaTNaKrogli(r))
}((1));
(*returns random point on the sphere of radius r, centered at {0,0,0}*)

l(vektor_) := Sqrt(vektor.vektor);
(*returns magnitude(length) of a vector*)
L(sez_) := l /@ sez;
Strešca(vektor_) := vektor/l(vektor);
STREŠCA(sez_) := sez/L(sez);
sez(CapitalDelta)r(sezr_, n_, i_) :=
ConstantArray(sezr((i)), n - 1) - Delete(sezr, i);
(*returns list of vectors from i'th charge to all other charges in
sezr. n=Length(sezr)*)
F(sezr_, n_, i_, c_) := {
s = sez(CapitalDelta)r(sezr, n, i);
c Total(s/L(s)^3)
}((1));
(*returns list of force vectors of other charges on i'th charge in
sezr. c is  q^2/(4Subscript((Pi)(Epsilon), 0))*)
Seza(sezr_, n_, c_, m_, k_, sezV_) := {
rstre = STREŠCA(sezr);
sezF =
Reap(
Do(
Sow(
F(sezr, n, j, c)
)
, {j, n})
)((2))((1));

(sezF - rstre (Total /@ (rstre sezF)) - k sezV)/m
}((1));

(*returns list of acceloration vectors of charges. sezV is a list of
velocities of charges*)

Pol(n_) := {
vmax = 1;
amax = 1;
sezr = Reap(
Do(
Sow(NaključnaTNaKrogli())
, n)
)((2))((1));
sezv = ConstantArray({0, 0, 0}, n);
seza = ConstantArray({0, 0, 0}, n);
t = 1/60;
dt = 1/60;
While(
(Not(
IntegerQ(
t))) (Or) ((Max(L(sezv)) > vmax) (And) (Max(L(seza)) >
amax)),
seza = Seza(sezr, n, 100, 1, 1, sezv);
sezv += seza dt;
sezr += sezv dt;
sezr /= L(sezr);
t += dt;
);
{coords, incidences} = TetGenConvexHull(sezr);
Show(
Graphics3D({
EdgeForm(),
FaceForm(Cyan),
GraphicsComplex(coords, Polygon(incidences))}),
Background -> Black,
Boxed -> False
)
}((1));

(*returns graphics of polihedron with charges in end state as
vertecies*)
Pol(78)
``````

## audio – No sound when left and right speakers are at equal volume. Built in Output/headphones

My built-in output appears to have left and right stereo output channels which I can raise or lower their volume independently.
When the volume of both left and right are equal, I get zero sound output.
When the volumes are NOT equal I get sound but it appears to be in MONO regardless of which side, even when I lower one entirely.

It has been an ongoing issue, I just factory reset my computer and it seemed to finally work properly however the problem just returned and I’m at a loss as to what is going on (I didn’t think to check if it was mono or stereo at the time it appeared to be working) .

I am a music producer and I need stereo output in order to mix and produce. I’m forced to bounce my projects and upload them to my phone just to be able to hear the stereo mix.

My headphones are Sony MDR-7508 and my OS is Catalina 10.15.5

Thanks 🙂

## If everyone is supposed to be equal, wouldn’t bringing back affirmative action give automatic preference to some people?

You are missing the point. “supposed to be equal”. If starting very much unequal, some have advantages they were born into through no merit or accomplishments of their own. Affirmative action is not supposed to be in its original form but is instead meant to give EQUAL OPPORTUNITY, which does not exist today.

There is a massive skew of wealth in the USA. Donald Trump started with avoiding military service, entry into a fine graduate school with family connection assistance, a “small” million dollar loan from a parent (today five times that in buying power in its industry). Donald Trump was NOT equal to start.

Is a person born into poverty “equal” to one born into a palace?

ANYONE not seeing this is simply being purposely ignorant. I’m sure you can see this, that some preferences improve society as a whole.

If everyone is “equal” why are USA Republicans in leading government positions 90% white non-Hispanic males? Executive branch of President and Cabinet, US Senate and House, Governors. Is this a sign of equal?