instruction
stringlengths
0
29.8k
⌀
null
Let $E$ be the set of your edges, and let $V$ be the set of all the edge's endpoints. Consider the graph $G=(V,E)$. You're asking for a [Directed Eulerian trail of $G$][1]. [One possible way][2] to so so, is the following: assume that each vertex has the same in- and out-degree (more on how this assumption can be ...
null
I am trying to understand which combinatorial problem best fits the one I have. I am mostly asking from the perspective of being pointed towards relevant literature. I will explain the problem with an example. Consider the set $S = \lbrace{a^1, a^2, a^3, b^1, b^2, b^3, b^4, c^1, d^1, d^2, d^3, d^4 \rbrace}$. So not...
null
null
modify this proof to show that there is no Turing machine P with the following two properties: - For all Turing machines M, if M() accepts then P(⟨M⟩) accepts, while if M() rejects then P(⟨M⟩) rejects. - P(x) halts for every input x. (In other words, if M() runs forever, then P(⟨M⟩) can either accept or reject,...
Modify Turing’s proof of the undecidability of the halting problem
|turing-machines|undecidability|halting-problem|
I have a digraph D on n vertices formed in the following manner: - I start with k ordered (not sorted) lists of integers, with each integer from 1-n in at least one list. Integers do not show up more than once in a given list. - I create a node for each integer, with an arc from node x to y if x appears before y ...
null
I am familiar with the polish notation when it comes to algorithmically reading phrases, but I am having a hard time proving the following exercise: > K is a function so that 1) $K(*)$ is an integer if $*$ is a symbol of a language, 2) if $\sigma = \sigma_1 \sigma_2 \dots \sigma_n$ is a phrase of the language, then ...
Proving that the polish notation has unique readability
|logic|proof-techniques|propositional-logic|induction|
Given a bipartite graph $G=(V,E)$ and an integer $l$, how many edge subsets ($E'\subseteq E$) of size $l$ are there such that the degree of each vertex in the resulting subgraph $G'=(V,E')$ is odd? I have not been able to come up with anything smarter than explicitly enumerating all possible subsets and checking whe...
I am trying to understand which combinatorial problem best fits the one I have. I am mostly asking from the perspective of being pointed towards relevant literature. I will explain the problem with an example. Consider the set $S = \lbrace{a^1, a^2, a^3, b^1, b^2, b^3, b^4, c^1, d^1, d^2, d^3, d^4 \rbrace}$. So not...
Given a bipartite graph $G=(V,E)$ and an integer $l$, how many edge subsets ($E'\subseteq E$) of size $l$ are there such that the degree of each vertex in the resulting subgraph $G'=(V,E')$ is odd? I have not been able to come up with anything smarter than explicitly enumerating all possible subsets and checking whe...
Depending on whether you require all vertices to have odd degree, or only those vertices with at least one edge incident on them, I have a method that can solve this in either $O(|E|^3)$ time or $O(2^{|V|} |E|^3)$ time. In the former case, this is a polynomial-time algorithm, as you requested. In the latter, this is ...
null
This sounds like it can be framed as an instance of the [assignment problem](https://en.wikipedia.org/wiki/Assignment_problem), assuming the costs are computed as a linear function of a cost for assigning each individual item to a particular order.
Modify Turing’s proof of the undecidability of the halting problem to show there is no Turing machine P with the following two properties: - For all Turing machines M, if M() accepts then P(⟨M⟩) accepts, while if M() rejects then P(⟨M⟩) rejects. - P(x) halts for every input x. (In other words, if M() runs foreve...
To prove this, Introduction to Algorithms by Cormen et al., makes the assumption that the node has two children. > For the inductive step, consider a node $x$ that has positive height and is an internal node with two children. Each child has a black-height of either $bh(x)$ or $bh(x) - 1$, depending on whether its c...
Prove that the subtree rooted at any node $x$ in a red black tree contains at least $2^{bh(x)} - 1$ internal nodes
|trees|binary-trees|red-black-trees|
First of all, despite claims by several people here, there are models of computation which support computation on topological spaces. The "countable vs. uncountable" distinction is a red herring, arising from being familiar only with notions of computation on discrete spaces. A good introductory text on the topic of co...
I'm trying to calculate the main memory size, and the only information given is the size of the cache, which is 256 KB, and the number of tag bits, which is 8. Cache is a 4-way set associative memory. I'm wondering why block size information is missing in this question, because without it, I'm not able to calculate ...
How to calculate the size of main memory if the cache is 4-way set associative memory, cache memory size is 256KB and number of tag bits is 8
|computer-architecture|cache|
Let the universe be the set $U$ and a set of subsets $S$ be such that $\cup_{s \in S} s = U$. I am interested in computing the longest sequence of sets $s_1, ..., s_k$ such that: 1. $s_i \in S$ $\forall i \in [k]$ 2. $s_i \not\subset \cup_{j=1}^{i-1} s_j$ (so each $s_i$ adds at least one new element on top of the...
Maximum set cover with non-overlap
|optimization|np-complete|reference-request|sets|set-cover|
Let the universe be the set $U$ and a set of subsets $S$ be such that $\cup_{s \in S} s = U$. I am interested in computing the longest sequence of sets $s_1, ..., s_k$ such that: 1. $s_i \in S$ $\forall i \in [k]$ 2. $s_i \not\subseteq \cup_{j=1}^{i-1} s_j$ (so each $s_i$ adds at least one new element on top of t...
My Professor for my Computer Organization class gave us a few questions about caches on an assignment. I'm completely stumped by most of them. I've watched a few videos on caches on YouTube by Intermation, read the textbook, and even asked my friend (the Professor's office hours are not today). The textbook our Profess...
I'm completely stumped by these questions for a Computer Organization assignment
|cpu-cache|
My Professor for my Computer Organization class gave us a few questions about caches on an assignment. I'm completely stumped by most of them. I've watched a few videos on caches on YouTube by Intermation, read the textbook, and even asked my friend (the Professor's office hours are not today). The textbook our Profess...
This community is not for assignment solving. Anyway, I will drop some hints that should help you get started. 1. Cold Misses: It happens when your cache does not contain any block, typically after the system is powered on. 2. Counters: These are separate structures associated with each block, that can be used to...
> I'm not able to calculate the number of blocks, number of sets, block offset, etc., which will eventually help me calculate the size of main memory. None of that is required. Your cache size is 256KB, which means it can store $\log_2(2^8.2^{10}) = 18$ bytes worth of information. You will need $\log_2 4 = 2$ of ...
> I'm not able to calculate the number of blocks, number of sets, block offset, etc., which will eventually help me calculate the size of main memory. None of that is required. Your cache size is 256KB, which means it can store sequence of $\log_2(2^8.2^{10}) = 18$ bits (assuming it is byte addressable). You will...
> I'm not able to calculate the number of blocks, number of sets, block offset, etc., which will eventually help me calculate the size of main memory. None of that is required. Your cache size is $256KB$, which means it can store sequence of $\log_2(2^8.2^{10}) = 18$ bits (assuming it is byte addressable). You wi...
I don't know whether this can be solved in polynomial time, and I don't know a faster way to get the exact count, but I can propose a way to approximate the number with close to $O^*(E^{|l|/2})$ time, which is a bit better than $O(E^{|l|})$. This is not very satisfying and not a very good answer, so I hope someone els...
In the proof for Lemma 2, the authors define two initial states to be adjacent if the only difference between them is the value in the input register $x_p$ for a single process $p$. Then, they claim that any two initial configurations can be joined by a chain of initial configurations, each adjacent to the next. How...
How to interpret the concept of adjacent initial states in the FLP impossibility paper?
|distributed-systems|
In the proof for Lemma 2, the authors define two initial states to be adjacent if the only difference between them is the value in the input register $x_p$ for a single process $p$. Then, they claim that any two initial configurations can be joined by a chain of initial configurations, each adjacent to the next. How...
null
Link: https://dl.acm.org/doi/pdf/10.1145/3149.214121 In the proof for Lemma 2, the authors define two initial states to be adjacent if the only difference between them is the value in the input register $x_p$ for a single process $p$. Then, they claim that any two initial configurations can be joined by a chain of i...
By Stirling's Approximation, $$n^n = O\left(\frac{n! \cdot e^n}{\sqrt{n}}\right)$$ $$\lim_{n \to \infty} \frac{e^n}{\sqrt{n}} = \infty$$ Meaning that $n^n$ isn't $O(n!)$, however you do have that $n!$ is $O(n^n)$.
How do you believe prominent deep learning ASIC makers such as Nvidia and Google will alter their hardware design over the next decade to meet the exponentially expanding need for extra computing to train and execute machine learning models? For example, since the beginning of the current machine learning boom, the ...
In the next ten years, what modifications to hardware architecture do you anticipate being made to enhance machine learning performance?
|machine-learning|computer-architecture|artificial-intelligence|
The options are: (a) $L \cap a^{\ast}b^{\ast}$ (b) $(L \cap a^{\ast}b^{\ast}) \cup a^{\ast}b^{\ast}$ (c) $L \cup a^{\ast}b^{\ast}$ (d) $(L \cap a^{\ast}b^{\ast}) \cup b^{\ast}a^{\ast}$ My doubt is: We don't know what exactly $L$ is, it could be $a^{n}b^{n}$ or $b^{n}a^{n}$, we for sure know that $L$ is e...
Let $L$ be the langauge over ${ a, b }$ that contains the same number of occurrences of $a$ and $b$. Which of the following languages is regular?
|regular-languages|regular-expressions|
Let $L$ the language over $\{a,b\}$ of words that contains the same number of occurrences of $a$ and $b$. Which of the following languages is regular?
Basically what i am trying to prove is this : $f(n),g(n) \neq 0\quad , n>0 \ \ \ \ and f(n)=Ω(g(n)) \ \ \ , \ then \frac{1}{f(n)}=O(\frac{1}{g(n)}) $ I guess that if we take the definition of $f(n) = Ω (g(n))$ , which means that $f(n) \ge cg(n) $ for every $ n \ge n0$ and then flip the relation so that it bec...
if f(n),g(n) =! 0 , for every n > 0 , and f(n) = Ω(g(n)) , then does this mean that 1/f(n) = O(1/g(n))
|asymptotics|correctness-proof|big-o-notation|
Basically what i am trying to prove is this : $f(n),g(n) \neq 0\quad , n>0 \ \ \ \ and f(n)=Ω(g(n)) \ \ \ , \ then \frac{1}{f(n)}=O(\frac{1}{g(n)}) $ I guess that if we take the definition of $f(n) = Ω (g(n))$ , which means that $f(n) \ge cg(n) $ for every $ n \ge n0$ and then flip the relation so that it bec...
null
null
(b) is the only correct answer and this follows directly from the well known proof, $L_1 = \{a^n b^n : n \in \mathbf{N}\}$ is not regular. You can refer to the second page of [this](https://www.utsc.utoronto.ca/~nick/cscB36/additional-notes/pumping.pdf) resource, for example. --- (a) We start of by noting that $L...
$$\forall n>n_0:f(n)\ge c\,g(n)>0\implies\frac1{f(n)}\le \frac 1c\frac1{g(n)}$$ is true. Just two remarks: $c\ne0$ must hold, and $n_0$ must be taken larger than any root of $f$ and $g$. A pathological counter-example is $$1=\Omega\left(\sin\left(\frac{n\pi}2\right)\right).$$
I have a matrix: | -- | c1 | c2 | c3 | |:--:|:--:|:--:|:--:| | r1 | AA | BB | CC | | r2 | CC | RR | BB | | r3 | EE | DD | FF | | r4 | KK | DD | EE | | r5 | DD | GG | KK | | r6 | PP | QQ | KK | Each column in a row represents a namespace. I can reorder elements of each row (i.e., `r1`): - `AA.BB.CC` - `...
Reorder columns in a 2d matrix to maximize the count of all repeated subarrays across all rows
|algorithms|combinatorics|matrices|
I have encountered at my work currently a problem where I want to find an efficient algorithm for, although I suspect this might be hard problem. Maybe you can help me to tell if this is a NP hard problem or hint me to an algorithm. When looking for similar problems, I found the hitting set problem. But my problem i...
Find a set of elements with minimal costs that contains at least one element of given subsets
|sets|
$$\forall n>n_0:f(n)\ge c\,g(n)>0\implies\frac1{f(n)}\le \frac 1c\frac1{g(n)}$$ is true. Just a remark: $n_0$ must be taken larger than any root of $f$ and $g$. A pathological counter-example is $$1=\Omega\left(\sin\left(\frac{n\pi}2\right)\right).$$
When deriving an asymptotic estimate, the unit of work is *not defined* and *need not be defined*. All that matters is that the time it takes be bounded and independent of the data size. For instance, when evaluating a sorting algorithm, we usually care about the number of comparisons and the number of data moves, w...
When deriving an asymptotic estimate, the unit of work is *not defined* and *need not be defined*. All that matters is that the time it takes be bounded and independent of the number of data elements ($n$). For instance, when evaluating a sorting algorithm, we usually care about the number of comparisons and the num...
When deriving an asymptotic estimate, the unit of work is *not defined* and *need not be defined*. All that matters is that the time it takes be bounded and independent of the number of data elements ($n$). For instance, when evaluating a sorting algorithm, we usually care about the number of comparisons and the num...
null
When deriving an asymptotic estimate, the unit of work is *not defined* and *need not be defined*. All that matters is that the time a basic operation takes be bounded and independent of the number of data elements ($n$). For instance, when evaluating a sorting algorithm, we usually care about the number of comparis...
Suppose that there is a set of strings such that for each n there is at most one string |w| = n. For any given n there is a 50:50 chance that such a string exists. These string can be arranged in a lookup table such that the binary value of the string is interpreted as an index, the table entry indicates yes/no i.e. th...
Why is this not a proof of P # NP
|complexity-theory|time-complexity|polynomial-time|
null
On page 103 of Mike Sisper's Introdution to Theory of Computation, it says that the grammar has 27 terminals (26 being the letters of the English Alphabet and 1 being the space character) but in the rules above, I don't see those 27 terminals. I only see 10 which are "a", "the", "boy", "girl", "flower", "touches", "lik...
The book says 27 terminals but I only see 10. Where are they?
|computability|automata|context-free|formal-grammars|pushdown-automata|
Let the universe be the set $U$ and a set of subsets $S$ be such that $\cup_{s \in S} s = U$. I am interested in computing the longest sequence of sets $s_1, ..., s_k$ such that: 1. $s_i \in S$ $\forall i \in [k]$ 2. $s_i \not\subseteq \cup_{j=1}^{i-1} s_j$ (so each $s_i$ adds at least one new element on top of t...
null
in the step where you have to remove the epsilons, would you need to remove something like this: A -> Bε Or would you simply remove the ones that have epsilon by itself like this: A -> ε
step 2 of CFG conversion to Chomsky's normal form
|context-free|formal-grammars|
You can check your reference, but every internal node (node with assigned key), with no internal child/children is by default has leaf node (NIL) as child/children.
null
I am writing this CFG to solve the problem: S -> ASBSC A -> aAe | ε B -> aBd | ε C -> bcC | ε Is this correct or not
CFG for the given language L = { a^l a^n b^m c^m d^n e^l | l,n,m>=0 }
|automata|context-free|
To prove this, Introduction to Algorithms by Cormen et al., makes the assumption that the node has two children. > For the inductive step, consider a node $x$ that has positive height and is an internal node with two children. Each child has a black-height of either $bh(x)$ or $bh(x) - 1$, depending on whether its c...
I am writing this CFG to solve the problem: S -> ASBSC A -> aAe | ε B -> aBd | ε C -> bcC | ε Is this correct or not
I am writing this CFG to solve the problem: S -> ASBSC A -> aAe | ε B -> aBd | ε C -> bcC | ε Is this correct or not
|regular-languages|automata|context-free|
Strings in your grammar could potentially terminate with a sequence of $bc$s because of the following, which is not desired. $S \rightarrow ASBSC$ $C \rightarrow bcC \ | \ \epsilon$ --- The correct grammar in this case would be: $S \rightarrow aAe \ | \ \epsilon$ $A \rightarrow aBd \ | \ \epsilon$ ...
Polynomial time means a runtime that is a polynomial in the length of the input. The input is an encoding of the problem instance as a sequence of symbols from some finite alphabet. A problem that is solvable in polynomial time with respect to one encoding may not be with respect to another. (Technically the encoding i...
The author defines terminals in the following way. > The string consists of variables and other symbols called terminals. When you are writing grammar for a human language, it is better to treat letters as symbols rather than words (sequence of letters) which although correct tend to be in thousands. One concern ...
I have a matrix: | -- | c1 | c2 | c3 | |:--:|:--:|:--:|:--:| | r1 | AA | BB | CC | | r2 | CC | RR | BB | | r3 | EE | DD | FF | | r4 | KK | DD | EE | | r5 | DD | GG | KK | | r6 | PP | QQ | KK | Each column in a row represents a namespace. I can reorder elements of each row (i.e., `r1`): - `AA.BB.CC` - `...