instruction
stringlengths
0
29.8k
⌀
|process-scheduling|real-time|
I have a question related with the response time of Deadline Monotonic scheduling...let's assume that there are 4 tasks, and the processor only allows to have 3 task priorities, thus there will be 2 of 4 tasks that will have same priorities. Tasks with same priorities will be processed in FIFO order. Do you know the fo...
I have a data set showing different clusters of data points and was attempting to find a way to get the peak of at every cluster. Comparing the moving average between a set of points does not work as the y values fluctuate up and down as x increases. [![enter image description here][1]][1] [1]: https://i.sta...
Identifying peaks at every cluster
|algorithms|graphs|python|
Is there a name for the class of software errors that arise from the fact that the software believes something wrong about the state of the world? (Allow me a bit of anthropomorphization of software, for the sake of explanation.) One example: > A temperature sensor correctly reads 19°C, but the software access...
Name of class of errors where the real state differs from the recorded state?
|terminology|software-engineering|
null
null
Tentukan Bahasa regular dan gambarkan Finite Automata dari Regular ekspresi berikut : a. a (ba)* b. (ab)* a
Here’s a suggestion to verify that the square root is a problem: Measure how fast your code is. Replace sqrt(d) with sqrt(sqrt(d*d)). How much slower does your code get?
GIGO - Garbage In, Garbage Out.
Here is the block diagram of the pipeline for the H.264 encoder (*Fundamentals of Multimedia by Ze-Nian Li, Mark S. Drew and Jiangchuan Liu*). ![H.264 encoding block diagram](https://i.stack.imgur.com/PDcai.png) The feedback loop is used for motion estimation, but why is it taken **after** the transform and quant...
Why Is Inverse Quantization and Inverse Transform Taken Before Motion Estimation in H.264?
|video|
null
null
null
As the title says, this is a silly runtime analysis question. I have a parameter $q$ which is the probability of selecting a vertex (among $n$ vertices...) to be in a certain set. I am constructing the sets in an iterative way, having the vertex $v_i$ be in the set with probability $\leq \left(1 - q\right)^i$ (I...
Silly runtime question
|graphs|runtime-analysis|
There is an abuse of notation in your question: you are using $i$ as both the index for the summation and as the total number of terms in the sum (in the closed formula). Anyway, the ratio of the geometric series is $1-q$, but you mixed it up with $q-1$ in the closed formula. For simplicity consider the infinite sum...
I have a parameter $q$ which is the probability of selecting a vertex (among $n$ vertices...) to be in a certain set. I am constructing the sets in an iterative way, having the vertex $v_i$ be in the set with probability $\leq \left(1 - q\right)^i$ (I'm not going into details about the order of the vertices for whi...
Asymptotics of the sum of a geometric series
|asymptotics|
A practice problem in my textbook asks to proof the amortized complexity for a sequence of insert, delete min, and decrease-key operations on an initially empty skew heap. Insert and delete min both have an amortized complexity of $O(log(n))$, and the deletion algorithm that removes an arbitrary node in a skew heap is ...
Amortized analysis on skew heap arbitrary deletion
|graphs|heaps|amortized-analysis|
null
Turing Machine where instead of having a set of final states F it has: A designated final state qaccept which exists in Q set of states. Upon being in this state, it halts, and accepts the input. A designated reject state qreject which exists in Q set of states. Upon being in this state, it halts, but rejects the...
Turring Machine Variant and Equivalent Traditional
|turing-machines|proof-techniques|
null
{"OriginalQuestionIds":[163281],"Voters":[{"Id":755,"DisplayName":"D.W."}]}
> Suppose $P\neq NP$. Which one of the mentioned problems can be solved > in polynomial time? > > - Give natural number $n$ and positive real numbers $a_1,a_2,\dots,a_n$ and $b_1,b_2,\dots,b_n$. The goal is to find > $I\subseteq\{1,2,\dots,n\}$ such that $\sum_{i\in I}b_i$ maximized and > $\sum_{i\in I}a_i\leq 5...
Which one of the problems belong to P?
|algorithms|np-complete|
{"OriginalQuestionIds":[158832],"Voters":[{"Id":755,"DisplayName":"D.W.","BindingReason":{"GoldTagBadge":"algorithms"}}]}
> Suppose $P\neq NP$. Which one of the mentioned problems can be solved > in polynomial time? > > - Given natural number $n$ and positive real numbers $a_1,a_2,\dots,a_n$ and $b_1,b_2,\dots,b_n$. The goal is to find > $I\subseteq\{1,2,\dots,n\}$ such that $\sum_{i\in I}b_i$ maximized and > $\sum_{i\in I}a_i\leq ...
null
Let $D(V, A)$ be a DAG. We call a *dominated* path in $D$ a path $P$ such that $\quad\quad P$ is maximal and $\exists_{P^{'} \in D}(P \text{ is maximal } \wedge V(P) \subset V(P^{'}))$ that is, $P$ is a dominated path iff. $P$ is maximal and there exists another path $P^{'}$, also maximal, containing all the nod...
Non-dominated maximal paths (DAG)
|algorithms|graphs|dag|
Let $D(V, A)$ be a DAG. We call a *dominated* path in $D$ a path $P$ such that $\quad\quad P$ is maximal and $\exists_{P^{'} \in D}(P^{'} \text{ is maximal } \wedge V(P) \subset V(P^{'}))$ that is, $P$ is a dominated path iff. $P$ is maximal and there exists another path $P^{'}$, also maximal, containing all the...
null
I am attempting to draw the DFA of this problem but I'm kind of stuck. In another post I saw that the DFA should have 10 states. I'm finding it hard to even understand the question, is the input to the DFA the full string so for example 1001 or is it multiple inputs of length 3 in this example 100 and then 001. I've ma...
null
I just started studying the concept of context-free grammars and I find something very confusing. Watching a video I found someone tackling the problem {0^n 1^m : n,m>=0}. I thought that the simple answer would have the production rules: S -> \epsilon | 0S | S1 Since I thought this implies that whichever string ...
Context free grammar {0^n 1^m : n,m >= 0}
|context-free|formal-grammars|
You can't produce $0101$ because every time you use $0S$ you are putting a $0$ at the beginning of the string. Whenever you want to insert a $1$, it directly goes to the end of the string and it will remain the last element of the string. This holds also in the opposite way. You can add $1$s and, if you add a $0$, it b...
I just started studying the concept of context-free grammars and I find something very confusing. Watching a video I found someone tackling the problem ${0^n 1^m : n,m\geq 0}$. I thought that the simple answer would have the production rules: $S \rightarrow \epsilon \ | \ 0S \ | \ S1$ Since I thought this implie...
Context free grammar $\{0^n 1^m : n,m \geq 0\}$
null
While preparing for final exam, I encountered a (target) problem where you have $M$ lines and $L$ points and you want to answer if it's possible to cover them all using $K$ disks of unit radius (decision problem). I would like to reduce the [Disk Covering Problem][1] to the problem at hand to show that the problem ...
Karp-reduction of Disk Covering Problem
|reductions|logic|
null
After some hours of paper sketching, I think I could come up with somethig. Let $P = (v_1, \dots, v_n)$ be a path in $D$. Then we have **Lemma 0:** Any other permutation of $P$ results in an invalid path for $D$. **Proof:** The replacement of $v_{j}$ by $v_{k}$ in $P$, such that $j < k$, resulting in the follo...
After some hours of paper sketching, I think I could come up with somethig. Let $P = (v_1, \dots, v_n)$ be a path in $D$. Then we have **Lemma 0:** Any other permutation of $P$ results in an invalid path for $D$. **Proof:** The replacement of $v_{j}$ by $v_{k}$ in $P$, such that $j < k$, resulting in the follo...
Does an edge never being the largest weight in any cycle imply that it is included in the MST? I believe the answer is not, but can't think of a counterexample. I know that one guarantees an edge is in the MST with the cut property, but was wondering if this is equivalent.
Edge being in the MST
|minimum-spanning-tree|
This is just the copy and paste of it but does the use of true randomness work? To understand this proof you must first understand 1. NP vs P problem 2.The quantum eraser experiment 3.True randomness Before we start I must first assert things that have been proven to be true, if you question any of my assert...
Does the use of True randomness work in this proof for P does not equal NP
|complexity-theory|
null
I think you don’t quite understand what non-deterministic means. Take the travelling salesman problem. Say 50 cities, and we ask if you can visit all of them and return to the start within 1950 miles. A nondeterministic algorithm guesses correctly in which order to visit the 50 cities, you add the distances, it’s l...
Consider $G = (V, E, w)$ an undirected weighted connect graph, and $T = (V, F)$ a minimum spanning tree of $G$. Assume there exists $a\in E$ such that $w(a)$ is never the largest in any cycle containing $a$, and $a\notin F$. Then $(V, F\cup \{a\})$ contains a cycle. Do you see how to construct a spanning tree of ...
To understand this proof you must first understand 1. NP vs P problem 2.The quantum eraser experiment 3.True randomness Before we start I must first assert things that have been proven to be true, if you question any of my assertions feel free to research them yourself. True randomness does exist (demonstrat...
To understand this proof you must first understand 1. NP vs P problem 2.The quantum eraser experiment 3.True randomness Before we start I must first assert things that have been proven to be true, if you question any of my assertions feel free to research them yourself. True randomness does exist (demonstrat...
You need seven states: The error state - once in the error state you always go to the non-accepting error state. States 00, 01, 10, 11: These are the last two characters processed. If we process 0 then we move from 00 or 10 to 00, from 01 to 10, and from 11 to error. (11 will only be encountered if the first two...
I think you don’t quite understand what non-deterministic means. Take the travelling salesman problem. Say 50 cities, and we ask if you can visit all of them and return to the start within 1950 miles. A nondeterministic algorithm guesses correctly in which order to visit the 50 cities, you add the distances, it’s l...
Using the regular mergesort algorithm for a list, say $a[1...n]$, we call the merge function to merge, mergesort($a[1...\lfloor \frac{n}{2} \rfloor]$) and mergesort($a[\lfloor{\frac{n}{2}}\rfloor+1...n]$). Let $T(n)$ be the time complexity for mergesort. Then, the first sublist needs $T(\lfloor \frac{n}{2} \rfloor)$ ti...
Mergesort time complexity
|algorithms|algorithm-analysis|
You are right, but ignoring floor and ceiling does not affect the asymptotic behavior of your recurrence, so you can consider $T(n) = 2 T(n/2) + O(n)$ instead of $T(n) = T(\lfloor n/2 \rfloor) + T(\lceil n/2 \rceil) + O(n)$ while still obtaining the same (asymptotic) solution. This might feel a bit hand-wawy, but i...
null
It is well known that context-free languages are not closed under intersection or complement. But what about context-free languages $L_1$ and $L_2$, such that $L_1 \cap L_2$ as well as $\left( L_1 \cap L_2 \right)^C$ are not context-free languages. I can think of many examples of two context-free languages whose int...
Are there context-free languages whose both intersection and complement of intersection are non-context-free?
|formal-languages|context-free|
null
null
{"Voters":[{"Id":-1,"DisplayName":"Community"}]}
I've come up with a greedy algorithm proof for the minimum denominations problem, and I'm curious if someone can verify the correctness of the proof for me. Thank you very much in advance. **A Formal Definition of the Problem** Given a set of denominations D and a number s, find an optimal solution set of denomin...
Greedy Algorithm and Proof of Correctness for Minimum Denominations Problem
|algorithms|proof-techniques|greedy-algorithms|correctness-proof|
I've come up with a greedy algorithm proof for the minimum denominations problem, and I'm curious if someone can verify the correctness of the proof for me. Thank you very much in advance. **A Formal Definition of the Problem** Given a set of denominations D and a number s, find an optimal solution set of denomin...
Here is a recipe to construct such a language, using examples we know. Start with a context-free language $K_0$ such that its complement $K_0^C$ is not context free. Also consider two context-free languages $K_1$ and $K_2$ such that their intersection $K_1\cap K_2$ is not context-free. Note that for any language $K...
null
I've come up with a greedy algorithm proof for the minimum denominations problem, and I'm curious if someone can verify the correctness of the proof for me. Thank you very much in advance. **A Formal Definition of the Problem** Given a set of denominations D and a number s, find an optimal solution set of denomin...
{"Voters":[{"Id":164868,"DisplayName":"Gary Drocella"}],"DeleteType":1}
{"Voters":[{"Id":164868,"DisplayName":"Gary Drocella"}]}
I've come up with a greedy algorithm proof for the minimum denominations problem, and I'm curious if someone can verify the correctness of the proof for me. I have simplified the problem by restricting the denomination set to the US Coinage System. Thank you very much in advance. **A Formal Definition of the Problem...
Greedy Algorithm and Proof of Correctness for Minimum Denominations of US Coinage System Problem
I've come up with a greedy algorithm proof for the minimum denominations problem, and I'm curious if someone can verify the correctness of the proof for me. I have simplified the problem by restricting the denomination set to the US Coinage System. Thank you very much in advance. **A Formal Definition of the Problem...
null
It's a bit unclear how you make a leap from "The problem is truly random" to "the result can't be predicted". Let's imagine another example: you use True Randomness to shuffle N numbers. Does this stop sorting algorithms from working? Obviously no, they will still work in O(N log N) time. So why does True Randomness...
I have a dataflow graph where a set of different types of tasks are placed in its nodes. For example, I have tasks of types A, B, and C. A-type tasks are placed in all the leaf nodes of the dataflow graph. B-type tasks are placed in nodes with the data from any two nodes hosting A-type tasks or one node hosting B-type ...