instruction
stringlengths
35
29.1k
It is a very standard construction in most complexity theory courses to turn a turing machine into a circuit. I thought this was due to Cook, but it looks like he did the reduction to SAT not through circuits and so now I am unsure. Is there a paper that originally established the well-known circuit simulation that ha...
Context In a program I am writing, the user is allowed to define user-defined functions in a file. These functions have the particularity that must be of type [T -> T] for a given type T, i.e. they are endofunctions over T. These functions are always applied over the type T so I defined an identity function which is th...
I am trying to find a Turing Machine for the above language. I am trying to do it with one tape, to start with. However, I am not quite sure about how to keep track of the number of a's in the string. Any help is appreciated.
I need to devise a data structure $S$ with the following functions: BUILD($S$) - build the data structure from a series of $n$ elements in time $O(n \lg{n})$ INSERT($S$, $k$) - insert a new element with the key $k$ to $S$ in time $O(\lg{n})$ DELETE($S$, $p$) - delete the element $p$ from $S$ in time $O(\lg{n})$ D-SUCC...
In the proof of Master theorem in Dasgupta's Algorithms the author says that the total work done at a recursion tree level is $$a^k \times O\left(\frac{n}{b^k}\right)^d$$ where $a$ is the branching factor, $k$ is the tree level, $n$ is the size of the overall problem of course, $\frac{n}{b^k}$ is the size of the subpro...
I am trying to sort square matrix of size $N$ by $\textbf{only permuting}$ rows and columns, such that row appear in increasing (left to right) while columns appear in decreasing order (top to bottom). Edit: all elements are distinct positive integers. My approach was to find smallest and put it at $A_{11}$, then secon...
I was watching a video on Reinforcement Learning by Andrew Ng, and at about minute 23 of the video he mentions that we can represent the Bellman equation as a linear system of equations. I am talking about the Hamilton-Jacobi-Bellman equation, used for discrete control problems or discrete reinforcement learning proble...
Let $L_1 \in REG$ and $L_2 \notin REG$ prove or disprove: $\forall L_1 ,L_2 \text{ } $ $\text{ }L_1^C \cup L_2\in REG \lor L_2\setminus L_1\in REG$ I think that it may be disproved, but I found it very hard to disprove, because: if $L_2 \subseteq L_1$ then $L_2\setminus L_1 = \emptyset$ and if $L_1 \subseteq L_2$ th...
We define theta notation as follows: $\Theta(g(n))$ = {f(n): there are exist $c_1, c_2$ > 0 and $n_0$ such that 0 $\leq$ $c_1$g(n) $\leq$ f(n) $\leq$ $c_2$g(n) for all n > $n_0$}. I found an illustration of this statement on Wikipedia, but I cannot figure out what exactly point $n_0$ means. How should we choose $n_0$ i...
I would like to sample $n$ integers (of some fixed length, say $k$ bits) uniformly at random, and have them partitioned into two sets of equal sum. Since finding such a perfect partition (even if it exists) is NP-hard, I would like to sample them in advance such that they are partitioned into two sets of equal sum. A n...
I don't understand the $T(2n / 3)$ part in the recurrence relation for MAX-HEAPIFY in the book CLRS. There is another post that explains it but I can't realize it.
I have a job shop scheduling problem with the following characteristics. How would I write that in alpha|beta|gamma notation (see 1,2)? I know some of the parts, but not all. I add my suggestions in code blocks. alpha: Job shop J number of machines is part of the input m beta: batch processing b with job compatibili...
When hashing a (key, value) pair where the key is a string, I have seen the following hash function in use: E.g. $c_n + 256c_{n-1}+ 256^2c_{n-2}+...256^{n-1}c_1$, where this represents the string $c_1c_2..c_n$. I understand the equation above can be written as: $c_n + 256(c_{n-1} + 256(c_{n-2}+...256c_1))$, could someo...
What concepts or technologies can help me with the following problem? You have a finite inventory of resources and a list of recipes to convert a set of resources into another resource (IE "crafting" in a video game). Given that data I would like to compute an optimal path to a goal of a set of resources. For example, ...
Let's say that I am interested in discovering the smallest 5 numbers in a set of numbers. In SQL, this would work: select number from ( select number, row_number() over(order by number asc) as order_ from my_table ) ranking where order_ <= 5; Alternatively, I could use the Quickselect algorithm (in my...
Let $\mathcal{P},\mathcal{Q}$ denote two convex polyhedra in $\mathbb{R}^d$, which can be represented by a set of linear inequalities. Let $A \subset \mathbb{R}^d$ be a finite set of vectors. The problem is to determine whether there is a sum of vectors, where each term in the sum is an element of $A$, so that the sum...
I'm looking for a data structure to perform nearest-neighbor searches in 3D Euclidean space. I have used kd- and balltrees for this purpose before, but my problem is more sophisticated this time. I'd like to be able to insert and delete points from my dataset dynamically. I don't see any reason why either of these two ...
I have a doubt about HDD and SSD addressing. Could someone explain me what is the minimum addressable unity for HDD and SSD? In the case of RAM, we can address the single byte. But I presume that HDD and SSD have a a different behavior. Thank you
I currently have a long timestamp measured in units of 100ns elapsed since January 1st, 1900. I need to convert it to milliseconds. I have the choice of either multiplying by 0.0001 or dividing by 10_000. Although at first glance they sound the same, the former would actually cause an implicit cast to a double - the la...
The concept of precedence and associativity seems straightforward. The operator precedence is a collection of rules that reflect conventions about which procedures to perform first in order to evaluate a given mathematical expression. The associativity of an operator is a property that determines how operators of th...
Recently, I encountered the following problem: Given an array $A$ of length $n$ $(0\le n\le 2^{17})$. Let $f(l, r, x)$ denotes the number of occurrences of $x$ in the subarray $a[l\ldots r]$. Find the number of pairs $(i, j)$ such that $i<j$ and $f(1, i, a[i]) > f(j, n, a[j])$. My idea is to mimic the divide and conq...
Given a Binary Search Tree(BST) I would like to understand can absolute minimum difference between any two nodes of a BST is always between adjacent nodes. If Yes or No can we generalize it ? Assume there are atleast two nodes. Here is my approach Case 1 : Assume only positive real numbers Assume the absolute differenc...
I read the following post. Now i encountered this question, what is codeword length of a character with frequency more than $\frac{2}{5}$ huffman coding? I think it can 2bit or 1bit, but i can't prove it. Any help for proving that appreciated.
There is a permutation (more precisely a derangement) $\sigma$ of the set $\{0,1,\dots,n-1\}$ with cardinality $n$. I want to compute the following counts (a kind of inversion): $$K(\sigma )_{i}=\#\{j>i:\sigma _{j}>i\}$$ for each $0 \le i \lt n$. Obviously a $O(n^2)$ straight-forward algorithm computes these counts. Bu...
Say you are given a matrix $M (A \cdot B)$ when $A$ is the number of rows and $B$ is the number of columns. Now we are free to pick one element from each column. Lets say these elements are $E = \{ e_1,e_2,e_3,\dots,e_b \}$ and $f(E) = \max(E) - \min(E)$. Find the minimum value of $f(E)$. I tried multiple but I can't ...
Following the issue from Faster algorithm for a specific inversion: We have a permutation (a derangement actually) $\sigma$ of the set $\{0,1,\dots,n-1\}$ with cardinality $n$. I want to compute certain counts (a kind of inversion): $$K'(\sigma )_{i}=\#\{j<i:\sigma _{j}>i\}$$ for each $0 \le i \lt n$. With the restrict...
There is a big 1024-bits number A that was obtained by multiplying two numbers B and C.Are there any ways to get first numerical digits of these numbers? How example: A(4.65467...e+1024) = B(2.25351...e+512) x C(2.62568...e+256) I want to receive 2.25 and 2.62 accordingly.
I'm trying to come up with a list of rules that return an equivalent instance to the following problem, while eliminating all vertices of degree 2 or less from the graph: Given a graph $G=(V,E)$, the goal is to know if there's a set $S\subseteq V$ of size at most $k$ such that $G-S$ is an Almost Forest. An almost for...
For reference, I am trying to solve this CSES Problem. The problem basically states that given up to $10^5$ positive integers in the range $[1, 10^6]$, find the number of pairs of those positive integers that are coprime. After some thought, I've come up with the following 3 ideas that I think may be on the right track...
CFDG is described as a language for context free grammars which can generate images. It allows rules to have parameters, but places restrictions on them to ensure the grammar is context free rather than an indexed grammar. In what sense can a CFDG grammar be interpreted as a context-free grammar, and how would this fai...
I am confused between $n^3\log n$ and $n^3$. Normally $n\log n$ is better than $n^3$ but what's about $n^3\log n$
Let's for the sake of simplicity only focus on tuple relational calculus. Every relational algebra query can be broken down into the 5 atomic operations - projection, selection, set union, set difference, cartesian product (I'm excluding renaming as it is not possible to do in relational calculus). Let $P(x)$ be an arb...
I'm read Randomized Algorithms book by Motwani, the part about Yao's min-max technique: Consider a problem where the number of distinct inputs of a fixed size is finite, as is the number of distinct (deterministic, terminating, and always correct) algorithms for solving that problem. Let $\Pi$ be a problem with a fi...
The following is the statement of the problem: There are 40 packets to be delivered in a day. Each packet needs to be delivered to a particular location. Apart from this, there are constraints also that some packets need to be delivered before a certain time. And some packets need to be delivered together There are t...
For $L_S=\{\langle M\rangle : L(M)\in S \}$ what is known about $S$ in case of: $L_S\in RE$ $L_S\in R$
About Random Access Memory (SRAM and DRAM), if multiple read or write operation take place, many books calculate the average access time of those operations. Given the definition of access time, I think that it is wrong to talk about access time. If multiple operation take place, I think that would be better to talk ab...
It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order. Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits. I took this to mean find the smallest x for which 2x, 3x, 4x, 5x, and 6x are all doubles, that ...
Savitch provided an algorithm which places NL in L^2 and hence the runtime of the algorithm is bound by $2^{O(\log^2n)}$. The runtime of the algorithm is not in P as NL is not known to be in SC. Is there a runtime analysis of the algorithm anywhere which provides worst and average case behavior of the time complexity?
I have a very simple question and wanted to check whether my answer is correct. Suppose we are given a list of comparisons $x_1>x_2,..,x_k>x_i$ then consider the decision problem asks whether the ordering $>$ can be made transitive and complete over all the X. My impression is that such a decision problem is NP-complet...
Given directed graph $G=(V,E,\omega,s,t)$ that $\omega:E\to \mathbb{R}$ is the weight function on $E$, and we want to find shortest path from $s$ to $t$. First, we run the Bellman-Ford algorithm to finding the shortest path from $s$ to $t$, but after the termination of the algorithm, I know that if the distance of a ...
Greetings all and thank you. I'm a Ph.D. candidate working on a force structure's 3D tessellation project and get stuck. I've simplified the system into a set of lines linked together which formed a Line-Framework (points connectivity list). Now I want to get the tessellation of this Line-Framework in a set of minimal ...
I need to prove\disprove that if $L_1, L_2\in RE$ then $L_1-\ L_2, L_1 - \bar{L_2}\in RE$. Trying to prove those statements I thought about using the turing machines $M_1, M_2$ of $L_1, L_2$ respectively, but I can't simulate input on $M_1$ and $M_2$ since they might run forever. How can I prove (or disprove) those two...
I'm trying the following question from my homework: We're given a graph $G$ and parameters $k,\hat{P}, \hat{W}\in \mathbb{N}$. Additionally, each $v \in V(G)$ has a profit and weight: $p_v, w_v\in \mathbb{N}$. Suppose you're given an $f(k) \cdot n^{O(1)}$-time algorithm $\mathcal{A}$ which finds whether there is a vert...
We know that Extended Church-Turing Thesis (or Cobham's thesis) states that any 'reasonable' model of computation can be equivalent to Turing Machine model in at most polynomial time overhead. People always believe that this ECTT is not true and a candidate counterexample is quantum computation. But, why they don't see...
Just did a test about the subject that had the following question: I know it seems trivial and my first reaction was "well of course its true" but the epslilon kinda threw me off. $L_2$={ab,$\epsilon$} $L_1$={a} , is there a computable reduction from $L_1\leq L_2$ ,: True Or False I assumed by contradiction that its tr...
I have a dense set of data that looks like this Y X1_BIN1 X1_BIN2 X2_BIN1 X2_BIN2 X2_BIN3 ... 0 1 0 0 1 0 ... 1 1 0 1 0 0 ... 0 0 1 0 0 1 ... 1 0 0 0 1 0 ... 0 1 1 0 0 0 ... but for millions of rows and about 400 columns, corresponding to bins of about 20 different XN variables. The average of Y is ...
Setup An instance of Max-Coverage is typically defined by a collection of $n$ sets $S = \{s_1, s_2, \dots, s_n\}$, and a budget $k$, where the objective is to select a subset $U\subset S$ such that $$\big|U\big| \leq k,~\text{ and }~\big|\cup_{s\in U}s\big|~\text{ is maximized}.$$ The variation I am interested in is as...
I have a simply connected graph $G$. I start at a uniformly randomly chosen vertex, and from there, randomly walk through the graph by choosing a random edge to follow at each step. On average, how many steps $T$ until the random walk hits every vertex? Can this be efficiently computed? Here are some cases for which I'...
I'm playing a MMORPG where we party hunt, the problem is that at the end of the hunt each person may have different balances depending on what items they wasted and the stuff each one looted. The game tell us what are our balances in the party, but nothing more... so for example, having something like this as an input:...
Prove that $L$ is not a Context-free language, where $$L = \{ a^{i} b^{j}c^{h}\mid i,j,h\in \mathbb{N} \wedge h = \max(i,j)\}.$$ I have an idea: It can be divided into two situations: When $i < j$, $w = a^{i} b^{j} c^{i}$ When $i > j$, $w = a^{i} b^{j} c^{j}$ Then with the help of the pumping lemma,but I will onl...
Freivald's algorithm (see the wiki) is a randomized algorithm for verifying whether the product of two $n \times n$-matrices $A$ and $B$ yields a given matrix $C$ (i.e. $AB = C$). The way this task is accomplished is to introduce a random vector $\vec{v} \in \mathbb{R}^{n}$ and evaluate whether $$A(Bv) = Cv$$ The claim...
I have two similar problems in which I'm trying to find a connection to help me solve one of them. In the first one I'm given a graph G = (V,E) , integer k, and vertex cover U of size k. The objective is to find the largest clique (max size clique in G). The second one is instead of a vertex cover, U is is a group of v...
The DSATUR algorithm is a greedy graph coloring algorithm. It consists of applying the usual greedy coloring algorithm, considering vertices in reverse lexicographic order of (number of different colors among neighbours, total number of neighbours). Though not always optimal, this algorithm is already known to be optim...
We know that $L$ = { $w$ $\in$ {a, b}* $|$ $|w|_{a}$ > $|w|_{b}$ } This is my answer: $G$ = ({$S$,$A$,$B$},{$a$,$b$},$R$,$S$) $R$ = S $\to$ $AB$ $A$ $\to$ $aA | Aa |B$ $A$ $\to$ $a | abB | Bab | Bba |aBb|bBa $ But after testing, it seems that writing like this is wrong. So how should it be written? https://web.stanford...
The following example is given: The sender and receiver are using 1 bit even parity The sender is sending 1110 1010 over a noisy channel. in case 1 the receiver gets 1110 1100 in case 2 the receiver gets 1110 1001 Which one of this two cases was detected and why wasn't the other one ? I don't understand how one error...
A defer statement takes another statement and evaluates the given statement at the end of the current function call. See how Go does it. Delimited continuations can be abused to provide throw/catch semantics. See an example here. Is there any way to abuse delimited continuations to provide defer semantics? Sorry if thi...
I have the following algorithm: MyFunction(A, i, j): if (i + 1) >= j: return k = [(j - i + 1)/4] # round up MyFunction(A, i, i + k) MyFunction(A, i + k, i + 2 * k) MyFunction(A, i + 2 * k, i + 3 * k) MyFunction(A, i + 3 * k, j) for a from i to j: m = i for b from i to j: if A[b] > A[m]: m = b swap A[m] with A[a] My go...
Problem definition: Given a universe $U$ of $n$ elements, a collection of subsets of $U$, $S = \{S_1,..., S_k\}$, and a cost function $c: S \to Q^{+}$. Find a minimum cost subcollection of $S$ that covers all elements of $U$. The provided algorithm (Approximation algorithms - Vijay V. Vazirani) Part of the proof where...
I don't really understand time complexity, and wanted some clarification in this hypothetical situation. If I were being given items one by one, and I wanted a list of them all in the reverse order I got them in, I could add each item to an ArrayList, then reverse it. Both of these operations are $O(n)$ in time complex...
Suppose that we have an $n$ sized array that it broken into $m$ contiguous, non-overlapping chunks such that when the chunks are concatenated, they form the original array. Say we perform a binary search individually on chunks[0], chunks[1], chunks[2]..., chunks[m-1]. What is the complexity here? We perform binary sear...
A question that answers itself. If P=NP could be proved in a formal language, then surely it would be as easy to verify the proof as it would be to discover/derive it? Couldn't a program just quickly check that every sentence/line obeyed the formal rules? If P!=NP could be proved in a formal language, then it could ...
So I’ve been reading about multi-threading these past few days. Can you give me a real life example where the multi-threading might be used in a REST API web server?
When can we say that a software is an operating system and not a firmware, in terms of what it can do? I know that firmware is usually stored in ROM and OS is stored on HDD/SSD, but technically you can also store OS on ROM, so the way of storage is not what exactly distinguishes between an OS and a firmware. So what ca...
Suppose I have a list of tuples. Each tuple contains 2 intervals. The intervals in each tuple have nothing to do with each other. I would like to find a smaller list of tupels that covers all elements in each interval. Therefore it´s necessary to merge the intervals of the first type and the intervals of the second typ...
Good day everyone, I'm currently trying to carry out the PetersonNP (a.k.a. FilterLock) correctness proof (mutual exclusion). I've found several proof sketches on concurrency books but I'm interested in the one shown in Distributed Algorithms (by Nancy Lynch). I find it more convincing because lemmata required for prov...
I need some help with this question: Definition: A Turing-machine that is a counter for the language $L$ is called 'polynomial counter' if there exists a polynomial $p$ s.t. every word $w\in L$ appears on the machine's tape starting from the $p(|w|)$ cell at most (that is, the first letter of $w$ is at cell $p(|w|)$ or...
Why the Kth largest element of a Min Heap of size K is always root element of the Min Heap ? How to prove this ?
Consider a weighted graph where each node represents a city. Now a truck starts from a city A and it has to cover a set of cities B, C, D.. could be in any order How to generate an ordering that result in the minimum total distance travelled while covering all the cities.
I read a proof in my script: If $P = NP\implies $ there exists no OWF $f$. A function $f$ is a OWF $\iff$ $f\in PTIME \space \land$ $f^{-1}\notin PTIME$ Their proof was a bit messy so I want to ask if the following technique (in general) can be used to proof similar problems: Assume $P = NP$, and a OWF $f$ over $\{0, 1...
I have a list of connected rooms, I need to visit each room in the list, but I have to record the exact path to traverse the entire graph. 1: [2] 2: [1,2,3] 3: [2] 4: [2] output: [1,2,3,4] expected: [1,2,3,2,4] I've written a Depth First Search that returns a path of [1,2,3,4], what I am looking for is [1,2,3,2,4] I...
Consider the following sequence $$\mathcal{S}=\langle3,1,4,1,5,9,2,6,5,3,8,9,7,9,3,2,3,8,4,6,2,7,9\rangle$$ We can imagine some adjacent elements of $\mathcal{S}$ as a number. For example, $5$, and 3 and $8$ form the number $538$. We say two number in above format is disjoint, if there is nothing common element betwee...
This is a question from CLRS: Describe an implementation of the procedure RANDOM(a, b) that only makes calls to RANDOM(0, 1). What is the expected running time of your procedure, as a function of $a$ and $b$? Here RANDOM(a, b) is a random number in the range $a, \ldots, b$. Here is the answer: RANDOM(a, b) range = b ...
In Petal-Deletion, we are given an undirected graph G and k ∈ N, and the objective is to decide whether there exists a subset S ⊆ V (G) of size at most k such that G − S does not contain any 3-petal as a subgraph. Design an O(k)-vertex kernel for Petal-Deletion. I got a hint: You may use a 4-approximation polynomial-ti...
I read about correctness of iterative and recursive algorithms.I need a sequence of book recommendations for learning mathematical aspects of computer networks and data communtions such as applications of graph theory and number theory in routing and security and error control respectively.Please provide layerwise reco...
In this paper[1] there is a section where it is mentioned that “The most commonly used L1 loss will have different scales for small and large objects even if their relative errors are similar”. I don’t understand this statement. Can anybody explain? [1]: End-to-End Object Detection with Transformers
How programming languages are capable of handling generics ? Here is some context on why I got the question. Constructs like Lists, Dictionaries and Sets in Python can handle any type of data without even specifying the type of data being added. Whereas in Java Collections require you to specify the type at the time of...
I have searched around and it seems like it is impossible for a Turing machine to implement binary search for an arbitrary sized array. How can a turing machine be called universally computable if it can't perform a simple operation other models of computation can do with ease?
You have $2$ computers denoted by $C_1$ and $C_2$ and $n$ missions $M_1,M_2, \dots M_n$. Doing the $i$-th mission on $C_1$ (resp. $C_2$) costs $a_i$ (resp. $b_i$). Moreover if you do $M_i$ and $M_j$ are done on different computers. you incur an additional cost of $d_{i,j}$. I need to find an efficient algorithm that mi...
In these lecture notes the authors mentions that P is a syntactic complexity class, as we can find a decidable set of encodings for all polynomial time Turing machines. Of course, given a deterministic Turing machine $M$ and a number $k$, we can construct a Turing machine that simulates $M$ for $|x|^k$ steps on input $...
Sorry for the vagueness, but I'm trying to study the latest progress on the exact cover problem and using graphs for NP-complete problems. Googling around has not been very helpful. I understand the basics but I can't find a key journal in this area or where to look online. Any references would be greatly appreciated!
I tried to search whether Knapsack (the decision version) has a FPT algorithm, but didn't find anything on the topic. Can someone help with a reference?
For a recurrent neural network, the LSTM was a model of how the network worked. However, consider the case where an input was a long paragraph or even an article. $$c_1c_2...c_n$$ where $c_i$ were some characters. The LSTM would work as expected given $n$ not a large number. But what if $n$ was a large number, say $1e5...
I am struggling to grasp the algorithm for building the KMP failure function. The bulk of what is making my understanding incomplete concerns the line length=PI[length-1]. There is the psuedo code for the algorithm below. Here are my questions: 1.) How do we know that in the event s[i] != s[length], the best possible o...
I am reading a text book by David Tarnoff and there is something I do not understand, the section is on CPU and memory. The book states that the number of address lines going into a memory device determines the number of addresses which makes sense to me, as it says for $n$ address lines going into the device there wi...
I'm having a small problem understanding what is the result of the 4-approximation polynomial-time algorithm for 4-Hitting Set. What I mean is that by solving 4-Hitting set I get a group X such that all subsets in the universe have a common element with X. What can I say that the result of the approximation algorithm?
What is a T-star packing and what is Proper Maximal 3-Star Packing? I read some definitions and can't understand "By a T-star we mean a complete bipartite graph K1,t for some t ≤ T. For an undirected graph G, a T-star packing is a collection of node-disjoint T-stars in G."
I'm Telecommunication student so I don't have Computer Science background, just in case if my question looks stupid. Here is my scenario: Consider an empty array named ARR with size N, we also have an array named MAP with size N that stores the state of ARR cells, ON for filled, OFF for empty, initially ARR is empty s...
Given a list of unique strings, how can I find the sum of squares of longest common prefixes length for all pairs? I think a trie will be useful but I'm not sure how to calculate the final result. For example, if given strings are and, anacron, anagram, build and buffer Then possible pairs are (and, anagram) which will...
Studying for my finals in Complexity theory. This question comes up in different variants and it requires to use probability. A side note before, to be more clear: A CNF clause consists of $n$ clauses $C_i$, so $\varphi=C_1\wedge\dots \wedge C_n$, and each $C_i$ has some amount of literals $l_1^i,\ldots ,l_m^i$, so $C_...
It is known that neural networks, such as convolutional neural networks, struggle with pattern recognition if training sets contain ambiguities (i.e. several labels can correspond to one and the same pattern). However, I struggle to locate the paper that directly discusses this issue, or demonstrates it for the first t...
I knew that $P \neq EXP$ by Time Hierarchy Theorem. But, I'd like to show that $P^A \neq EXP^A$ for all oracles A. How can I do it? I knew that If I make A=EXP, PSPACE, NP, and many others, then this would show that the inequality holds. But, how can I prove it for all oracles? Can you give me hints? Notes: I don't thi...
The language $D=\{[M]|M([M])=0\}$ is not decidable because of the following argument: Suppose there was a $TM \space M_D$ that decides $D$. Then if we gave $M_D \space [M] $, there would be two possible outcomes: 1. $M_D([M_D])=1 \text{ (accepts)}\implies M_D \text{ does accept }M_D $, contradiction, because then $M_D(...
As per Galvin's book, segmentation is the solution to external fragmentation. But in segmentation, the memory blocks are of different sizes. So, if one segment is removed that creates a hole. If we put the small segment many times then this creates external fragmentation. How, then, is segmentation solution to external...
Let $n, M$ be integers. Given two arrays $X$ and $Y$ of $n$ elements. For each $i \leq n$, we define arithmetic progression $X[i] + kY[i] \pmod M$, where $0 \leq k \leq M$. Find all $k$ such that for all $i$, $X[i] + kY[i]$ has the same value. Example Let $n = 3$ and $M=6$. Let $X=\{1,3,5\}$ and $Y=\{2,1,0\}$. Then, $...
This seems to be my first ever question :) Given that adjacency lists store all the necessary information with regards to the endpoints of an edge, we could even store a weight alongside that. I don't understand why we would ever want to use an Edge List in a way that would be more useful than the above mentioned Adjac...
Assuming you know the meaning of pipelining in Computer architecture & organization. When is the next PC address or jump address available or known to the processor? In this lecture, https://youtu.be/TMpjvAvQCWA?t=2346 Jump and branch addresses are computed during EXE or execution stage and are good to go ahead but I c...
Here's a question about using a divide and conquer approach to find a majority element in an array. It's taken from Algorithms by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani, Question 2.23. I'm not convinced why this algorithm should work. It seems to give no direction on what to do with the element that is le...
I have a connected graph, each vertex has a cost. I want to slice the graph into as many components as possible, but each component should have a cost (sum of costs of vertices) at least C. I think it should be possible with a modified Kruskal's algorithm. Each vertex is a component by itself. Then, I find the cheapest...
Given a number line from $-\infty$ to $\infty$, there exists a point $P$ on the line. We need to find the minimum number of steps to get to $P$ subject to the following constraints: The value of $P$ is not known. At a time you can only move one step either backward or forward. For example: if you are currently at 1, y...
I just want to know if people in the complexity initiated the name 'class' because the term 'class' in Zermelo-Fraenkel set theory or not? For me, I assume the answer is Yes; because it doesn't seem right that it was coincidence and we use all time set theories tools to prove inclusions. But what made me asked this que...