instruction
stringlengths
0
29.8k
⌀
|artificial-intelligence|constraint-satisfaction|
This is just some ideas to find the Markov algorithm, I have not tried to write it completely. In particular, I have not determined all priorities. 1. First, it could help to add a left-marker and a right-marker. To do that, just create rule: > $\varepsilon \to LR$ ($\varepsilon$ is the empty word) with low pr...
This is just some ideas to find the Markov algorithm, I have not tried to write it completely. In particular, I have not determined all priorities. 1. First, it could help to add a left-marker and a right-marker. To do that, just create rule: > $\varepsilon \to LR$ ($\varepsilon$ is the empty word) with low pr...
This is just some ideas to find the Markov algorithm, I have not tried to write it completely. In particular, I have not determined all priorities. 1. First, it could help to add a left-marker and a right-marker. To do that, just create rule: > $\varepsilon \to LR$ ($\varepsilon$ is the empty word) with low pr...
null
Markov algorithm for words of the form $ww$, $w\in \{a,b\}^*$
[![{a^n b^m c^k | n > m + k}][1]][1] My problem of understanding is how to create a new a before the b's if you create new c's. Hopefully someone can help me out. [1]: https://i.stack.imgur.com/C1vTR.png
How can I transfer the following language into an context-free grammar?
|context-free|
I am trying to look answer for this question of toc please help me find the answer. The question is : Construct epsilon NFA(Non deterministic finite automata) for regular expression (0+1)*1(0+1)
Theory of computation
|formal-languages|regular-languages|finite-automata|closure-properties|
null
Given a graph $G=(V,E)$ and any edge $(u,v) \in E$, let us denote by $G_{(u,v)}=(V,E\setminus\{(u,v)\})$ obtained from $G$ by removing this edge. I am interested in the difference between the average distance in $G$ and $G_{(u,v)}$ (or equivalently the sum of all distances in these graphs). This value is a featur...
Importance of an edge regarding distances
|graphs|shortest-path|data-mining|network-analysis|social-networks|
The activities you mention are not computer science but *hardware maintenance* and *system administration*. Computer science is about inventing new algorithms and data structures tailored to new unforeseen situations, it is about inventing new concepts that can be built into new programming languages, inventing new com...
Consider the following algorithm $A$ to 6-color an rooted tree within $\log^{*}n$ rounds in a distributed system: 1: Assume that initially the nodes have IDs of size $\log(n)$ bits 2: The root is assigned the label $0$, and each other node $v$ is assigned $c(v) = ID_v$ 3: Each other node $v$ executes the follo...
Color a a general graph with maximal degree $\Delta$ using $2^{O(\Delta)}$ colors within $\log^{*}n$ rounds
|algorithms|complexity-theory|graphs|distributed-systems|colorings|
null
This is just some ideas to find the Markov algorithm, I have not tried to write it completely. In particular, I have not determined all priorities. 1. First, it could help to add a left-marker and a right-marker. To do that, just create rule: > $\varepsilon \to LR$ ($\varepsilon$ is the empty word) with low pr...
This is just some ideas to find the Markov algorithm, I have not tried to write it completely. In particular, I have not determined all priorities. 1. First, it could help to add a left-marker and a right-marker. To do that, just create rule: > $\varepsilon \to LR$ ($\varepsilon$ is the empty word) with low pr...
Why does Computer Science need so much math?
null
**Here is the Question :** **The hit ratio is the percentage of times that a page number is found in the Translation look-aside buffer (TLB). An 80% hit ratio means that we find the desired page number in the TLB 80% of the time. Suppose we have a hit ratio of 70% and 40 ns is needed for TLB, where main memory acce...
which formula should i use with this Question
|operating-systems|
I have the following problem and I am wondering if it is NP Hard or not. Let $A$ be a binary matrix whose rows and columns are indexed by the sets $\mathcal{I}=1,...,m$ and $\mathcal{J}=1,...,n$. A rectangle is a set $R=I\times J$ with $I\subseteq\mathcal{I}$, $J\subseteq\mathcal{J}$ and its value is defined by $$...
Selecting a submatrix of a binary matrix NP hard?
|complexity-theory|np-hard|combinatorics|matrices|
null
null
Trying to solve the zero-sum problem described [here][1], where two opponent players at each turn can choose to collect 1, 2 or 3 stones with different values, with the objective of getting more points at the end of the game (and assuming each player is playing optimally). All presented solutions based on recursion...
Zero sum game: dp recursion strategy
|algorithms|dynamic-programming|memoization|
null
There is a well known algorithm to solve Zero sum games called MiniMax algorithm. The reason for the failure of your above mentioned approach: Let's say at Alice's turn she took a move to maximize her score in the next turn Bob will try to minimize Alice's score. I think you focussed on only one player's action and...
You can firstly spawn $k$ letter $c$'s providing an $a$ for every $c$ spawned, then start putting $m$ $b$'s between $a$ and $c$ and add one. Also letter $a$ can be created any number of times after all $b$ and $c$ letters are created. This approach can be done with the following CFG: $$G = (V, \Sigma, S, R), \: V = \{...
We are trying to find a partition of a graph into connected components with bounded size, k. In addition, we want to make sure that no disconnected vertices remain. In other words, we want to partition the graph into connected components of size 2-k. When k=2, the problem is equivalent to the [perfect matching prob...
Finding partition of a graph into connected components with bounded size such that no disconnected vertices remain
|graphs|matching|partitions|
Define: RE = {L : L is recognizable by a TM}, R = {L : L is decidable by a TM}, and coRE = {L : L-complement is recognizable by a TM}. <br> The question is: Does the complement of coRE equal RE? <br> I know that the answer is false, but I'm not sure why my proof is wrong: <br> [![enter image description here...
turing recognisable = complement of co-recognisable
|turing-recognizable|
null
There is a well-known problem of the best time to buy and sell stock. Assume now we have two arrays, *SELL* and *BUY*. Each time *SELL[i]* > *BUY[i]*. Assume we have initial budget *B*, and we can buy any amount of stock bounded by our budget. We want to determine the maximum profit we can reach using the best strategy...
Optimality in greedy task
|algorithms|dynamic-programming|greedy-algorithms|
Let $A=\{ \overline{L'} \in \Sigma^* \mid L' \in \mathsf{RE} \}$ (notice that I renamed the variable used in the definition of the set to avoid confusion). It is false that $L \in A \iff L \in \mathsf{RE}$. To see this consider the language $H$ of the halting problem, which is well-known not to be decidable. $H \in...
null
You can firstly spawn $k$ letter $c$'s providing an $a$ for every $c$ spawned, then start putting $m$ $b$'s between $a$ and $c$ adding $a$ for every $b$. Also letter $a$ can be created any number of times after all $b$ and $c$ letters are created. This approach can be done with the following CFG: $$G = (V, \Sigma, S, ...
I've lately been struggling to write correctness proofs for various algorithms, even when it is "obvious" to me that the algorithm works and is correct. For example, take the following problem: Given a binary string $s$ of length $n$, you can perform an invert operation on index $i$ (0-indexed) which inverts the pre...
Proof techniques and correctness proof of minimum cost to make string equal
|algorithms|proof-techniques|
Your string has k bit changes where bit i and bit i+1 are different. You reduce the number of bit changes by 1 by inverting the first I+1 bits. So that gives you a way to make all bits equal. Then you need to prove that as long as you don’t invert the first I+1 bits the bit change from but I to I+1 will remain, so ...
Obviously yes because every single string ends in c\*.
$$ \text { Consider the language } E_{T M}=\{\langle M\rangle: L(M)=\emptyset\} . \text { prove that } E_{T M} \in c o R E \backslash R \text {. } $$ I proved that $$E_{T M} \in c o R E$$ using Turing machine I built which recognizes the language, what left is to show that it is not in $$ R$$ any suggestions...
How to prove that language is not in R
|formal-languages|turing-machines|
Obviously yes because every single string ends in c\*. Note that (x)\*y is always a superset of y, so if both are present then y can be removed. We do this and get $a^*(ac^* + b^*bc^* + b^*cc^* ) + c^*$ $b^*cc^*$ includes $c^*$ except $\epsilon$, so this is $a^* (a + b^*b + b^*c) c^* + \epsilon = a^* (a + b^*...
null
Consider the language $$E_{T M}=\{\langle M\rangle: L(M)=\emptyset\}.$$ Prove that $E_{T M} \in \text{coRE} \backslash\text{R}.$ I proved that $$E_{T M} \in\text{coRE}$$ using Turing machine I built which recognizes the completement of the language. What left is to show that it is not in $$ R$$ Any suggestions ...
How to prove $\{\langle M\rangle: L(M)=\emptyset\}$ is undecidable?
|formal-languages|turing-machines|undecidability|
Suppose we have $N$ points on $XY$ plane, ie. $(x, y)$ and $x, y \in Z$ and multiple queries where each query is of the form $y = mx + c$ and $m, c \in Z$. Is it possible to count number of points that lie on the given line more efficiently than $O(N)$ per query? I believe some preprocessing might help or some da...
Queries to count points lying on arbitrary line
|data-structures|optimization|computational-geometry|range-query|
null
null
Your problem is NP-hard. In particular, it is equivalent to maximum edge weight biclique problem (MWBP), which is known to be NP-hard. Maximum edge weight biclique ============================ MWBP is the following problem: given a bipartite graph with weights on the edges, find a [biclique](https://en.wikipedi...
null
null
null
We are trying to find a partition of the vertices of a graph so that each subgraph is connected with bounded size, k. In addition, we want to make sure that no disconnected vertices remain. In other words, we want to partition the graph into connected subgraphs of size between 2 to k. When k=2, the problem is equiv...
Finding partition of the vertices of a graph so that each subgraph is connected with bounded size and no disconnected vertices remain
Finding partition of a graph into connected subgraphs with bounded size and no disconnected vertices
{"Voters":[{"Id":-1,"DisplayName":"Community"}]}
Note that via point-line duality (i.e. mapping each point $(p_x,p_y)$ to the line $y=p_x x - p_y$ and each line $y=mx +c$ to the point $(m,-c)$), this problem is equivalent to: given a set $L$ of $n$ lines, count the number of lines that contain a query point. The subdivision of the plane induced by $L$ is known as...
null
null
null
Assume that you perform 100 accesses. 70 of them will take 40 ns and 30 of them 40+80 ns. On average 64 ns. Can you derive the formula from this ? (Or compare to the results with the given formulas.)
Can a CFG parse tree have a root other than starting non-terminal S? Except for the cases when tree has a height equal to zero and contains only one symbol from the main alphabet.
Can a CFG parse tree have a root other than S?
|context-free|discrete-mathematics|
null
null
null
null
I want to find areas in a binary image that correspond to long and thin curves. In the example below, structures thinner than 3 pixels but longer than 20 pixels are highlighted. Observe that the bottom-most line is split because it locally comes in contact with the Data Matrix code. The structures need not be straight,...
Detecting thin lines in binary images
|algorithms|image-processing|
Consider this : ~~~ int[][] data = {1,2,3}, {4,5,6}, {7,8,9}; for(int i = 0; i < data.length; i++){ //Rows for(int j = 0; j < data[i].length; j++){ //Columns int elements = data[i][j]; System.out.print(elements + " "); } System.out.println(); } ~~~ In a Row-Major traversal of an ...
null
null
null
With $N=10^6$ bodies, the obvious method to track their movements by having a system of simultaneous differential equations taking $\mathcal{O}(N^2)$ operations per step with a rather large constant will take you ages. There is a faster method, as far as I know, that takes $\mathcal{O}(Nlog(N))$ operations; I've on...
null
I Hope someone Can help me with that: - $T(1)=2$ - $T(n)=\left(T(\frac{n}{2})\right)^2\cdot2^n $ what is the runtime complexity of the algorithm (base 2) Thanks a Lot!