instruction
stringlengths
35
29.1k
Both Logic in Computer Science (Huth and Ryan, 2004) and Branching vs. Linear Time: Final Showdown (Vardi, 2002), state something to this effect (paraphrased): In LTL, X F p and F X p are equivalent, meaning "p is eventually true in some state that is not the current state". In CTL, AX AF p and AF AX p are not equival...
A 1 is an "on" signal, and a 0 is an "off" signal. How does a computer know 01110 is different from 010? Does the computer wait between signals?
In Practical Foundations for Programming Languages, Robert Harper says If for a proposition to be true means to have a proof of it, what does it mean for a proposition to be false? It means that we have a refutation of it, showing that it cannot be proved. That is, a proposition is false if we can show that the assump...
I need to store two distinct variables of 1 byte size in memory. My memory system stores 4 bytes at one address; therefore, you cannot address byte 3 directly, and you have to logically access it after all 4 bytes are fetched of that address (correct me if I'm wrong please). So, if I assign the following two variables...
Say I have total 4 bytes on 1 byte addressable memory, with a 32 bit bus. If I move value at 0'th address to one of the registers will system grab all 32 bits (all 4 bytes) through bus from memory, reprocess it to extract 0'th address value behind the scenes? Or will it get exactly one byte through bus?
I have a system with some factors, say A, B, C, and D. There can be different values of all these factors. Let us consider few values to have a better understanding. Let's say A has 4 different values, A1, A2, A3, A4. B may have 3 or 5(anything, no order or logic here), similarly C and D may also have many different va...
Is it possible to create a Determinist Finite Automaton that is equivalent to a Nondeterminist Finite Automaton, whatever that NFA is ? Is there an algorithm to create such a DFA if we have a NFA ?
I've been stuck on this for a while now, I've tried reading the related topics on cs.stackexchange as well as the textbook and youtube videos. Suppose we have a 8KB direct-mapped data cache with 64-byte blocks. Offset $= log_2(64) = 6$ bits number of blocks $= 8k / 64 = 125$ $Index = 7$ bits $Tag = 32 – 13 = 19$ bits...
Let $M$ be a DFA. I would like to prove that $L(M)$ is infinite if and only if there exists a string $w \in L$ such that $|Q| \leq |w| \leq 2 \cdot |Q| $. My idea was to use the fact that the shortest string in $L(M)$ is of size at most $|Q|$, but I am not sure precisely how I should use this. Or is there a different a...
Sam is a teacher. He teaches exotic materials (he's not a very computer fluent person and knows no programming). In his course he has several topics he teaches, say $a$, and each topic has a variable number of subtopics. The total number of subtopics in his course is $b$. In his exam (which is in essay form), the dean ...
Given a directed graph with number of nodes not exceeding 3*10^4. Each node has indegree ranging from 1 to 5 and outdegree from 1 to 5. We need to partition the graph into vertex-disjoint simple cycles. It is necessary to use all the nodes but it is not necessary to use all the edges.
I have a directed graph, and some algorithms in networkx I want to apply to it. Unfortunately when I try to use the algorithms, python tells me that they're only implemented for undirected graphs so far, not directed graphs yet. I don't really want to reimplement these algorithms myself, is there a way to model my dire...
Assuming $y$ is a boolean variable in an ILP program (that is $y \in Z$, s.t. $0 <= y <= 1$) and $x_1$, $x_2$ are bounded integer variables between $0$ and $M$. I want to encode the following high level constraint: $$y = 1 \iff x_1 \le x_2$$ So far I've got this: $$x_1 \le x_2 + (M+1)y$$ This enforces that whenever $x_...
I am working on a question answering system. I've learned that informer spans are valuable features for question classification. However from what I've read I wasn't able to find any publicly available dataset for this task, or a trained tagger. Is there any? People seem to just hand-label their dataset. If there aren'...
Suppose I am looking at an optimization problem with a large number of interconnected constraints, but the solution is - in some regions - extremely volatile (With volatile I mean: small mutations might drastically change the evaluation of the proposed solution. Also note that not all changes are volatile in this way, ...
I know $\overline{A_{TM}}$ is not Turing Recognizable (to prove it, infact, I proved its complement to be both Turing-recognizable and not decidable). My question is, if $\overline{A_{TM}}$ is not Turing Recognizable, can I reduce $\overline{A_{TM}}$ to some language A (say $E_{TM}$) to show it is not Turing Recogniza...
The CS188 course from Berkeley goes to great length in explaining why the optimality of $A^*$ algorithm is conditioned by the admissibility of heuristic. Note: admissibility of heuristic means that: $$\forall n, 0 \leq h(n) \leq h^*(n) $$ With $h^*(n)$ being the true optimal distance of $n$ to the goal. The course's pr...
I'm trying to implement an rbfs search algorithm for the 15 puzzle (pseudo code below). link to the paper where i found the pseudo code: https://www.aaai.org/ocs/index.php/SOCS/SOCS15/paper/viewFile/10911/10632 I do not understand what line 11 is suppose to do. Any clue appreciated Also, it start with a bound, and in ...
I have been reading some material about undecidability of a language, and I am not quite sure of one part. For what I see: I start with a decider H, that has an input <M,w> where M is a Turing Machine and w is a string, so I have the following: H(<M,w>)=accept if M accepts w rejects if M rejects w all fine un...
Edit: Maybe this is not the best title, so few free to change it. So I'm trying to prove the following statement: A finitely branching tree $T$ with infinitely many vertices must have an infinite path. My proof is loosely like this: $P = \emptyset$ Start at the root $v_0$ Since there are infinitely many vertices, th...
Give a question: Language L= {a^n b^(n+m) a^m}, where both n and m are >=0. Is L context-free or not. If the answer is yes, can I use the following PDA to prove it? Since {a^n b^(n+m) a^m}={a^n b^n b^m a^m}, in the PDA, we first push n a's onto the stack. Then, we pop n a's from the stack by reading n b's. Next, we pus...
In physical layer, we already have methods to share a common link by dividing into channels using FDM etc. Then why do we need to think about multiple access at data link layer? I.e why csma, csma/cd are needed? We shouldn't be seeing any collision at all when I'm using a different channel for communication right? Do...
I'm having a little problem with the abstraction layers in linear types. If every variable is used exactly once, there is no way to copy data, since you have to read each datum twice in order to write it twice to two different locations. However, you could argue that once a variable is loaded into a register, you may ...
I have the following model: Let's say two indepentent weighted six-sided dice $X$ and $Y$ with unknown probabilities (i.e. probability of 1 is unkown etc) and they have not necessarily the same probability distribution. However, these are hidden variables and we only observed the outcome $S = X + Y$. I now want to use ...
I'm working on a problem to find the camera position in the world system when each picture was shot. I currently have several pictures taken from different angles, and for each picture there is only a black square on a white paper. I have the actual size of the black square on the paper and the intrinsic matrix of th...
I'm aware of the two questions prioritizing inserts and extracts individually, each in $O(1)$ time, but does there exist a unique integer priority queue algorithm for the range $[0, n)$ that can do both insert and extract-min in $O(1)$? The closest one I've found so far is this one, with the following qualities: Inser...
Background I have a setup where I need to make an API call to a partner to initiate a financial transaction. I have multiple partners, and I need to choose which one to use each time a transaction needs to happen. The characteristics differentiating two partners are: if the transaction is accepted or not (acceptance)...
I'm reading The Rust Programming Language and found the following passage: Remember that writing to a struct is not an atomic operation, and many functions like vec.push() can reallocate internally and cause unsafe behavior, so even monotonicity may not be enough to justify UnsafeCell It just popped out of nowh...
I'm wondering if there are any universally accepted "best" algorithms for syncing data sets. I imagine there would be different solutions depending on circumstances: Are all peers online all the time or not? Are we more limited by bandwidth or processing power? Are data items large or small? Does data get modified and...
I was reading Robert Kelinberg's paper on Nearly Tight Bounds for the Continuum-Armed Bandit Problem There is a section where he says: "For a d-dimensional strategy space, any multi-armed bandit algorithm must suffer regret depending exponentially on $d$ unless the cost functions are further constrained. (This is demo...
I've been searching for a specific case of the four color map theorem all over the internet, but can't seem to find a reliable explanation. Does anyone know one or two "cases" of maps as applied to the four color map theorem, including how it could be proved by hand? The only explanation given on the web is Appel & H...
Kind of what it says on the tin. Let's say I have a countably infinite alphabet $A$ and a "language" $L = \{s_1s_2 | s_1,s_2 \in A\}$ (i.e. all possible strings of length 2). Now, my question is this: does it even make sense to think of this in terms of formal languages? Is there some construct akin to a state machine ...
Problem: given a set of n tasks with execution time Ti, due date Di, and a profit Vi (given only if is enden before due date), is there a task schedule that returns a total profit greater or equal than k knowing that tasks must be executed one at a time? I am asked to proof that this problem is NP-Complete, can anyone ...
Let's say I have a function that runs in $O(n \lg n)$. Let's say instead of running this function with a $n$-sized input, I run it $k$ times with an $(n/k)$-sized input, so I want to check if $$ O(n \lg n) = k \left( O \left( \frac{n}{k} \lg \frac{n}{k} \right) \right)$$ I think it is, because of: $$ O(n \lg n) = O \...
search problem: find the assignment that maximize the number of satisfied clauses For decision problem: determine whether there is an assignment that satisfies k of clauses. optimization problem : determine the number of clauses that maximize the number of satisfied clauses ( is this correct?) If I want to reduce searc...
Given a set $\cal D$ of unit disks in the plane and a set $C$ of colors. Every disk in $\cal D$ is colored with one of the colors in $C$. Note that multiple disks may be colored with the same color. Every color $c_i \in C$ is associated with a weight $w_i$. for every path $p$ in the plane, we define the weight of $p$ ...
I want to show correctness of "Algorithm to find maximum element in array" using induction and contradiction. ans=-infinity for (i=0; i<n; i++) ans= max(ans, A[i]) where A[0:n-1] is array and max is the function to return maximum of its two arguments. What I am doing: Base case: i=0, ans= max(-infinity,A[0])=A[0],...
Suppose, There are $2$ processes $P1$ and $P2$. It is given that Mutual Exclusion and Progress are satisfied by these $2$ processes. Suppose, Programming protocol is designed such that CPU only executes $P1$ and $P2$ is never alloted the CPU, So, here $P2$ starves. My Question :- Is Bounded Waiting satisfied here ? ...
While studying arrays a question came to my mind. If only 1D and 2D arrays can be used, then why multi-dimensional arrays exist? Is there any use of multi-dimensional arrays?
I am not sure if I should ask this question here or somewhere else. In fact, I initially asked my question here at mathoverflow.net but it was marked as off-topic Background: I was searching through random mathematics paper that are related to cryptography and I came across this paper (page 3). I just read the abstract...
I have this problem, and I don't really understand how am I supposed to do this. Could someone please help me with this? I know what left quotient is. I also know about regular, irregular languages. But still I don't know how to show this... Any help would be appreciated, thanks in advance! Also sorry if something is n...
Is $L=\{\langle M,w \rangle|M\text{ does not modify the tape on input w}\}$ decidable? We could tell if a TM does not modify the tape on any input by checking if there are no transitions in $M$ that write on the tape, but can it be decided for a given $w$?
As a follow-up to this question , I've found a recursive algorithm that solves the given problem, but it runs too slow to pass all given tests. int solve(int i, int crane1_pos, int crane2_pos, int dist) { if(i == n) { return dist; } int dist1 = dist + get_dist(crane1_pos, t[i].first); int...
For a given language $L$ and $w \in X^{\ast}$ denote by $w^{-1} L := \{ u \in X^{\ast} : wu \in L \}$ the (left) quotients of $L$. The left quotients are closely related to the minimal automaton of $L$ in case $L$ is regular, i.e. in that case $(X, Q, \delta, q_0, F)$ with $Q := \{ w^{-1} L : w \in X^{\ast} \}$, $\delt...
Suppose an enumerator E can enumerate some language L in a finite amount of time (3 days, 3 hours, etc.). What properties does this language have? My guess: L is finite, so L is a context-free language. Since L is a context-free language, L is also decidable Since L is decidable, L is also Turing-recognizable and co...
Given this language: $$L_{s_1,s_2} = \{ \langle M_1 \rangle \langle M_2 \rangle | L(M_1) \in S_1 \text{ and } L(M_2) \in S_2 \}$$ I want to prove that for $S_1=RE$ and $S_2=RE$, then $L_{S_1,S_2} \in R$. The way I started was by trying to build a Turing Machine that decides $L_{S_1,S_2}$: Let $M_{12}$ be that Turing m...
So let's say 2 relations, B(R) = 200,000 and B(S) = 300,000. The memory buffer is M = 400 blocks. How many passes would this take to join? Notation:
Are there programs that can 'translate' source code between any two languages (assuming the translator has access to the requisite libraries)? If there are, how do they work (techniques used, knowledge required, etc)? How would they feasibly be constructed? If they aren't, what are the restrictions preventing their dev...
I want to try and use a succinct type data structure in order to find the amount of occurences of a letter $C$ in a string $S$ until a given index $I$. Assume we have a string $S$ of length $n$ over the alphabet $\Sigma = \{1,2,3,\ldots,n\}$. I want to build a data structure whose space usage is at most $O(n)$ machine-...
There are two classes of binary functions, $F_1,F_2$. The VC-dimension of $F_i$ is $d_i$. Is there any simple formula for the VC-dimension of the following classes? $F_\lor := \{ f_1(x) \lor f_2(x) | f_1\in F_1 \text{ and } f_2\in F_2\} $ $F_\land := \{ f_1(x) \land f_2(x) | f_1\in F_1 \text{ and } f_2\in F_2\} $
The following language is NP-complete: $$\{ (\alpha, x, 1^n, 1^t): \exists u \in \{0,1\}^n s.t. M_\alpha \text{ outputs 1 on input } (x,u) \text{ within t steps}\}$$ I would like to have a stronger understanding of the $1^n$ and $1^t$ inputs that are provided as auxiliary inputs. Is the above language equivalent to the...
Flynn's Taxonomy was a classification of computer architectures published in 1966. Computing has changed a lot since then. Is this taxonomy still useful? What are some of its shortcomings for evaluating modern computing systems?
Design a linear time algorithm for finding the least positive integer missing from an unsorted array. Changes in the array are allowed. For example, for the array -10,-1,2,3,6,30, the answer is 1. I thought about finding the maximum and minimum numbers in the array (this is $\Theta(n)$), then a loop from the minimum ...
Wikipedia says: The problem has been shown to be NP-hard and the decision problem version ("given the costs and a number x, decide whether there is a round-trip route cheaper than x") is NP-complete. How can the "non-decision problem" version be NP-hard? Doesn't this class contain decision problems, by definitio...
Given an $n \times m$ matrix $A$ where $m-n=1$ The value of any $A$[$i,j$] is either $1$ or $0$ If $A$[$i,j$] $=1$ then $i<j$ Does anyone know of an algorithm which would run as follows and what its complexity might be: Starting with the last column, column $m-1$, traverse each index $A[i,m-1]$ (where $0 \leq i < m-...
For this question, I have tried everything that I can think of, but cannot solve it. What I want to do is iterate over all possible values of $z_1$, but every method I use, it requires me to know what $p(m|z_1)$ will be for various $z_1$ values. Thus I am stumped and looking for help. A robot applies the so-called s...
I understand that the theoretical size of a diff patch between two similar files can be calculated using Kullback Leibler (KL) as described @ Wikipedia. Can anyone point me to a numerical example of this calculation? I can only find general theory and formulae. I'd like to check my work. So this is what I have so fa...
To my understanding, as long as we can find some polytime function $f$ such that $\forall x:x \in A \Longleftrightarrow f(x) \in B, x\notin A \Longleftrightarrow f(x) \notin B$, it follows that if $A$ is NP-complete and B is in NP, then B is also in NP-complete. My question is about what sort of 'things' we can do to o...
After constructing a binary search tree, you can read off the key values in ascending order by performing an in-order traversal. Will the resulting sorted order be stable? If so, how would the tree have to be coded to ensure this? If it is not possible, why not?" Just a review question I came across. From what I unde...
Hello I'm having trouble understanding how an intersection/union of regular languages can be regular and in other case non-regular. Can someone please give me some good examples?
Consider the usual RGB color palette, for which each color (red, green, blue) has $256$ distinct intensities. Can the set of all $2^{24}$ colors be expressed as a ternary linear code? If so, give a basis. If not, explain why not. I'm confused on how to solve this because I've only worked with binary linear codes. Ca...
Can every regex be translated into a DFA? Or only a subset of regular expressions? If so, what is an example of a regular expression that cannot be translated into a DFA?
A finite automaton is a generator for a regular language, and a regular expression represents a regular language. A language can be represented in many forms of regular expressions. So can a finite automaton have more than one regular expression?
How many words exist in the format of the simple precision IEEE 754 standard to represent the NaN value?
I tried finding real life applications for the Four Color Theorem (except for coloring maps) but couldn't find anything useful and well illustrated. For example I found this: Graph coloring problems are widely applicable to the problem of scheduling. Consider a university, where you are trying to schedule times for al...
I would like to know where in memory the global variables are stored. Thanks for your help.
There exists a collection c where c = {1, 2, 3} and a randomization of c, d where d = {1, 3, 2}. d was obtained by a function f where f is an undefined randomization function. Can c be obtained again (i.e. d = c) by randomizing d or d initially and then each randomized collection resulting from d using f? If so, can...
Having the implicit plane equation $$ax + by + cz + d = 0\,,$$ how do I find the affine transformation that must be applied to transform this plane into the plane with equation $$x + y = 0\,?$$ Please note in my case this is the horizontal plane as $y$ points up.
I am learning about deontic logics and there I can make the following inferences: If A then there is **duty to create an entity of class C**, If B then there is **duty to assign value 5 to the attribute c.a**, if A and B then **the computation D should be executed**. I. e. those deontic logic statements contain the usu...
In the current version as of the Wikipedia article “Potential method”, the amortized cost of each operation is defined as the following $$ T_{\mathrm{amortized}}(o) = T_{\mathrm{actual}}(o) + C \cdot (\Phi(S_{\mathrm{after}}) - \Phi(S_{\mathrm{before}})), $$ and the total amortized cost is $$ \begin{align*} T_{\mathrm...
Disclaimer: This is a simplified part of a question from my homework, addressing the point that I didn't figure out. let A be a 1-indexed sorted array of $n$ elements. There are at most 3 numbers that has at least $\lfloor n/4 \rfloor+1$ occurrences. Find three indexes that will surely "hit" all such numbers. Explai...
S -> aA | bC | CC | a | b | C A -> B B -> S C -> A | S It looks like its going to loop so it would be endless replacing the unit rule....
In a 'pool' with a lot of cpus ,jobs(processes) are running(lots of them) . Given I have time/resource usage 'samples' from many prior/still running jobs - how would you go about trying to predict the process resource usage ? Very abstractly , what I think should be done is as follows : 1) New job is submitted and s...
Is the class of problems with complexity $O(n^{n^\epsilon})$ at every $\epsilon>0$ same as class of problems with complexity $O(n^{f(n)})$ at every $f(n)\in\omega(1)$ and hence both classes are equivalent to $\mathsf P$ ($n$ is number of input bits)? (This is my view. Denote $C(n^{n^\epsilon})$ to be class of problems ...
The exact cover problem with restrictions on the size is: Input: Given a set $U=\{1,2,\ldots,n\}$ and a collection of $C$ of subsets of $U$. Question: Is there a subcollection $C^\star$ of $C$ such that The intersection of any two distinct subsets in $C^\star$ is empty; The union of the subsets in $C^\star$ is $U$; an...
Suppose that you extend the Calculus of Constructions with "holes" - i.e., incomplete pieces of code that you didn't fill yet. I wonder if there is an algorithm to fill those roles automatically. For example (using Morte's syntax): Case A: λ (pred : ?) -> λ (Nat : *) -> λ (Succ : Nat -> Nat) -> λ (Zero : Nat) -> (Su...
The (optimization version of) Set Cover problem is the following: given a "universe" set $S$ and a collection of subsets $S_1, \cdots, S_m \subseteq S$, we want to find the minimum cardinality set of $k$ elements $\{i_1, \cdots, i_k\}$ such that $\bigcup_{i=1}^k S_{i_j} = S$. It is a well-known result in an introductor...
The exercise is to prove or give a counterexample to the following proposition with $L \subseteq \Gamma^*$ regular and $h: \Gamma \to \Sigma^*$ a homomorphism. Is there any regular language $L'$ such that $h^{-1}(L^*) = L'^*$ ? I know that it isn't that easy to see, since $h^{-1}(L^*) \not= h^{-1}(L)^*$ in general with...
This is a practical problem in energy generation with heliostats. We have a number of heliostats basically forming the shape of a doughnut. The facility needs to deploy hubs on those heliostats. One hub can support 12 harnesses (a kind of cable) and one harness can support 16 heliostats; namely, one hub can support 192...
I tried to calculate the worst case of binary search (not binary search tree). My calculations: $$T(n) = T\left(\frac{n}{2}\right) + 1$$ $$T(n) = T\left(\frac{n}{4}\right) + (1+1) = T\left(\frac{n}{8}\right) + (1+1+1) = {\dots} = T\left(\frac{n}{2^{k}}\right)+(1\cdot k) $$ $$T(n)=T(1) + (1\cdot k) = c_{1} + (1\cdot k) ...
Let $X$ and $Y$ be problems, and let $X \le_p Y$. Is it true that \begin{equation} Y \in NP \rightarrow X \in NP\ ? \end{equation} I do mean $NP$ here, not $NP$-complete or $NP$-hard. The solution is simple if the reduction from $X$ to $Y$ transforms an instance of $X$ to an instance of $Y$; to verify that a solution...
I know that $E_{LBA} = \{\langle M \rangle ~ \mid ~ L(M) = \emptyset \}$ is an undecidable language, but is it recognizable (recursively enumerable)? It seems that it's complement is recognizable since we could construct a Turing machine that enumerates all strings and checks if any belong to the language. If both $E_{...
This is my new post linked with my previous post. Is bounded waiting satisfied in the 2 Process Solution? The answer in that post was very useful and cleared many concepts, but I just want to apply that answer for this example, that how BW works here . Especially, I want to know this definition works for this example...
In one of the lectures I went to, my professor stated that in order to determine the size of a search tree, we use the following formula: $$\frac{b^{d+1}-1}{b-1},$$ whee $b$ is the branching factor and $d$ is the depth of the tree in question. I would like to understand why we divide by $b-1$. I would have thought tha...
The topic of extracting the Facial Action Coding System (FACS) Action Units (AUs) [1] from images and it's translation into emotion prediction [2] is pretty well studied, but I'm not clear on how it stacks up against alternative approaches such as Convolutional Neural Networks (CNN). How much does the accuracy of AUs e...
I tried to find out how to arrange the complement of diagonal language, but I failed. So I'm about to believe that it's not a countable language. Could you, please, help me?
I have a weighted, undirected, Euclidean complete graph $G$, a special vertex $r$, and an upper bound $b$. I want to find a minimum-cost path cover that covers all vertices of $G$, subject to the restriction that every path must have length at most $b$ and every path must start at the vertex $r$. In other words, I wa...
If there is a deadlock between the processes does that mean that there is starvation also? My Thinking: deadlock is no process using that resources , but starvation is like not giving chance to only that process so there is progress in starvation but not in deadlock Is my thinking right?
I first saw this question on this website where I was trying on Java puzzles. Here is the Question:- You are given in an ArrayList, 1 to N Numbers. For Example, 1,2,3,4,5. However, one of the numbers is repeated twice. That is, in the form 1,2,3,4,2,5. Find the duplicate number without using loops. I thought that thi...
I'm trying to do some non-linear predictions and am going to use a random forest with Sk-learn. However my question has to do with data pre-processing. I'm planning on using minmaxscaler to normalize the temperature, wind, and humidity data...however I have two other variables class, and month. Class is a category data...
I am studying formal languages and production bases systems (rule-bases systems) and I am a little confused about why do these two word "production" and "rule" mean the same thing in so many context in Computer Science. In English Language they do not seem to mean the same thing. I am not a native English speaker but I...
The question that was in my lecture notes said "Encode the decimal number 2370 in ASCII. " and the answer given there is 32 33 37 30 (ASCII code representation) My question is how do we get this? Do we simply add 30 to each digit? I am sorry if this is a very obvious question I do not know the correct way...
Let's say you have list of $n$ vectors with entries from $\{0,1,x\}$ and $x$ is > $n$: $$ \begin{align*} L_0 &= [1,0,x] \\ L_1 &= [1,1,1] \\ L_2 &= [1,0,0] \\ L_3 &= [x,1,0] \\ L_4 &= [1,x,0] \end{align*} $$ I want to find all combinations of $m$ vectors (subsets of vectors from this list) whose elementwise sum in this...
Or: Do we need Rupert in order to get presents at all? Routing issues aside, Santa faces the following problem (many, many times over): Given a bag with capacity¹ $C$ and a set of presents $\{p_1, \dots, p_n\}$, each with size $s_i$, he wants to make children $\{c_1, \dots, c_k\}$ happy. He knows from all the wish lis...
For example for the sw command in MIPs, the control signal values are ALUOp1: 0 ALUOp: 0 RegWrite: 0 MemRead: x MemWrite: 1 Branch: 0 ALUsrc: 1 RegDest: x MemToReg: x Why do memRead, RegDest and MemToReg have the values of x? Why not just 0?
I just have taken an algorithm class exam and there was a T/F problem 'one can show that a problem A is in NPH by giving a polynomial reduction from A to a NPH problem B'. I know the direction of reduction is silly, but no counter examples come to mind right now...
let S and Q to be initialized to 1 process p0: process p1: wait(S); wait(Q); wait(Q); wait(S); .. .. .. .. Signal(S); Signal(Q); Signal(Q); Signal(S); I know there is a deadlock , where both the process will be going into th...
In here it was clarified that $\cap_{f(n)\in\omega(1)}\mathcal C(n^{f(n)})\subsetneq\cap_{\epsilon>0}\mathcal C(n^{n^\epsilon})$ where $\mathcal C(t(n))$ is the class of problems solvable in $O(t(n))$ time. My query now is whether there is a function of $g(n,\epsilon)$ that non-trivially depends on $\epsilon$ with $g(...
How to modify Dijkstra's algorithm, for wheel chair users, to take into account the road quality? There are three levels of quality: $1$ for pure concrete, $2$ for partly concrete and $3$ for rough road. Taking this into account, if there are roads $p1$: the short distance with road quality $3$ and $p2$: the long dista...
Is the language $\{ w \in \{ a, b \}^{*} : |w|_{a} + |w|_{b} = 2^{n} \}$ context sensitive ?