instruction
stringlengths
35
29.1k
I have an excerpt from my textbook concerning direct mapped cache that I would like further clarification on, the text reads..... "Consider the following example: Assume memory consists of 2^14 words, cache has 16 blocks, and each block has 8 words. From this we determine that memory has 2^14/2^13 = 2^11 blocks. We k...
Given $n$ sets $r_1, r_2, \cdots, r_n$ and a number $\delta$ where $0 \le \delta \le 1$. Let $T=\cup_{i=1}^{n}r_i=\{t_1,t_2,\cdots,t_m\}$. Each $t$ has a value $v(t)$, which is given to us. The task is to find a subset $S$ of $T$ that minimize the total value $\sum_{t\in S}v(t)$ while guaranteeing $\sum_{i=1}^{n}\frac...
The steps to show something is NP-complete is to show it is a member of NP, and then show an NP-complete problem reduces to it in polynomial-time. Why is the first step necessary? Is it possible to reduce an NP-hard problem to an NP-complete problem in polynomial time? Because that would be the only instance in which t...
I am working on proving something by using Lambda Calculus and Beta Reductions, and I was following along a tutorial on another problem and attempted to carry over the knowledge onto a different problem and I am a little confused on the last step. The problem is to prove $\textbf{or true false}$. Here are my steps: (if...
So right off the bat, this is in fact a homework question. I've been banging my head on this problem for hours. From my naive understanding of inversions, I feel that this is not possible. Considering for $n=1$ elements, there are no inversions, it already seems like this won't work, but maybe it's just for $n > 1$, so...
A naive approach to checking if $n$ is prime is: Prime(n): for i=2, 3, ..., sqrt(n): if i divides n then return "composite" return "prime!" I remember something about how measuring the complexity of this algorithm must be done in terms of the number of bits in $n$. In that case, I think that we also ca...
I understand that the Backus-Naur Form is utilized to assess and specify type 2 grammar, but is it in itself a form of type 2 grammar?
optimal lifted alignment - is a dynamic programming algorithm. Its input is a tree $T$ with $k$ strings assigned to its leaf nodes (their length is $n$). The algorithm then assigns strings to the internal nodes s.t. the sum of distance (global alignment distance) on all the edges would be minimal, under the constraint...
Let we have oracle machine. Oracle get boolean formula and answer OK if this formula is feasible. How to explain that we can find satisfying assignment for any formula for polynomial time. I have аn idea, but I'm not sure it is right. Let we have formula $~f: \{0, 1\}^n \to \{0, 1\}$ with $n$ parameter and oracle $\The...
I do not understand the difference between page table and inverted page table. I know that both are used to translate the logical addresses into physical addresses produced by the processes necessary to store data in memory. This is what I know on the page table. Generally each page table contains an element for each v...
Following what is stated in the question Why is greedy algorithm not finding maximum independent set of a graph?, I have the following question: Even enumerating and testing all possible choices of the greedy algorithm (namely, when there are two possible choices, test both) and verifying which returns the highest valu...
What is a good metric to pick the degree of a B-Tree? I assume this depends on the number of expected elements? Degree 2 gives us a 2-3-4 tree (each node contains 1-3 items and 2-4 children). How can I decide this? I am looking to store a couple of thousand keys in it.
I know that a language that is input into a DFA (call it $X$) is regular just by being accepted by it, but given that it is accepted, how can one figure out that $L = Σ^*$? In other words, what does a DFA that accepts anything from $Σ^*$ even look like? When I learnt about DFAs, it was always under the context that $L(...
Let's start with a problem statement: given an array of length $n$ with numbers $1$ through $n$ (inclusive), consider the following steps: Select a random number $k$ in range $[1, n]$. Set $a[k] = q$. If there exists element $p$ in $a$ such that $p \ne q$, go to step 1, otherwise end. So, basically we are going to ...
I've been struggling to find the grammar to generate the language $$L = \{a^{2n}b^n : n \text{ is natural}\} \cup \{a^mb^{2m} : m \text{ is natural}\}.$$ I've considered $$S \to aS|Sb|ab,$$ which works in some cases, but not all (we can derive $a^{k}b$ for example). What considerations am I not taking into account? Th...
Would saying "Call the printf function" be the same as "Call the printf method"?
Show that NP is closed under concatenation. This is a homework problem and I would appreciate some guidance. I began by saying the following: Let $A$ and $B$ exist in NP. Let $V_1$ and $V_2$ be verifiers for $A$ and $B$, respectively. Is it as simple as saying build two NTMs $M_1$ and $M_2$ that decide $A$ and $B$ ...
How do I go about proving this? Prove that every undirected connected graph with $|V | > 2$ has at least two vertices such that if one or both are removed (along with their incident edges) the resulting graph is still connected, and describe an efficient algorithm to find two such vertices.
Let $L$ be the language $\{\langle M \rangle : M\text{ is a DFA that accepts only odd-length strings}\}$. Prove that $L$ is decidable. How wrong is my answer? Create a TM $T$ that decides $L$: Create an equivalent input string $v$ that is in the language $L(M)$. Give encoding to $T = \langle M, v \rangle$. TM $T$ ...
This question is both general in nature and also specific to computer vision. If this is the wrong forum, apologies in advance and suggestions on where to post would be much appreciated. After a certain point, do the benefits of more data plateau for machine learning algorithms? For instance, let's say the goal is obje...
I had this question on a previous homework assignment and was unable to answer it. I've done some research and am not really able to find anything that clears this up for me. Would appreciate any help or explanation. Q2. Consider a direct-mapping cache of 128 lines and a main memory block size of 8 bytes. What cache li...
In order to prove that the following language is regular, would I use a pumping lemma? The set $A$ of all strings that are substrings of some string in $L$, where $L \subseteq\Sigma^*$. $L$ Must be regular.
Consider a binary classification problem. In the Pittsburg approach each member of the population represents a set of rules. Each rule encodes information regarding the data features (that is, the conditions of the if rule) and information about the class (that is, the conclusion or then part in the if rule). Then in p...
Bar codes act just like any other device that contains data that you can read from. Can bar codes thus be considered a type of computer memory? I believe the principle is quite similar to the optical discs like CDs or DVDs. They work just like an SD memory card but instead of a card reader we use barcode scanner to rea...
How does one pick an optimal block size for a cache with a specific size limit? For example, if I have a size limit of 900 bits for the whole cache, including tags and validity bits and everything, how do I choose the best block size to maximize utilized space? I assume it's different for directly-mapped caches vs. set...
Automata Theory is a subject where we mathematically model a computing device and study the theory behind it. Here we group the computing devices based on the number of languages they can accept. Based on that we say : Finite Automata's Power < Push Down Automata's Power < Linear Bounded Automata's Power < Turing Machi...
I have a queue with 50 ints in it, and I have 3 threads that want to race at the queue to print the values in it, with a 2 second delay before trying to get the next int. The queue is not thread safe, and the semaphore protecting is is decoupled from the number of items inside the queue(the number of items in the queue...
I agree that a Turing Machine can do "all possible mathematical problems". But that is because it is just a machine representation of an algorithm: first do this, then do that, finally output that. I mean anything that is solvable can be represented by an algorithm (because that is precisely the definition of 'solvabl...
Given $m$ shortest paths between any two vertices of a graph. Determining whether we can pick $k$ shortest paths such that their union covers all edges. I am trying to reduce set cover problem to it. For a set cover problem we can convert its elements into edges and the set represent a path from the first element to th...
Given a set of $n$ distinct numbers, we would like to determine the smallest $3$ numbers in this set using comparisons. The elements can be determined using $n+O(\log n)$ comparisons. This was the answer given in a multiple choice question. Now, we can easily do this using $3n\in O(n)$ comparisons. However I have been...
I was reading this that details a polynomial reduction from $SAT$ to $3SAT$. In case $k = 1$ or $k = 2$, why don't we just replace those clauses with $C_i' = \{{z_1, y_{i, 1}, y_{i, 2}}\}$ and $C_i' = \{{z_1, z_2, y_{i, 1}}\}$ respectively? Instead, it suggested to replace them by $C_i' = \{(z_1, y_{i, 1}, y_{i, 2}), ...
I observed that with rewrite rules: $abb \rightarrow bab $ $baa \rightarrow aba $ Every derivation ends, moreover, if there is same amount of $a$'s and $b$'s in input, then derivation ends in $(ab)^*+(ba)^*$. Why do these two properties hold?
When reasoning with NP-completeness, I find SAT and k-clique more convenient to reason with than generalized games that are NP-complete or the Turing machine model. I'm looking for something similar for EXPTIME-completeness. Wikipedia mentions: Another set of important EXPTIME-complete problems relates to succinct c...
I read about Multiversion Concurrency Control in Wikipedia. They say that every piece of data in DB has a Read Time Stamp (RTS) and If transaction Ti wants to Write to object P, and there is also another transaction Tk happening to the same object, the Read Timestamp RTS(Ti) must precede the Read Timestamp RTS(Tk), i....
I have a directed graph, eg: $$A\to B\to C$$ $A$ and $C$ may have multiple in- and out-edges, but B has exactly one in- and one out-edge. I want to remove node $B$ and replace the edges $(A,B)$ and $(B,C)$ with a single edge $(A,C)$. Is there a name for this operation? In particular a name or algorithm for finding all...
This question might sound stupid but, can the language of a TM be not recursively enumerable ? Thank you ~
I need to determine whether the following problem $X$ is in coNP: Given a graph $ G=(V,E) $ and a positive integer $s\leq|V| $, is there an independent set that is the largest for $G$ of size at least $s$? My solution for this was that in fact the above problem is in coNP because we can provide an NP solution for $\o...
How can the EQP quantum complexity class exist? I mean, doesn't the superposition principle imply it is not possible to know with probability 1 whether a quantum algorithm will return a solution? For if a quantum computer’s state is in superposition, quantum measurement implies the state we obtain when we read the comp...
I was just thinking about image processing neural networks and how to effectively train them in regard of the available dataset. Let's say you'd want to build a neural network which can distinguish between pictures showing a cat or a dog. I do not have much experience in the field, but I think it would take a pretty bi...
Suppose there are two functions: $ f : X \rightarrow Y $ and $g : Y \rightarrow Z$ Both $g$ and $f$ can be implemented as algorithms that yield the correct result in a finite amount of time. It appears to be obvious, that there is also a correct and terminating algorithm that computes the composition of the two $g \ci...
The linear programming problem: find a strongly-polynomial time algorithm which for given matrix A ∈ Rm×n and b ∈ Rm decides whether there exists x ∈ Rn with Ax ≥ b. I know that Steve Smale's lists some of the unsolved problems in mathematics. But such a linear programming problem is it until now not-solvable ?
I am trying to either solve or find a tight bound $\Theta$ for the following recurrence relation: $$T(n) = x + T(n-\log_2 n)\,.$$ For some nonzero constant $x$ (we can suppose it to be 1, for simplicity). Thus far, I have been able to prove the following: \begin{align*} T(n) &\in O(n)\\ T(n) &\notin \Omega(n)\\ T(n) &\...
Suppose you have data of the form input a matrix A, and output a matrix B, where each row of each is one datapoint. Should you create multiple neural networks, one for each column of B, or one NN with multiple output neurons, one for each column of B?
I am breaking my head over this. Let the alphabet $A$ be given by $A = \{a,b,c\}$ and let $$L = \{ww^R \mid w \in A^* \}.$$ Prove that the language $L$ is not regular without using the pumping lemma, but using: The fact that $\{a^nb^n \in A^* \mid n \geq 0 \}$ is not regular. The fact that $\{w \in A^* \mid w \text{...
This question is about the correctness proof of Dijkstra's algorithm in the third edition of Introduction to Algorithms by Cormen et al. (pages 660–661). The proof makes a case that considering path $p$ is the shortest path that connects a vertex in set $S$ (set of vertices where the distance of nodes to node $s$, the ...
I know the grammar for the language $\{ xy : |x| = |y|, x ≠ y \}$ if $\Sigma=\{a,b\}$: $$ \begin{align*} &S→AB∣BA \\ &A→a∣aAa∣aAb∣bAa∣bAb \\ &B→b∣aBa∣aBb∣bBa∣bBb \end{align*} $$ I know this is a grammar, but I need a PDA for this language, and intuition how $\{xy: |x|=|y|,x \neq y\}$ is a CFL while $\{xy: |x|=|y|,x...
Assume we have two LTSs, say DFA with labels over the transitions (though the question can be generalized to more sophisticated automatons), define the input to each system to be as usual just the input word, and define the output of each system to be the sequence of labels of visited transitions. Now assume that the t...
So I've got a bit of category theory under my belt, and I am reading a few papers about calculating functional programs. I've expressed programs like summing a list as a catamorphism, and I've fused some catamorphisms, too. I thought it might be interesting to see how far I could take what I now know about catamorphi...
The problem is as follows. Background: Given an alphabet $\varSigma$. If $u,v,w,x \in \varSigma^*$ and $w=uxv$ then $x$ is a factor (substring or infix) of $w$. A language $L$ is factor-free if, for all distinct words $x, y \in \varSigma^*$, $x \in L$ and $y \in L$ imply that $x$ and $y$ are not factors of each other. ...
QUESTION does CPU time reflect Big O time complexity? WHAT I MADE I implemented two Fibonacci functions in C programming language. The former has recursive behaviour while the latter has iterative behaviour. I found out that the worst case scenario for the recursive version is exponential time (i.e. $2^n$) and linear t...
(Decidable or not?) Formulate the following problem as a language: Given a Turing machine $M$ and a string $w$, determine whether $M$ visits each of its states exactly once during the computation with input string $w$. Prove your answer. So the problem above is what I am trying to solve. I am looking for a general...
I have a question about contingent sentences. To my knowledge, contingent sentences are sentences that are neither tautologies nor contradictions. In a textbook I read that a sentence might always be true and still be contingent. The example given was as follows: If there never were a time when the universe contained f...
I have to prove the NP-completeness of the following set: QUADRUPLE-SAT:={F is Formula in CNF|F has at least 4 satisfying interpretations} My idea so far has been to reduce the problem to the normal SAT by constructing a new formula, copying the original formula 4 times and using a new set of literals in every copy, th...
I know there is a polynomial time algorithm for 2-coloring. But should the answer be "No" or should it be "Maybe"? Since 2-coloring is in NP and we dont know if there is a reduction of any NP-complete to 2-color.
I am currently learning about NP-complete problems and I want to make sure my understanding is correct. Here is a problem I am working on currently: The exact distance problem is, given an edge-weighted graph $G = (V,E)$, vertices $v_1,v_k$, and a distance $D$, is there a simple path from $v_1$ to $v_k$ with length ex...
I was reading the book lambda calculi , encountered an equality theory called "the rule of weak extensionality", which is shown as follows. $\frac{M \, = \, N}{\lambda x.M \, = \, \lambda x.N}$ Yes, it is obviously true. But why it is called the rule of weak extensionality? what is weak? what is extensionality here ...
Zero and one are defined by the successor function. $$ \begin{align*} &0 ≡ λsz.z \\ &1 ≡ λsz.s(z) \end{align*} $$ But why? $λsz.z$ is irreducible to a value. If I call this function on some value, I get back $z$, which is merely a variable in itself. If I call the function on two values, I get back the second value, wh...
will an OS which favors I/O bound processes over CPU-Bound processes, experience less average waiting time? If yes, why?
The underlying question: What does lambda calculus do for us that we can't do with the basic function properties and notation generally learned in middle school algebra? First of all, what does abstract mean in the context of lambda calculus? My understanding of the word abstract is something that is divorced from the...
From our computational complexity, there's a question asking to prove 3CLIQUE is decidable. The definition of 3CLIQUE is: $$\{(V,E) : G = (V,E)\text{ is an undirected graph that contains a clique of size 3}\}.$$ I know this is an NP problem, and NP is a set of problems that easy to verify but hard to solve, but I don't...
I have to take input in an array(no. of elements in array <=10^5). For ex:- Let the array be {2,3,4,16,9,45,81,27} Now I need to find the order of the maximal set such that any pair of elements in the set have gcd > 1. In the example:- {3,9,45,27,81} is such a set.It's order is=5, hence 5 is my ans. Note that {2,4,16} ...
As I understand, the concept 'computation' started dependent on hardware (like looms for instance). The Hardware defines (physical cascades) what happens between input and output. I think I saw in a CS class, a mention about universal calculation where software is not limited by hardware? It's hard to find a succint...
There is a set of all possible letters: $A = \{ a, b, \ldots, z \}.$ Then the set of all possible 3-grams looks like that: $A^3 = A \times A \times A = $ $\{$ $\;\;(a, a, a), $ $\;\;(a, a, b), $ $\;\;(a, a, c), $ $\;\;\;\; \ldots, $ $\;\;(a, a, z), $ $\;\;(b, a, a), $ $\;\;\;\; \ldots, $ $\;\;(z, z, y), $ $\;\;(z, z, z...
There are $N$ boxes and every box has some weight(non-zero). We start from $Box$ $1$ and move towards the $Box$ $N$ one by one. Now there are 2 option ,either to lift that box or leave it. We want to lift the maximum number of boxes possible. But there is a condition that must be fulfilled for the lifted boxes. For ev...
Consider the language $$ L = \{0^p 1^q 0^p | p, q ≥ 0\}. $$ How to make a finite automaton for $L$? How to make a regular expression for $L$?
What are the exact assumptions behind the use of UPGMA? Can I use a non-Euclidean metric? This may result in a non-Euclidean distance matrix. What kind of bias may I encounter if I do so? References are appreciated.
Let $G$=$(V,E)$ with $V=$ {$1,2,...n$} and $E$ = {$e_1$,$e_2$,...$e_m$}. On the set of edges we have a cost function $c : E → R$, with a property like if i $\neq$ j then c($e_i$) $\neq$ c($e_j$). We also know that the graph is represtend with adjancency lists, $A(v)$,v$\in$V, and for $u$ $\in$ $A(v)$, i can find the ...
Let f be the function with one argument - positive integer n function f(n) j = 1 for i=1 to n: j = 2*j k = j while k > 0: k-- print * My approach: let n = 6 breakdown the for cycle breakdown the while cycle -> when i == 1, we print two *, when i == 2, we print four *, etc. So I've assu...
We are given $m$ arrays of $n$ elements each. For 90% of these arrays we run an $\mathcal O(n)$ algorithm and for the other 10% an $\mathcal O(n\log n)$ algorithm. What is the total time complexity? I think it is $\mathcal O(m n \log n)$ but I am not sure.
In this video clip the teacher presents a grammar $A \rightarrow A \alpha | \beta$ and after providing the parse tree explains that the regular expression for the language generated is represented as $\beta \alpha ^*$. Why isn't it $\alpha ^* \beta$ instead? Isn't the grammar left-recursive into terminal $\alpha$ and o...
Given a sparse matrix $M \in \mathbb{R}^{n \times m}$ with $n \ll m$ and $\mathsf{nnz}$ being the number of non-zero-components. What is the running time of computing $M M^T$?
Suppose we are doing a random walk on the infinite integer line and that we take $2n$ total steps. At every step of this walk, the position of the walker is an integer point on this line. For the next step of this walk, the walker moves to one of the two adjacent/neighboring integer points with equal probability (assum...
Let G = (V,E) be a connected graph and a ∈ V be an articulation point of G. How can be proved that there is an edge e ∈ G incident with a with the property that e doesn't belong to a perfect matching of G? Let's say that there are two vertices u,v ∈ G so that the only paths between them go through a. Then there is no e...
I'm trying to figure out what is the optimal order for running a sequence of tasks in a pipeline. Each task filters a percentage of the dataset. Assuming I got the tasks t1, t2, t3, ..., ti and a dataset. Each task have an execution time per item in the dataset denoted as e1, e2, e3, ..., ei and each task filters a cer...
I have a homework assignment dealing with caches. We are asked to compute the total number of bits of storage required for the cache, including tags and valid bits. Then compute the overhead for the cache incurred by the tags and valid bits. Info given: Consider a direct-mapped cache with 16KBytes of storage and a bloc...
I was reading CLRS about BFS and DFS, and the algorithms presented therein, which I take to be somewhat standard, construct a forest with DFS that includes all the nodes, whereas BFS only constructs a tree from a chosen node $s$, and leaves out all the other nodes that are not reachable from $s$. It seems BFS can be ad...
I am trying to understand the following claim: For a fixed size cache, each increase by a factor of two in associativity doubles the number of blocks per set (i.e., the number or ways) and halves the number of sets – decreases the size of the index by 1 bit and increases the size of the tag by 1 bit. I am ju...
Can anyone explain why can't we use a Turing machine's transition diagram? For e.g. The definition of a USELESSTM is as follow: A useless state in a TM is one that is never entered on any input string. USELESSTM = { ⟨ M, q⟩ ∣ q is a useless state in M } I know this problem can be proved to be undecidable by reduc...
Instance: a directed graph $G = (V, A)$ with weights $w_a\in\mathbb{R}$ on the edges and a root $v\in V$. Solution: A directed tree with root $v$. Objective: Minimize total weight. My formulation: My AMPL code: param n >= 1, integer; # number of vertices set V := 0..n-1; set E within {V,V}; param r := 0; param w{E...
This question is about whether every mathematical theorem can be reduced to the question of whether a single Turing machine halts. In particular, I'm interested in conjectures that are currently unproven. For example: Wikipedia says that it's currently unknown whether there are any odd perfect numbers. Since it's decid...
I'm interested in compression algorithms where the compression ratio increases as the amount of data to be compressed increases. Let's call this "super compression". Could super compression be achieved through recursive compression algorithms? Here's the kind of algorithm I'm contemplating. The binary file is first s...
I have a very basic question. Can we have a PDA which can accept a string by both final states and empty stack? Can the same PDA accept by the two modes simultaneously ? If there are final states for acceptance and in addition to that at some point in time the input string is read completely and simultaneously the s...
I have the following code: n - number of 1-d points (real numbers) numbers[n] - array of numbers n list, se_list - list variables to store cluster starting points _____________ sort(numbers) find_cluster(start, end, ci): \\ ci - cluster index best_se = +infinity \\ best squared eror list = {start} for i from s...
i have the following CFG E -> ABC A-> a|Cb|epsilon B-> c|xA|epsilon C-> y|z and the First of the Non-Terminal : First(E) = {a,y,z,epsilon} Frist(A) = { a,y,z,epsilon} First(B) = { c,x,epsilon } First(C) = {y,z} the follow of Non-Terminal : follow(E)={$} follow(A)={c,x,y,z} follow(B)={y,z} follow(C)={b,$} my problem ...
While doing some digging around in the GNU implementation of the C++ standard library I came across a section in bits/hashtabe.h that refers to a hash function "in the terminology of Tavori and Dreizin" (see below). I have tried without success to find information on these people, in the hopes of learning about their h...
Problem: Consider a k-SAT solver that assigns values independently uniformly at random to all the variables. Given the formula has $m$ clauses provide an upper bound for the probability of a random assignment to be unsatisfiable. The issue is that I have no clue from where to start. Both Markov, Chernoff, Chebyshev a...
I have a clue as to how this code/traversals work but I'm still confused. For example, in the first traversal (Preorder), it prints 31, 12, 25 but then it backtracks all the way to 68? How does it know to do this? My professor referenced a stack but I am still a bit confused. As for the other codes, I don't know how ...
I need to classify the set $$\{p|∃y : \operatorname{Dom}(φ p ) ⊇ \operatorname{Dom}(φ y )\}$$ as decidable, semidecidable or not semidecidable. I don't know how to start. Any ideas? Dom (φp) it's all the inputs that are accepted by a turing machine "p", and the same for Dom (φy). So if My(some input) accepts then Mp(s...
(Note: I couldn't put "balanced tree" in the tags ; this topic isn't about balanced search trees, just balanced trees.) Let $A$ a binary tree. We have the relation: $log(|A|+1) \leq h(A) \leq |A|-1$ where $|A|$ denotes the size of A (the number of nodes) and $h(A)$ its height. Then I was told that A is balanced if $h(A...
I read that the following language is decidable. $\{w | w \in \{0, 1\}^* \text{ and } 1^{|w|} \text{ is a substring in binary expansion of } \pi \}$ The proof has been given by considering the two possible cases Suppose it is true that there exists a minimal integer $N$ such that the binary expansion of $\pi$ only con...
I found that sorting algorithms such as Insertion Sort and Djikstra's Smoothsort approach O(n) complexity when the list is nearly sorted. What are some real world scenarios where a list is nearly sorted?
Need to prove equivalence for (or disprove equivalence for): $ \hspace{1cm}\square ϕ → \lozenge ψ ≡ ϕ\textsf{ U }(ψ ∨ ¬ϕ) \\ $ My current attempt using the LTL equivalnce rules to determine equivalence: $ \square ϕ → \lozenge ψ \\ ≡\ ¬\square ϕ \lor \lozenge ψ \hspace{1cm}(\textsf{"Mutual implication"} ϕ →ψ≡¬ϕ\lor ψ )\...
Would be possible to encode dependent types as regular expressions? if so, ¿is there some work about? It's common to represent restrictions for elements in a traversable data structure with them, like clojure.spec do for sequences. But i tried to find some references about using them to represent restrictions at type l...
Apologies if a duplicate. New to this community and did try to search. I want to create a mapping document that equates defect severity levels together so it looks like || System 1 || System 2 || System 3 || | level1-1 | level1-2 | level1-3 | | level2-1 | level2-2 | level2-3 | So that I can effectively do a loo...
How words can instruct hardware to do an operations . I understand that these are converted to 0s and 1s . But still I can't intuitively understand How it works . A detailed explanation would be appreciated .
Bob has $2$ cranes and $M$ available containers ($1 \leq C_i \leq M$) and he has to do $N$ transports from one container to another given an input list (the order of the transports must be respected). To execute a transport from container $C_i$ to $C_j,$ Bob must choose a crane and move it to $C_i$, pick up the suppli...
Consider the following algorithm for the maximum matching problem: Sort all nodes by their $\deg(v)$ Take the node with minimal $\deg(v)$ Take a random edge $(u,v)$ $\in$ $E$ Add $(u,v)$ to $M$ Delete all edges of $u$ and $v$ in $E$ I have to show that the algorithm isn't correct for undirected graphs with maximum de...
Say I have the following memory scheme: Data bus: 8 bit Main Memory Store: 256 Byte Cache Store : 32 Byte Block Size : 4 Byte How would I go about listing the assigned bits for tag,offset and block number for location 12? I think the right answer is 12 is binary is 00001100 since we have 8-bit representation. Then t...
Want to clarify few things. It is said that two $\lambda$-terms are equal up to renaming of bound variables, such as $\lambda x.x$ equals $\lambda y.y$, so I think it is a relation actually, about how two terms are equal. Is that (such equality up to renaming) is same as equivalence relation? To show a relation is an e...
I am trying to implement a context-free grammar for $L=\{a^n b^m \mid n \neq 2m\}$. I have a difficulty trying to implement it because I don't know how to ensure that $n \neq 2m$. I can easily implement $n=2m$ but the other way around doesn't seem intuitive. How can I approach this problem?