## What are the three points of view in Kolmogorov Complexity?

I was reviewing for my finals and find this question that I have totally no clue.

Compare the following to statements from three points of view:

1. There exists a constant $$c > 0$$ such that for all palindromes $$x \in \{0, 1\}^*$$ we have $$K(x) \leq \lfloor x / 2 \rfloor + c$$.

2. There exists a constant $$c > 0$$ such that for all $$x \in \{0, 1\}^*$$ we have $$K(\overline{x}) \leq K(x) + c$$ where $$\overline{x}$$ is the complement of $$x$$.

So what are the three points of view am I suppose to use and where should I start?

Posted on Categories proxies

## Three City Scheduling

I came across the following interview question

There are 2N people a company is planning to interview. The cost of flying the i-th person to city A is costs[i], and the cost of flying the i-th person to city B is costs[i].

Return the minimum cost to fly every person to a city such that exactly N people arrive in each city.

The solution to this involves greedy approach, where we sort the array based on the “profit” parameter. profit of choosing city A for a candidate i is defined as costs[i] - costs[i] and choose the top half elements from the sorted array to go to A and rest to B.

What if this question is modified to 3 cities and you have find optimal partition of n/3 chunks? Will greedy algorithm still work?

## How does a prefix sum with 8 elements can be computed with three processors?

I would like to know if someone can give me an example of how a prefix sum which contains 8 elements can be computed with just three processors.

Prefix sum

Posted on Categories proxies

## For anydice.com, is there a way to set a total number for three rolls?

I am very, very new to writing code and working on designing a RPG. As part of that, I am trying to do a simulation of three weighted dice rolls, ranging from 1-12 where I set the limit of how much the total of all three rolls can be. Meaning, I want to limit the total that any set of three rolls can give me to 12.

I am interested in the actual results of the dice and not just their sum so 3/3/3 is different from 4/4/1.

If the sum of the dice would be above 12 then the die making it go above 12 would be rerolled until this is not the case.

As an example:

• If you rolled 5/5 on the first two dice, the third die would be rolled until it was either a 1 or 2.
• If you rolled 1/1 on the first two dice, the third die would be rolled until it was a number 1-10.

I have the dice weighted according to the percentages I need. I just have no idea how to do the language to limit the total.

Here’s what I have thus far:

W: {  1:12,  2:14,  3:18,  4:18,  5:17,  6:8,  7:8,  8:1,  9:1,  10:1,  11:1,  12:1 } output dW 

Any help would be GREATLY appreciated!

Posted on Categories Best Proxies

## why segmentation fault is arising , because of these three lines?

The code is giving segmentation fault. But it is working fine, :

1. if i remove the first weird line “q++;”. Or
2. if i call solve(s,1) in main function instead of solve(s,0) at third weird line.
3. the code is working fine if i use “solve(s,q)” at second weird line.
 ''' #include using namespace std;  >bool solve(string s,int q) {     q++; //first weird line     if(q==10)         return true;     solve(s,q+1);//second weird line     return false; }  int main() {     string s;     cin>>s;     solve(s,0);//third weird line      return 0; }'''
Posted on Categories proxies

## How to plot multicolor phase daigram with three parameters? I am trying to plot like the diagram given above. I have two nonlinear equations that I have separated in imaginary and complex forms (u1,v1, and x1,y1). As shown in the figure in the x-axis I want ‘p0’ which varies from (0,2.5*10^3) and in the y-axis, I want ‘del0’ which varies from (0,3) and inside the plot where rectangular color region box it is ‘NL=u1^2+v1^2’which varies from (0,6*10^7). I am trying this but unable to plot this type of diagram and gives me an error: “solve was unable to solve the system with inexact coefficients. The \ the answer was obtained by solving a corresponding exact system and \ numericizing the result. >>” Should I give another command to get this type of plot or anything else? If anyone can short it out will be appreciated.

A1 = 1; B1 = 0; delta = -1.5;(*Subscript[Δ, L] ; Laser-Lower polariton \ detuning*) g0 = .315; (* Subscript[g, 0] ; vacuum optomechanical strength *) ome = 3.014; (* Ω ; Rabi splitting *) ome1 = .125; (* Subscript[Ω, m] ; mechanical \ resonator's frequency *) kexc = 0.002;  (* Subscript[κ, exc  ;  ]exciton decay rate*) kk = .2;   (* κ; cavity decay rate *) gma = 0.00001;  (* Γ ; phonon dcay rate *) ka = (kk + kexc)/2 - del0*(kk - kexc)/(2*ome); Sol = NSolve[{-delta*v1 - ka*u1/2 - (kk - kexc)*B1*g0*x1*u1/ome == 0,      delta*u1 + g0*(1 - del0/ome)*A1*x1*u1 +        p0*(1 - del0/(2*ome))/Sqrt + p0*g0*B1*x1/(Sqrt*ome) -        ka*v1/2 - (kk - kexc)*g0*x1*B1*v1/ome == 0,      ome1*y1 - gma*x1/2 ==       0, -ome1*x1 + g0/2*(1 - del0/ome)*A1*(u1^2 + v1^2) +        p0*g0*u1*B1/(Sqrt*ome) - gma*y1/2 == 0}, {u1, v1, x1, y1},     del0]; ContourPlot[{Evaluate[(u1^2 + v1^2)] /. Sol}, {p0, 0, 5}, {del0, 0,    3}, PlotLegends -> BarLegend[{"LakeColors", {0, 6}}]]  After running this code I am getting the plot. Which is not the same as above. I don't know what the problem with it?    
Posted on Categories cheapest proxies

## Does anyone know the three small islands west of The Cloakwood? These islands appear in every map I can find depicting the Sea of Swords, but are never tagged. Before you google, the islands just southwest of The Cloakwood (and directly west of Candlekeep) are the ones known as The Cimarine Isles. The islands in the photo appear to be completely separate.

## How to write suitable three address code for switch-case statements?

I want to translate a java switch-case statement to intermediate representation of the three address code form. Three address code or TAC is a form of intermediate representation where each instruction contains at most three addresses and one operator. An address is a name such as x (stored in the symbol table), compiler generated temporary such as $$t_{1}$$ or a constant such as 3.14 or ‘s’. A name could refer to a variable, label, etc. If you have an arithmetic statement

(3 * w) + y

then the corresponding TAC would be

$$t_{1}$$ = 3 * w

$$t_{2}$$ = $$t_{1}$$ + y

Now, when it comes to switch statements, my textbook (the Dragon Book for Compilers), gives a translation of this form: for a switch-case statement of this type:

switch E

case V1: S1

case Vn-1: Sn-1

default: Sn

Assuming the first translation is used, at the code generation stage (when we convert 3AC to machine code), the code generator will interpret the instructions as a sequence of conditional and unconditional jumps with intervening labeled statement blocks. It would translate them into the machine code (say x86) version of the same. When these instructions are executed by the processor, it handles each jump sequentially to determine the correct labeled block to be executed. But, I have also read that the machine code translation of a switch-case statement includes a jump table that allows the processor to execute the entire switch statement in one go. So, then which version is used?

I wanted to post this on stackoverflow but I do not have enough reputation to post an image.

Posted on Categories proxies

## Can Yacc be used to generate three address code for Java 1?

I have read that yacc generates bottom up parser for LALR(1) grammars. I have a grammar for Java 1 that can be used for generating three address code and is strictly LALR(1), but the translation scheme I am employing makes it L-attributed. Now I have read that L-attributed LR grammars cannot be parsed by using bottom up parsing. So, can yacc be used here or not?

## Early-1990s basic D&D adventure – had three dragons in a ruined keep of squabbling mooks

This was a DnD adventure I recall playing in the early 90s.

There were three adventures all closely connected: a black dragon, a green dragon (which uses illusions to make itself seem like three dragons together), and a red dragon. There was also a ruined keep filled with squabbling mook races, like goblins, orcs, etc. The dragons had to keep the peace among the tribes, and the lieutenants included a goblin leader and a harpy or siren. Her name was something similar to “Hauraura”.

This would have been 1990 to 1993.

Posted on Categories Best Proxies