instruction stringlengths 0 29.8k ⌀ |
|---|
You're correct that the program counter (PC) is a register that stores the memory address of the next instruction to be executed by the processor. After the current instruction is completed, the PC is incremented to point to the next instruction in memory.
Regarding your question on how the PC is incremented by 1, i... |
null |
null |
The proof system "DUX" in [*On the temporal analysis of fairness.* D Gabbay, A Pnueli, S Shelah, J Stavi. POPL 1980][1] is perhaps closest to what you're after. Being a conference paper, the completeness proof is rather terse but with a bit of luck you can fill in the details.
[1]: https://dl.acm.org/doi/pdf/10.11... |
If you have an exact algorithm for the partitioning problem (perhaps one is mentioned in the paper describing the approximate algorithm?), you immediately have an exact algorithm for the covering problem.
First, observe that a partition is a valid cover. Now suppose the partitioning algorithm reports an optimal par... |
If the $k_i$ are restricted to be positive integers (please clarify whether this is the case or not in your question), [D.W.'s nice approach](https://cs.stackexchange.com/a/158941/1984) could give an invalid answer (i.e., an answer with some $k_i$ negative). But in this case there is an efficient and quite intriguing a... |
null |
If you need something that is guaranteed to be unbiased -- i.e., that will generate each possible valid outcome with equal probability -- I don't know of a way to achieve this efficiently. The simplest way to achieve it is with brute force: Generate a full solution, e.g., with the [Fisher-Yates shuffle](https://en.wiki... |
In [Harvard CS 221 Computational Complexity, Lecture 3][1], it introduced **Branching Programs**
>A branching program is a DAG that
has 1 start node and 2 output nodes with out-degree 0, labelled 0 and 1. Each non-output
node is labeled with one of x1, x2, . . . , xn and each node has 2 outgoing edges labeled 0 and ... |
what is the worth of non-read once Branching Programs? |
|complexity-theory|graphs| |
I was wondering if non regular languages are closed under sort? If not, can you give me an example of where sort turns a non regular language into a regular one.
|
Closure of non regular languages under sort |
|regular-languages|finite-automata| |
The start state cannot have any "in edge" (an arrow point directly to the start state) and only out edge is possible for the start state. Other states except the start state are free of limit in DFA
I have doubt between two awnsers which are :
1.It depends on the language and is not possible for every DFA
2.YE... |
Can we transfer every DFA to DFAs with start state having no in edge? |
|formal-languages|regular-languages|automata|finite-automata| |
**Quotient Filter**
Time complexity
The quotient filter offers a constant time complexity of O(1) on average with most operations. However, in the worst case, all operations might take logarithmic time complexity O(log(n)), where n is the number of buckets in the filter.
Space complexity
The quotient filter... |
**Quotient Filter**
*Time complexity*
The quotient filter offers a constant time complexity of O(1) on average with most operations. However, in the worst case, all operations might take logarithmic time complexity O(log(n)), where n is the number of buckets in the filter.
*Space complexity*
The quotient fi... |
The following approximation algorithm for the *Minimal Dominating Set Problem* is said to be a 1.5-approximation:
1. Start with empty set $S$
2. As long as not all vertices are covered:
* Add a vertex that is not in $S$
with the most uncovered neighbors to $S$
* mark it and all its neighbors as covered
... |
Minimal Dominating Set Problem, 1.5 approximation, Proof |
|graphs|proof-techniques|approximation| |
It is possible. You just need to duplicate the start state, one copy becoming the starting state with no in-edge, the other copy becoming a state that can have in-edges.
Formally, if $A = (Q, \delta, q_0, F)$ is a DFA, then consider $B = (Q', \delta', q_0', F')$ with:
- $Q' = Q\cup \{q_0'\}$;
- $F' = F$ if $q_0\... |
Here is the problem statement. Let $E_1,...,E_n$ be a set of $n$ exercises, each taking 1 day to solve, and suppose we have $n$ days available to solve the exercises. Each exercise $E_i$ has a deadline $D[i]$ associated to it, which is an integer in the range $0...n - 1$. Each exercise $E_i$ must either be solved on a ... |
Compute the schedule which gives the maximum number of points |
|algorithms|greedy-algorithms| |
null |
Is there a way where sort turns a non regular language into a regular one.
What I mean by sort is this:
Consider the language $L =$ { $bac, cbca, acbb$}. $sort(L) = $ {$abc, abcc, abbc$} respectively.
If there is, do you have an example. If not can you provide a proof if you can. |
Transform a non-regular language into a regular one using sort |
No the class of all non-regular languages is not closed under sort. For example take the language $L=\{a^nba^n\}$. It is clearly not regular (by the pumping lemma). However, $sort(L)$ is the language defined by even many $a$s and then a $b$. This language is clearly regular. |
Suppose you have to drive from Eindhoven to the south of France. Your start and destination are fixed and the route is fixed as well. You start with a full petrol tank, but since the distance is quite long you will need to fill up your tank several times. There are $n$ petrol stations along the way, and your goal is to... |
Prove optimality of greedy strategy for fewest number of stops |
|algorithms|greedy-algorithms|correctness-proof| |
Suppose you have to drive from Eindhoven to the south of France. Your start and destination are fixed and the route is fixed as well. You start with a full petrol tank, but since the distance is quite long you will need to fill up your tank several times. There are $n$ petrol stations along the way, and your goal is to... |
Here’s a slight change to make “greedy” fail: all the gas stations only take banknotes of 10 euro or higher paid in advance, and only allow to pay for gas that fits in your tank. |
null |
null |
I am learning about Turing machines. I understand the alphabet set of symbols and the states a machine can be in. However, I do not understand how the transition function works.
I come from a maths background and functions always follow a simple input output. The table of transtions seems out of place.
How does a... |
How does a Turing machine read a transition table as a function? |
|turing-machines|transition-systems| |
You can think of a function $f:S\times \Sigma \rightarrow S$ as a "table", where the rows are elements of $S$, the columns are elements of $\Sigma$, and the cell's contents is the result $f(s,\sigma)\in S$ of the $s$ of the current row, and the $\sigma$ of the current column.
This is just a more convenient way to wr... |
null |
null |
Here is the problem statement. Let $E_1,...,E_n$ be a set of $n$ exercises, each taking 1 day to solve, and suppose we have $n$ days available to solve the exercises. Each exercise $E_i$ has a deadline $D[i]$ associated to it, which is an integer in the range $0...n - 1$. Each exercise $E_i$ must either be solved on a ... |
Suppose you have to drive from Eindhoven to the south of France. Your start and destination are fixed and the route is fixed as well. You start with a full petrol tank, but since the distance is quite long you will need to fill up your tank several times. There are $n$ petrol stations along the way, and your goal is to... |
Here is the problem statement. Let $E_1,...,E_n$ be a set of $n$ exercises, each taking 1 day to solve, and suppose we have $n$ days available to solve the exercises. Each exercise $E_i$ has a deadline $D[i]$ associated to it, which is an integer in the range $0...n - 1$. Each exercise $E_i$ must either be solved on a ... |
Suppose you have to drive from Eindhoven to the south of France. Your start and destination are fixed and the route is fixed as well. You start with a full petrol tank, but since the distance is quite long you will need to fill up your tank several times. There are $n$ petrol stations along the way, and your goal is to... |
Here is the problem statement. Let $E_1,...,E_n$ be a set of $n$ exercises, each taking 1 day to solve, and suppose we have $n$ days available to solve the exercises. Each exercise $E_i$ has a deadline $D[i]$ associated to it, which is an integer in the range $0...n - 1$. Each exercise $E_i$ must either be solved on a ... |
Suppose you have to drive from Eindhoven to the south of France. Your start and destination are fixed and the route is fixed as well. You start with a full petrol tank, but since the distance is quite long you will need to fill up your tank several times. There are $n$ petrol stations along the way, and your goal is to... |
Here is the problem statement. Let $E_1,...,E_n$ be a set of $n$ exercises, each taking 1 day to solve, and suppose we have $n$ days available to solve the exercises. Each exercise $E_i$ has a deadline $D[i]$ associated to it, which is an integer in the range $0...n - 1$. Each exercise $E_i$ must either be solved on a ... |
Suppose you have to drive from Eindhoven to the south of France. Your start and destination are fixed and the route is fixed as well. You start with a full petrol tank, but since the distance is quite long you will need to fill up your tank several times. There are $n$ petrol stations along the way, and your goal is to... |
null |
Here is the problem. Suppose you have to drive from Eindhoven to the south of France. Your start and destination are fixed and the route is fixed as well. You start with a full petrol tank, but since the distance is quite long you will need to fill up your tank several times. There are $n$ petrol stations along the way... |
Also note that if the function is injective and not necessarily surjective, then the inverse will be partial computable |
null |
null |
If you need something that is guaranteed to be unbiased -- i.e., that will generate each possible valid outcome with equal probability -- I don't know of a way to achieve this efficiently. The simplest way to achieve it is with brute force: Generate a full solution, e.g., with the [Fisher-Yates shuffle](https://en.wiki... |
In the Chomsky hierarchy what is corresponding to a contracting grammar?
I can find references to non-contracting grammars (which can be transformed into context-sensitive grammars accordingly to what Wikipedia is saying: https://en.wikipedia.org/wiki/Noncontracting_grammar), but I don't know what would correspond ... |
What is a contracting grammar (in opposition to a non-contracting grammar)? |
|formal-grammars|chomsky-hierarchy| |
The given grammar has a direct and an indirect recursion. There is no rule to solve this or such which mentions whether any production is to be changed or not. However one way to keep things clear would be to consider one rule at a time for removing left recursion, which in your case would be as follows
$$S\rightarrow... |
This claim is incorrect. The diagram below shows a small counterexample:
[![A small counterexample][1]][1]
Consider two different runs of the greedy algorithm that break ties in different ways:
1. Run 1 chooses the 6 red vertices in order from darkest to lightest, then chooses the yellow vertex.
2. Run 2 choo... |
excuse me, could someone explain to me the reduction of the problem 3-dimensional matching to subset sum? I was reading Jon Kleinberg's design algorithms book and when I came across this reduction I didn't understand how it really works:
"So consider an instance of 3-Dimensional Matching specified by sets $X,Y,Z$, ... |
3-Dimensional Matching $\eq _{p}$ subset sum Explanation |
|complexity-theory|np-complete|np-hard|np|subset-sum| |
excuse me, could someone explain to me the reduction of the problem 3-dimensional matching to subset sum? I was reading Jon Kleinberg's design algorithms book and when I came across this reduction I didn't understand how it really works:
"So consider an instance of 3-Dimensional Matching specified by sets $X,Y,Z$, ... |
3-Dimensional Matching $\eq$ $_{p}$ subset sum Explanation |
3-Dimensional Matching $\leq$ $_{p}$ subset sum Explanation |
I don't consider this to be a sufficient proof. There are a number of problems with this proof:
> Let OPT be the optimum solution
No, you can't make such a definition, as there could be multiple optimal solutions. You might mean to let OPT be any optimum solution.
> In this case we are done.
You need to e... |
> 1. How would you deal with a user who produced a steady stream of valuable answers, but tends to generate a large number of arguments/flags from comments?
Thankfully, cs.SE is not the sort of community where this happens often!
We highly discourage comment discussions, preferring that they move to chat. I would... |
Is it correct to assume that if the input that I hash is sensitive, that I should also consider the locality-sensitive hash generated for that input to be sensitive? I presume that, if an attacker has access to all the hashes and a couple known plaintexts, then they could likely use those to make a cryptanalysis attack... |
If the data that I input for locality sensitive hashing is sensitive, should its resulting hash also be considered sensitive? |
|algorithms|machine-learning|hash|cryptography|security| |
You are right. Unrestricted grammars (type-0) have productions $\alpha\to\beta$ with $\alpha$ containing at least one nonterminal.
For noncontracting (or monotonic) the condition $|\alpha|\le |\beta|$ is added.
I would not use the term "contracting" for what you try to express, though. That suggests that strings... |
null |
The following approximation algorithm for the *Minimal Dominating Set Problem* is said by a fellow student to be a 1.5-approximation:
1. Start with empty set $S$
2. As long as not all vertices are covered:
* Add a vertex that is not in $S$
with the most uncovered neighbors including itself.
* Mark it and... |
Can we prove the greedy algorithm archives 1.5-approximation for the Minimal Dominating Set Problem? |
|graphs|approximation|greedy-algorithms| |
We know that finding the size of the maximal independent set of a planar graph is NP-complete. I'm curious about whether it remains NP-complete for maximal planar graphs, i.e., the graphs in which adding any edge will destroy its planarity, or equivalently, all edges of whose faces are bounded by three edges.
I've a... |
Is maximal independent set on maximal planar graphs still NP-complete? |
|complexity-theory|graphs|np-complete|independent-sets| |
null |
Here is the problem. Suppose you have to drive from Eindhoven to the south of France. Your start and destination are fixed and the route is fixed as well. You start with a full petrol tank, but since the distance is quite long you will need to fill up your tank several times. There are $n$ petrol stations along the way... |
Here is the problem statement. Let $E_1,...,E_n$ be a set of $n$ exercises, each taking 1 day to solve, and suppose we have $n$ days available to solve the exercises. Each exercise $E_i$ has a deadline $D[i]$ associated to it, which is an integer in the range $0...n - 1$. Each exercise $E_i$ must either be solved on a ... |
null |
In computational complexity theory, Peter van Emde Boas formulated the *Invariance Thesis* saying that:
> 'Reasonable’ models of computation can simulate each other within a polynomially bounded overhead in time and a constant-factor overhead in space.
See eg [Cambridge Encyclopedia of Philosophy](https://plato.... |
In computational complexity theory, Peter van Emde Boas formulated the *Invariance Thesis* saying that:
> 'Reasonable’ models of computation can simulate each other within a polynomially bounded overhead in time and a constant-factor overhead in space.
See eg [Cambridge Encyclopedia of Philosophy](https://plato.... |
The below image is taken from the book : Operating Systems: Internals and Design Principles by William Stallings, 8th edition, page 68.
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/DXyxN.png
I cant understand the meaning of Differential Responsiveness, can somebody please explain... |
Scheduling and Resource Management in OS |
|operating-systems| |
This is more of a comment, but I want to append an image. The following graph is maximal planar and every node has degree 4, thus the proposed algorithm does not work. The maximal independent set of this graph has 2 nodes.
[![graph][1]][1]
As I said, this is more of a comment / not an answer.
[1]: https... |
null |
How do you calculate the amount of iterations the following loop will have in terms of n?:
```
for (i = 1; i < n^3; i += n) {
}
```
I've gotten as far as: $$i=(x-1)n+1\ for\ current\ iteration=x$$ $$Total\ iterations=x\ when\ n(x-1)+1\geq n^3>n(x-2)+1$$ |
How do you calculate the amount of iterations the loop "for (i = 1; i < n^3; i += n)" |
|runtime-analysis| |
{"Voters":[{"Id":159109,"DisplayName":"Felix Jönsson"}],"DeleteType":1} |
{"Voters":[{"Id":159109,"DisplayName":"Felix Jönsson"}]} |
**Hint:**
$$i=1,1+n,1+2n,1+3n,\cdots1+(n^2-1)n,1+n^2n\cdots$$ |
null |
null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.