How to manipulate multiple solutions to equations while keeping variable names?

relatively new to Mathematica, but couldn’t find an answer online for how to do this more cleanly.

I am solving these equations in six variables that give me a number of solutions, which are given as a list of rules, e.g.,

solution = {{x1 -> 0, x2 -> 0, x3 -> 0, x4 -> 2, x5 -> 1, x6 -> 0}, 
 {x1 -> 0, x2 -> 0, x3 -> 1, x4 -> 1, x5 -> 0, x6 -> 1}, 
 {x1 -> 0, x2 -> 1, x3 -> 0, x4 -> 1, x5 -> 1, x6 -> 1}, 
 {x1 -> 0, x2 -> 1, x3 -> 1, x4 -> 0, x5 -> 0, x6 -> 2}}

My next step is I need to calculate $y_1,y_2,y_3,y_4,y_5,y_6$ for each of these solutions, which are some (unchanging) linear combination of these values. I am currently doing this by defining (above everything), e.g.,

y1=x1-x3+x5
y2=x3+x4+x5

etc, and then running

xypairs = Table({{x1, y1}, {x2, y2}, {x3, y3}, {x4, y4}, {x5, y5}, {x6, y6}} /. 
 solution((j)), {j, 1, Length(solution)})

which gives me a list of lists, where each sublist contains each of the xy pairs for that solution. However, I need to do a bunch of manipulation on these values afterwards, and as I try to write it as is, I get really messy stuff involving dozens of lines like:

 xypairs((t))((2))((2)) + xypairs((t))((4))((2)) - xypairs((t))((3))((2))

I feel there has to be a better way to do this. I want to first calculate the $y_i$ for each solution, and then somehow iterate through each of the solutions so that when I am iterating, I can access the $x_i$ and $y_i$ by some means that is simpler than using a triple index. Please let me know what the best way to approach this is.

Thank you in advance!

Bounds on minimum solutions to empirical and theoretical objective functions

Let $P$ and $Q$ be two probability distributions and let

$$S_0 = min_{f,g} left( int f(x), dP(x) + int g(y), dQ(y) right)$$ such that $f(x)+g(y) geq langle{x,yrangle}$ where $f,g$ are strongly convex. This is a Wasserstein semi-dual except with the strongly convex restriction.

Now say I want to estimate the above but I only have points $x_1,ldots,x_n in hat{P}$ and $y_1,ldots,y_n in hat{Q}$ to work with.

Compute $$S^{*} =min_{hat{f_i},hat{g_i},nablahat{f_i},nablahat{g_i}} left( frac{1}{n}sum_{i=1}^n hat{f}_i + frac{1}{n}sum_{i=1}^n hat{g}_i right)$$ where

$hat{f_i}+hat{g_j} geq langle{x_i,y_jrangle}$,

$hat{f_i} geq hat{f_j} + langle{nablahat{f_j},x_i-x_jrangle} + frac{c}{2}left|x_j-x_iright|^2$,

and $hat{g_i} geq hat{g_j} + langle{nablahat{g_j},y_i-y_jrangle} + frac{c}{2}left|y_j-y_iright|^2$

for all $i,j$. So we can think of $hat{f_i},hat{g_i},nablahat{f_i},nablahat{g_i}$ as being updated repeatedly after starting off with some suitable values at initialization.

Is there anything one can say about $S_0-S^*$? I’m honestly lost and I don’t know how to proceed here. Are there any techniques I can use here?

Are there solutions for Dark Pattern?

From the dark-patterns description (emphasis added):

A design pattern which is carefully crafted to accomplish some result but does not have the user’s interests in mind.

In other words, a dark pattern is an aspect of a user’s experience in which they are intentionally taken advantage of; the site/developers are not designing an experience best suited to meet their customers’ needs. Instead, they have contrived one in which their own wants (or stakeholders’ desires) take priority.

Dark patterns can emerge through a number of ways. A non-exhaustive list of strategies includes:

  • lack of transparency to the user as to what the status of the system is
  • confusing wording or interfaces
  • hiding options or settings out of plain view
  • preselecting options that the user may not want
  • presenting upgrade paths as if they are necessary for basic functionality
  • making it particularly difficult to cancel a service

The solution to avoiding dark patterns, naturally, is to simply not design in a way that attempts to usurp users of their power of choice.

warning messages – Using the solve function to extract solutions to an equation in natural numbers

I have the following code:

n /. Solve({c == 1/2 (-2 + 3 n^2) (-1 + 3 n^2) (1 - 3 n + 3 n^3), 
    n (Element) PositiveIntegers}, n)((1))

This procudes the number $n$ such that the equation is solved in the natural numbers because $cinmathbb{N}$. However when there is no solution found the code gives an error message:

Part::partw: Part 1 of {} does not exist.
ReplaceAll::reps: {{}((1))} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.

How can I write code that gives $n$ when it exists and it gives $0$ if no solution exists? So for example when $c=1045$ we see that $n=2inmathbb{N}$ so the code must give 2 as the output but when $c=1046$ there is no $ninmathbb{N}$ that solves the equation so the code must give 0.

statistics – Finding solutions to tutorial problems in probability

The set of tutorial problems

I’m taking a course in probability and statistics and wanted help with the solutions for the 3 problems (as part of my tutorial) attached (in the image). I couldn’t make much progress in 1 and 2 and for 3, I thought of the maximal cut algorithm but couldn’t write up a rigorous proof for the same. I’d greatly appreciate solutions to all the 3 tutorial problems

Thank you!

complex analysis – Density and distributions of those numerically or analytically KNOWN solutions of Riemann $zeta(1/2 + r i)=0?$

We know the conjecture about the Riemann hypothesis is about the nontrivial zeros are on
$$(1/2 + r i)$$
for some $r in mathbb{R}$ of Riemann zeta function.

My question is how much is known about the density and the distributions of those numerically or analytically KNOWN solutions of
$$zeta(1/2 + r i)=0?$$

I found a related post but it was about 8 years ago, so maybe we have a better update?

Mean density of the nontrivial zeros of the Riemann zeta function

Custom Plugin – Package and Deployment Solutions

We are a very small company working with a specific customer base. In this, we often have to create small WP plugins specific to the customer. Typically, we re-use our own basic folder structure and files (base php file that lays out some standard variables, assets folder structure for css and js files, installation/settings features templates, etc.).

We don’t currently use anything that is “industry standard” or that will package, process, combine or minify our files for deployment (css, scss, js, etc.). Does such a thing exist? I’m familiar with the package/deployment of Vue/React and I’m curious is something similar exists for WP or if there are any standards for this?

I’ve done some research but can’t seem to find a clear solution.