## Converting a Mixed SUBSET-SUM Problem To All-Positive Case

Let’s say we have a SUBSET-SUM problem with list {$$x_1,x_2,x_3,…x_N$$} and weight $$W$$, with some of $$x_i<0$$. Is there a known way, in polynomial time, to convert this problem into an equivalent problem, but with all $$x_i \geq 0$$? And if there aren’t any, is it possible for there to be such an algorithm?

## AnyDice — efficiency of code calculating rolls hitting a target with mixed pools; hitting the 5 second barrier

I have some code that is hitting the 5 second barrier;

function: target N:n of A:s B:s C:s {     result: [count {1..N, 1..(N/2)} in [sort {A, B, C}]] } output [target 7 of 4d12 0d20 0d8] output [target 7 of 4d12 2d20 0d8] output [target 7 of 4d12 4d20 0d8] 

Even if I remove the final output line, it still fails.

I believe the code does what I want it to – calculate the number of dice rolling at or under the target from mixed pools (it runs when using other pools: d20s seem to be a problem).

Is there anyway I can improve it so that at least the first two of these output lines will run (or better yet, all three of them)?

N.b. from my perspective these were some of the simplest pools I wanted to look at.

## AnyDice: Second highest roll from mixed pool

I’m struggling to adapt Ilmari Karonen’s answers from these two questions to my problem.

I want to look at the second highest value from various pools.

function: max A:n B:n C:n {     result: 2@[sort {A, B, C}] } output [max 1d12 1d10 1d8] 

Produces possibly believable results, but:

output [max 2d12 0d10 0d8] 

Is not at all believable, and completely disagrees with:

output 2@2d12 

Similarly testing with

function: maxs A:n {     result: 2@[sort {A}] } output [maxs 2d12] 

hasn’t helped.

## How is Challenge Rating (CR) calculated for a mixed group of multiple monsters in regards to the Treasure Table?

I understand that encounters are balanced around exp thresholds in the DMG (e.g. https://rpg.stackexchange.com/a/105360).

With that said, there are loot tables in the DMG 136-139 that have “Challenge Rating” ranges for how loot should be distributed.

I understand CR is not supposed to be summed or multiplied, but if the party kills 20 CR 3 monsters, in the loot table, what would the challenge rating range be for these monetary loots?

As a tangential note: the DMG item loot tables don’t really explain which table to use “A vs B vs J, vs K…”.

## Intuition behind cellular automaton mixed bulking function?

I’m reading the paper of Nicolas Ollinger on intrisically universal 1d cellular automata: https://arxiv.org/abs/0906.3213.

On page 3 (201), he gave the definition for mixed bulking quasi order. I’m unable to grasp the intuition behind such a defintion, injective universality seems to already capture what I can imagine universality to be. Another issue is that the mixed bulking map $$\phi$$ has domain $$2^{S_B}$$, how is $$\phi$$ composed with the global function $$G_B$$ when $$G_B$$ has domain $$S_B^{Z^d}$$

## Configure a Google Analytics filter for blog posts when URLs are mixed with other content

I have a WordPress site with a blog section but also a lot of other content, that is not directly related to the blog. Now I want to use Google Analytics and only see the blog traffic, meaning users that click on blog posts.

I know there are ways to filter this, if the blog posts reside in a subfolder, like example.com/blog/my-blog-post, but on my site the link structure doesn’t have that. It’s like this: example.com/my-blog-post

What would be a good way to filter that traffic in Google Analytics? It should also work for any future published posts. I have the Google Tag Manager connected, maybe that might provide a viable option?

## How can I examine the distribution of successes-counting mixed dice pools?

After looking at AnyDice’s Documentation and Function Library, I remain baffled. I know that AnyDice can do this, but I don’t know how to tell it to. Scott Gray’s Dice Pool Generator is easier to use but doesn’t return the results I need, or, at least, I lack arithmetic sufficient to force it to.

The mechanic uses a 6-die pool with a target number of 4. I need to know the percentage chances of rolling a 4 or higher on 1 or more, 2 or more, 3 or more, 4 or more, 5 or more, and all 6 dice in the pool using the following pools of dice:

• 6d4
• 5d4 and 1d6
• 4d4 and 2d6
• 3d4 and 3d6
• 2d4 and 4d6
• 1d4 and 5d6
• 6d6
• 5d6 and 1d8
• 4d6 and 2d8

… and so on until 6d12 becomes 5d12 and 1d20. I can do 6d4 and 6d6 myself, but I wanted the progression to be clear. (I’m skipping d14s and d16, by the way, because I couldn’t find d18s, and most folks don’t own d14s and d16s anyway.)

Can this be done?

By the way, the results needn’t be from AnyDice–that’s just frequently mentioned as a good odds generator. Results are the important part not the tool.

## Minimum Clique Cover – Mixed Integer Programming

I have a general (undirected) graph with a set of nodes, a set of edges, and a weight for each edge. I want to find a minimum clique cover of the graph, that is, a partition of the graph into the smallest number of cliques. I also want to maximize the sum of edge weights over the cliques. I want to use an integer programming approach for this problem.

Can any one give me some hints or some references that use mixed integer linear programming for the (maximum weight) minimum clique partition?

Thank you very much.