instruction
stringlengths
35
29.1k
I have system of linear equations over binary field $GF(2)$. Suppose there are $n$ equations with $n$ variables and equations are linearly independent. Then we can solve using Gaussian elimination with $n^3$ complexity. We can improve this complexity using some advanced algorithms. Now suppose we know few variables say...
From what I know hash sets generally have complexity of $O(1)$ (unless the hash function is bad, but let's just ignore that for this question). However, sets need to either read the full data so as to make a hash function that's guaranteed to return a unique result for every input or they need to make a comparison to m...
If I have a set of words and need to return which of them start with a certain prefix, can that complexity be less than O(n*d), where n is the number of words and d is the prefix. I'm asking because of this video: https://www.youtube.com/watch?v=QGVCnjXmrNg (1:20 starts discussing the solution), where it says it can be...
Hello Computer Science stackexchange, I am trying to make an object tracking system. I have a module for object detections which feeds into a object tracking module. However, due to objects sometimes not getting detected and a greedy tracking algorithm the output of these two modules end up with 68 objects where the gr...
What kind of search tree should I use in which I will have operation Rank[x, y] which will return number of existing nodes/values between x and y in time O(depth of tree) so the operations find, insert and delete will have also time complexity O(depth of tree)? I was thinking about a-b tree, which has find, insert and ...
I have drawn this transition diagram for the given language. Is this correct?
Which language class are today's modern programming languages like Java, JavaScript, and Python in? It appears (?) they are not context-free and not regular languages. Are these programming languages context-sensitive or decidable languages? I am very confused! I know that context-free is more powerful than regular lan...
There are two relations, registered(participant,topic) and fee(participant,amount). The primary key for registered is (participant, topic) and the primary key for fee is participant. The premise is that of an academic conference. The relation registered stores the names of the participants and the names of the topics r...
How can I construct a PDA which accepts the language $\{a^i b^j c^k \mid k\geq \min(i,j)\}$ I think about different solutions such as building a stack with two-state. one state is for $i < j$ and another is for $i > j$, But I think it doesn't work. also, The idea of poping and pushing a and b is not good. I tried it....
I am working on some time series problems where the Fourier representation of the signal in the frequency domain is also important. I am wondering if there is any connection between time series signals consisting of sinusoidal/inherently periodic functions (functions that can be cleanly represented by a sum of sinusoid...
Given an undirected graph with some cycles: we can "disconnect" the red vertex by adding a separate vertex to each of the edges adjacent to it: In this case, disconnecting a single vertex makes the graph acyclic. My questions: What is a term for the smallest number of vertices that must be "disconnected" like this, ...
I am reading the book Artificial Intelligence (A modern approach) by Stuart Russell and Peter Norvig. While reading the book, I saw the below sentence in the book. The Turing Test, proposed by Alan Turing (1950), was designed to provide a satisfactory operational definition of intelligence. Now the question is, what ...
I am trying to understand how a sparse table can be used as a prefix sum data structure for a bit vector. In the screendump below 1 the article [2] very vaguely describes how to use a sparse table from article "Storing a sparse table" to do this is $O(1)$ with space: $O(k\cdot loglogn)$. For simplicity, we can assume t...
If we have a language K, that word w=uv, accepts. $K= \{{w \in \{a, b ,c\}^*: \ \vert u \vert_a \ \text{is not divisible by 3}}\}$. Can we land strings like aaaa in final state? How does NFA decides to break up the string in this case, would it be u = aa, v = aa (w accepted) or u = aaa, v = a (w is not accepted). Or d...
Given an undirected graph G with weight on its edges and 2 different minimal spanning trees(MSTs): T, T' Then I want to prove the following: For every edge e in T that's not in T', there is an edge e' in T' that's not in T such that if we replace e with e' in T (let's call it T_new) then it's still a minimal spanning ...
I am trying to find as many pairs of elements as possible from two distinct data streams, while being constrained by the number of elements I can hold in memory at any given time. Once a pair of elements is found, it can be removed from memory. This problem feels like a streaming variant of the maximum coverage problem...
Where is there a gap or error in my reasoning? The subset sum problem deals with a set of n numbers, which is the result of lossy compression of an array r of numbers (r = (2^n)-1). The compression algorithm in brief: check if the size of the set r +1 is a power of two. If not, terminate compression check all combinat...
Consider the topmost part of a complete, balanced binary tree of all 64-bit numbers, exemplified here. As highlighted by the lack of a 7*2^64/8 term it is not necessarily full, but it is always complete. The nodes are stored in numerical order (in-order) in a list of which I know the size, and I have the index (call it...
I have a homework question that is as follows: L(P) is a language of ASCII input strings for which a given program, P, returns "yes". Is the set of all input strings P decidable, such that P is a decision program and L(P) is decidable? My intuition leads me to believe that the set is, in fact, decidable but I am having...
I have this Grammar below: Expr ::= Term "(" Term ")" Term ::= Ident | "(" Expr ")" Start symbol: <Expr> Terminal symbol: Ident ::= [a-z]+ And I wonder if it is possible to construct a recursive descent parser for grammar G2? I think this won't be able to do that?
I have a set of multisets $S = \{ X_1, \dots, X_K\}$ where $X_i \subset \mathbb{R}$. I need to find an optimal partition $L^*, R^*$ such that this $E(L) + E(R)$ is minimized. Denote $K(X) = \cup_{I \in X} I$, then $E(X) := \sum_{i \in K(X)} |i - \text{median}(K(X))|$, where $|.|$ is the absolute value. $X_i$ might con...
There's a floating point question that popped up and I'm confused about the solution. It states that IEEE 754-2008 introduces half precision, which is a binary floating-point representation that uses 16 bits: 1 sign bit, 5 exponent bits (with a bias of 15) and 10 significand bits. This format uses the same rules for s...
Is this statement true? For each two functions $f$ and $g$, where $f \in o(g)$, there exists a function $h$ where $f \in o(h)$ and $h \in o(g)$ Please note that I am using small $o$ notation.
I have an exercise question as follows: L is a set of all Turing Machine encodings for which the Turing Machine halts after a number of steps less than or equal to the minimum value among |w| and 1000, where w is the input to the machine I understand from my textbook that the problem of halting before 1000 steps is dec...
I'm struggling to think of the algorithm to transform one data set to another. The problem I'm looking at is creating a dataset of periods of time where cumulative days absent within a period (eg 30 days) is greater than a certain threshold (eg 14 days). I can easily determine what sub-periods are within master-period ...
In zero knowledge, in the context of graph 3-coloring, I do not understand how the prover is actually showing that he solved the problem. The context: both know the graph (the prover and the verifier) the prover solves a 3-coloring of the graph repeat: *the prover randomly permutes the colors *the verifier asks for ...
I'm trying to pack sets of intervals, to find distinct buckets of intervals. The buckets should not be overlapping. For example if I have these intervals: A: [ [0, 10] ] B: [ [1, 3], [5, 7] ] C: [ [8, 10] ] I want to get the following result: [0, 1]: [A] [1, 3]: [A, B] [3, 5]: [A] [5, 7]: [A, B] [7, 8]: [A] [8, 10]: [...
Given a directed acyclic graph G = (V,E). Suppose that the vertices are in topological sort, in particular there exist an edge $(u,v) \in E$ if u <v (see the graph below). The weight $w(u,v)$ on each edge is a positive number. For a given node $i$, I am interested in computing the following term $s[i]$ defined as foll...
I have the following algorithmen (picture) which calculates a Vertex Cover and gets an undirected $G(V,E)$ Graph as input. The following task is to find the possible Time complexity (estimate) while $n = |V|$, $m = |E|$, $n \le m + 1$ and $deg(v) = |N(v)|$: a) $O(n log n)$ b) $O(n + m)$ c) $O(2^n*m)$ d) $O(n^k*m)$ e) ...
I have an algorithm with this time complexity: $$ T(n) = O(n) + \frac{n}{\log n} \cdot \log \frac{n}{\log n}. $$ I tried to figure out how to solve this and I tried to say something like this : if I have $\frac{\log n}{n}$ then the value is going to be very small, if I switch between them the value becomes very big, so...
Does it make sense to represent an AST as a graph? How can one achieve a mapping between ASTs and graphs that preserves both semantic and syntactic properties of source code? The goal and application of such a transformation would be to use graph neural networks and other deep "graph" learning techniques to extracts fe...
Usually I see the term dialect for programming languages referring to small variations of a language, such as slightly different syntax or supported features in BASIC, SQL, or Lisp. I have also seen in the context of R that the "Tidyverse" set of packages form their own "universe" or "dialect" that is based on some com...
I've come across a question in Codeforces contest 719(Div - 3). The problem goes like this : I was able to solve the problem by using another approach but had to use 4*n auxiliary space, where n is the length of the input string however the solution given in the editorial is way more efficient The editorial goes like ...
Running these lines in Colab: import numpy as np size = 2**13 %timeit np.random.normal(size=(size, size)) print("-----------") %timeit np.random.normal((size, size)) yields: 1 loop, best of 5: 2.67 s per loop ----------- The slowest run took 7.05 times longer than the fastest. This could mean that an intermediate res...
A person wants to connect $n$ circuit points to the clock signal. Now, the clock signal is going to pass parallel to the x-axis and all those circuit points are going to be connected by vertical to the clock line. Suppose the widths of the vertical wires in the given diagram also vary varying. If the coordinates $(x_i...
In Python, this is a valid program def PrintWorld(): print('World') print('Hello') 0 'beautiful' True None 0 < 0 3, 3 lambda c:3 PrintWorld() All it does is print 'Hello World' on two lines. The expressions are 0, 'beautiful', True, None, 0 < 0, 3, 3, and lambda c:3 are ignored and I'm wondering why. I realize th...
TL;DR Is there an existing algorithm for dividing W works each with priority P using T threads? If there isn't, could you direct me to a solution? Expansion given: W - amount of works [0,Infinity) P(w) - priority [1,10] T - available threads [0,Infinity). N(w) - "neighbors" of a work w in its thread There is an inverse...
I am a beginner in graph theory and just found this question in a book after completing few topics and I was wondering how you approach this questions. For eulerian, I can say that the graph has vertex with odd degree hence not eulerian, but how can I determine if they are hamiltonian or not?
I tried to solve Longest common subsequence problem using recursion, however as I later discovered, my thinking approach was wrong. I took 2 strings say s1 and s2 with lengths l1 and l2, s1="ABDEH" s2="AEBFH". I created a decision tree. My reasoning was that if s1[l1-1]==s2[l2-1] then I have 2 choices: to include or no...
So, a circular linked list is a linked list where the next pointer of the last node points to the first node (forming a circle). Now, a linked list comes with some standard methods, like size()/length(), toArray(), or traverse() (print out the nodes). Clearly, the implementation of the above (and related) methods, depe...
I have the following claim: Prove or disprove: If a key in a red-black tree has exactly one child (which isn't null) then it is always red. My attempt: Disproof. We will exhibit a counterexample: This tree satisfies the conditions of being a red-black tree, since: The root is black. All leaves are black. There isn...
I know there's like a thousand questions about this topic in the site and elsewhere. I'm just going to pick one that at least for me it serves as a good basis for my question. The answer by Rick Decker is the one that I understood more, so I'm just going to take it as a basis for my actual doubt. It's not difficult to ...
Say I have a binary number of N bits, and I need to find every combination that have M 1's. For example, if N = 3 and M = 1, then 100, 010, 001 are the allowed combinations. I have read that a more efficient way of finding these combinations for large N is by dividing the bits into two halves, and then combining combin...
I have basic understanding of file I/O. I know how to operate the read and write system calls in Linux. I know that there is blocking and non-blocking I/O. I want to know more about the underlying mechanism in OS for I/O. How is blocking and non-blocking I/O implemented? How do the kernel I/O buffers work? How big are ...
Consider two bivariate polynomials of degree at most $n − 1$ in each variable: $$ F(x,y) = \sum_{i,j=0}^{n-1} f_{i,j} x^iy^j \quad\text{and}\quad G(x,y) = \sum_{i,j=0}^{n-1} g_{i,j} x^iy^j $$ Show how to compute the product polynomial in $O(n^3 \log n)$ time. Can anybody briefly explain the solution please?
Given an array of integers I have to return true if all the elements in the array are different or all the elements are the same. Otherwise, I have to return false. E.g. [1, 1, 1, 1] - all the elements are the same, so it is true [12, 20, 1, 23] - all the elements are different, so it is also true [12, 20, 1, 1] - we h...
I'm solving Problem 11-10(b) in "what can be computed". 11.10 Consider the decision problem HALTSINSOMEPOLY (HISP), defined as follows. The input is a program P, and the solution is “yes” if and only if there exists some polynomial q(n) such that, for every n, P halts after at most q(n) steps on all inputs of length ≤...
I have to write python code in jupyter due to sampling bivariate normal distribution with 3 sampling methods: Prior Sampling Gibbs Sampling Rejection Sampling I have done the first two samplings and I also have clear understanding of what accept reject method or so-called rejection sampling is. yet I can not find any...
I have been reading Michael Sipser's Introduction to the Theory of Computation, and I have stumbled upon a paragraph in Chapter 8 (Theorem 8.9 on page 339 of the 3rd international edition) that I simply do not understand. For context, TQBF is the language of all first-order logical formulas in prenex normal form that a...
Assume we have PDA that accepts a specific symmetric language on $\{a,b\}^*$. if we have $a$ This side of the string, on the other side of the string we have $aa$. and if we have $b$ This side of the string, on the other side of the string we have $bb$. Examples of words in this language (middle point emphasized): $ab\...
I have to handle large binary dataset. That is one of the reasons I have to build my own Hierarchical Clustering. As I digged into the algorithms I was surprised and not ;) to find that it is possible to have multiple (not just two) vectors that have the same distance (hamming,overlap,...), so you can pair them differe...
problem $T(n) = 3T(n/4) + n \log n$ $f(n) = n \log n$ and $g(n) = n$ Why is $\Omega(g(n)) = O(n \log n)$? Is it because $\Omega$ means at some $n$ and constant, $\Omega(g(n)) = O(n \log n)$?
I'm stuck on the following question that I am trying to use for revision purposes. The question states that the data transmitted is 1001101, however, during transmission the second bit has an error and is received as 1 instead of 0, thus the data is 1101101. I need to use the hamming code to detect this error, however,...
I want to construct a context-free grammar for $$L=\Sigma^*-\{ab \mid b=\mathrm{complement} (a) , a,b \in \{0, 1\}^*\}$$ and prove the correctness of answer. The complement of a string is obtained by switching $0$s and $1$s. For example, $\mathrm{complement}(001) = 110$. I'm trying to decompose the language but I'm no...
One of the finer points of amortized analysis about which I have been able to find relatively little information is the broad question of what happens to the amortized cost of a structure's existing operations if we add a new one. I'll use two popular examples to illustrate my confusion: In a binary counter which only ...
I was pretty confident that I understand asymptotic notation until now. However, I am having a hard time understanding some basic definition that use asymptotic notation, specially little-o. Definition 8.1.A mechanism is blatantly non-private if an adversary can construct a candidate database 'c' that agrees with the ...
Notation: $M$ is a DFA; $L(M)$ is the language accepted by $M$; $\min(M)$ is the minimal automaton equivalent to $M$ derived from a minimization algorithm such as the Hopcroft algorithm; and $|M|$ is the size of $M$: the number of states in $M$. We are given the alphabet $\{0,1\}$ and some $n \in \mathbb{N}$. Let's def...
Given numbers $y_1,\ldots,y_n$ and $w_1,\ldots,w_n > 0$, find $y_c$ which minimizes $$ L = \sum_{i=1}^n w_i (y_i - y) $$ under the constraint $|y_i - y| \leq 4w_i$. How to proceed?
A power sequence is a sequence containing consecutive powers of a number starting from power one. for example $3^1, 3^2, 3^3$ is a power sequence. The question is to find the length of the longest power sequence in an array in $O(n)$ time. Note that the sequence is a subsequence of the array. For example, in the array ...
While reading about interrupt mechanism, I understood that there is an IRQ signal line on the bus by which an I/O interface raise an interrupt request. There is an INTA signal line using which the processor indicates acceptance of to the interrupt request.The processor interrupts the program currently under execution, ...
For homework I've to give an algorithm that computes the coefficients of the polynomial $p(x)^n$ in time $O(n\log n)$, where $p(x)$ is a polynomial of degree 7. As an hint I'm told to consider first the case where $n$ is a power of 2. My guess is that I should use FFT and somehow manipulate it with modulo operations (m...
I have a set of $k$ strings of $n$ length each. I need an algorithmic strategy that finds the LCP (Longest Common Prefix) of each set's string pair. In addition, I need time complexity $O(k*n+a)$, where $a$ must be the sum of all LCPs. Any tip/paper/help will be much appreciated.
I'm not very sure how exactly a fractal number is stored nor how random function works in mordern programming languages. But I am curious, will random function ever hits a hard coded decimal number? I know mathematically it is impossible, but how about in computer science? Such as the following javascript code, will it...
Given n disks in the plane, i want to compute the lowest point in their intersection area, im looking for a simple randomized incremental algorithm. There are some circles in the plane, these circles have an intersection R, the point with the lowest y in R is what i mean. Why i thought of RIC is that maybe we can add ...
If we've got this expression: FGa where F and G are functions (as well as a, of course; but let's treat a as a constant). It must be understood that: first apply F taking G as input; then apply the previous result with a as input. This is FGa = (FG)a conventionally expressed: ( F(G) )( a ) Or is it this instead: ...
I know how to prove longest-path problem by reducing Hamiltonian Path problem. Here I want to prove NP-hardness of a Hamiltonion Path problem by reducing longest-path problem. (pretend we know longest-path problem is NP-hardness, not Hamiltonion Path problem) I'm wondering if it is possible to reduce Hamiltonian Path p...
What is a trace bit in Processor Status register, I can't find any resource that describe about how it work, for now all I could find is that it take two bits 0,1 for Trace on/Trace off mode. Can anyone help me understand it in detail?
How many languages can a Regular Expression describe is it only one or infinite? I have tried to google it but i haven't found any answer? I know that a Regular Expression describes a Regular Language?
I'd like to create a NFA that accepts only inputs like "aaaaa";"a";"bb";"bbb", but not like "aab";"aabaa". Is the even possible? As far as I understand NFA is processing a superspositon of all sub-inputs. So then, if given automaton accepts "a" or "b", it would always accept "ab" just like it accepts "b". Is there a wa...
Why is there no algebraic definition of algorithm besides recursive functions? If I'm wrong, what is the matheist definition of algorithm that you've ever seen in a paper and can you provide a link? For example, modern machines do overflowed arithmetic by the rules of modulo $2^{32}, 2^{64}$, etc arithmetic. So why is ...
I'm on second year IT studies. I can't do this on my own and my teacher is not eager to help. I went that way but I'm pretty sure it's wrong. Please, help :/
If $L$ is some language and $\{ww^R \mid w \in L\}$ is a regular language then does $L$ have to be a regular language?
Given a non-associative, direct-mapped cache and its cache capacity, block size, and address size, how would I go about determining what bits of the address are used to access to cache? Is there a generalized formula? If there is a generalized formula, how would that formula change or stay the same for an X-way set ass...
In a network flow graph, using the Ford–Fulkerson algorithm, we can find a residual graph G_f which no augmenting paths. This gives us a way of finding one minimum cut (a cut (S, T) with minimum capacity) where S is the set of vertices reachable from the source vertex s in G_f (and it is clear that this set of vertices...
I am given a input string $s$ ("bedbathandbeyond") and a set of words {"bed", "bath", "beyond", "bat", "hand", "and"}. I need to divide the input string $s$ into a series of words in the dictionary. In this case, the two allowed outputs would be ["bed", "bath", "and", "beyond"] and ["bed", "bat", "hand", "beyond"]. Bot...
I took programming lecture it was about C/java and how to build compilers, so I wanted to know. As far I see, languages like Java/C# are developing their virtual machine CLR/JVM with good base and are improving repeatedly to increse its speed and their JIT compiler. So I was wondering, is it possible in near future tha...
From Wikipedia, "Complexity classes are sets of related computational problems. They are defined in terms of the computational difficulty of solving the problems contained within them with respect to particular computational resources like time or memory. More formally, the definition of a complexity class consists of ...
Partition problem: given a non-empty finite set $P = \{p_i : i ∈ I = \{1,\dots,m\}\}$ of $m$ positive integers such that $\sum_{i=1}^m p_i = 2T$, can $I$ be partition into two disjoint subsets $I_1, I_2$ such that $\sum_{ i \in I _ 1} p_i = \sum_{ i \in I _ 2} p_i = T$? My question is: when we deriving reduction from P...
I'm working on a case and I need some help :) I need to find number of ways and solutions itself to express N as the sum of given numbers. So, Sum (N) = 600 and the numbers from which I need to get the sum are: 50, 75, 100, 150, 200, 250. I want to find all different ways (number of ways and solutions) to express 600 a...
Given this pseudo-code that finds the number of distinct elements in the given array: D(A) // A is an array of numbers U_Size = 1 For i=2 to length(A) U=? For j=1 to U_Size If A[j]=A[i] Then U = FALSE j = U_Size if U = TRUE Then U_Size = U_Size +1 A[U_Size] = A[i] ...
Consider the following random walk: Namely, if $S_i$ is the state at time $i$, then $\Pr(S_{i+1}=1|S_i=0)=1$, and for every $s>0$ we have $$S_{i+1}|S_i=s= \begin{cases} s+1 & \text{w.p. }1-p\\ s-1 & \text{w.p. }p \end{cases}. $$ In my application, $p>\frac{1}{2}$. I'm interested in two quantities, $\Pr(S_T > H)$ and $...
I thought I understood BCFN until I bumped into this example from my course slides. A relation in a library database contains what books are currently borrowed by what users. The relation contains the unique ID of the user, their name and the title of the book. Different users might share the same name. A book can onl...
I'm having trouble identifying a problem in this pipelined datapath. After executing an add instruction, there are 5 subsequent R-type instructions executed. However, we are assuming no data hazard, so no data dependencies that are relevant. That confuses me because that takes out the main issue with executing multipl...
On my compilation theory exam we had the following problem: Construct a PDA translator (just one stack) such that it translates the language $$ a^{m+n}b^n \rightarrow x^{2m+2}y^{3n}, \text{ where } n,m \geq 0$$ I cant think of any solution. My approach was as follows: I would put in the stack $m+n$ symbols of $a$. The...
How to prove that the dual of the dual of a connected planar graph $G$ is isomorphic to $G$? In the post linked above, the user "plop" gives a great response where they claim, in particular, that a plane graph $G$ has a well-defined geometric dual. Paraphrasing, for any two drawings $G^*_1$ and $G^*_2$ obtained in the ...
I need to prove that the following language is not regular by showing there are infinite pairwise distinct equivalence classes: $$ L = \{a^{n^3} \mid n \geq 1\} \subseteq \{a\}^* $$ Looking at a few examples, I intuitively noticed that for each $i \geq 1$ there is an equivalence class $[a^{i^3}] \neq [a^{j^3}]$ for ...
I know that the depth of a circuit is the maximal length from an input gate to the output gate of the circuit and its size is its number of gates. Is there a formula that you can go from depth to size and can someone explain the steps?
Recently we had a quiz where one of the question were - Q: Asymptotic notation for polynomial : - 2^Ο(n) - Ο(n log n) - n^Ο(1) - None of these I know that Polynomial time complexity is $\mathcal{O}(n^c)$, where $c$ is an arbitrary constant. But then I checked it up on Wikipedia, and it got me confused. Accordin...
I'm not entirely sure what to call this, or if there are good reductions to other known problems, so references to those will help. As input you're given an array $A$ of length $n$ of distinct elements, and another array $B$ of length $k < n$ that contains a subset of the elements in the first array, potentially in a n...
Draw DFA for the language of all strings starting with $a$ and ending with $b$. Now what I have done is Here I used q3 as a trap. But could I do this instead? I have not used trap in the 2nd solution and used a self loop instead.
Does anyone have a list of problems where you have to combine dynamic programming with probability?
I have been given a linked list in Python. At some point, one of the nodes is linked to a previous node creating a "tail" and a "loop": Node1 -> Node2 -> Node3 -> Node4 -> Node5 -> Node6 -> Node3 Node1 and Node2 are considered elements of the "tail", while Node3, 4, 5 and 6 are considered elements of the "loop". My tas...
I am solving a CVRP (Constrained Vehicle Routing Problem) on a connected graph, that is not necessarily complete. Edge weights represent Euclidean distances. I know that, in general, the complexity of the problem in terms of the number of variables (and computational time) increases with the number of edges in the grap...
I'm reading an unfinished Introduction to Category Theory/Products and Coproducts of Sets and have come across the following: A power set of a set is the set of all its subsets. A script 'P' is used for the power set. Note that the empty set and the set itself are members of the power set. \begin{equation}\mathcal{P}\...
I have a doubt about loading kernel for every user using a Multi-User system. Every user's processes and programs are scheduled to CPU in a time-sharing fashion. But, do every user on the multi-user system have their individual kernel loaded in the main memory, or is there only one kernel loaded which is sort of distri...
I am working on a pumping lemma question and trying to prove that the following is not context-free, but I can't finish the proof. The language is $$L = \{ a^n b^m \mid n \leq m^2 \}$$ Assume Demon picks $p$ and I choose $s = a^{p^2}b^p$ and $s = uvwxy$ such that $p \geq |vwx|$. The first case is $vwx = b^j$. If we ch...
Summary I am using a DAG to compress a tree structure with many repeated nodes (the repeated nodes only very seldomly do not also have repeated edges out.) Normally, when attempting to add an edge to a DAG that would cause a cycle, you instead detect the situation and abort. I'm seeking an algorithm that will instead ...
I'm already guessing that the answer is no because we cannot know whether there is a class "in between" already known classes? Or can we? I am very new to complexity theory. Thanks for any answer in advance! EDIT: Now that I think about it again, what I am asking is if SAT was in P, could we show that SAT could not be ...
I need help with this problem: Let say that G has a perfect elimination order, than I have to prove that G is perfect. Can someone help me with that? I've tried to solve it with induction but I did not succeed..
Background: a set of 300 images are prepared, randomly pair compared with 60 other images, assigned a rating (from 1-star to 5-star) based on the pair comparison score (+1 if wins a pair comparison and +0 if loses a pair comparison), the score range for the rating assignment is 0-11 for 1-star, 12-23 for 2-star, 24-36 ...