instruction stringlengths 35 29.1k |
|---|
This video of a group, who simulated (a very simple version of) Minecraft inside Minecraft itself got me thinking about the performance of such setups.
Another example to what I'm referring to, would be Conway's Game of Life simulating itself.
The first example runs through a bunch of modifications at 0.1fps and the se... |
I learned about abstract state macines recently, and on first sight they seem somehow reminiscent to TLA formalism. For example both:
Are used to research possible state sequence and prove safety/liveliness properties abot them
Use notion of refinement
Have specification language on top of them
So I wonder does one h... |
Given a string length $S$, find a substring length $k$ that has the most occurrences in the given string.
We want $O(S)$ time complexity in an average case.
I think the solution lies in sophisticated use of Rabin-Karp algorithm.
I've tried to use the sliding window method, but that results in $O(S * k)$ time complexity... |
What is the expected maximum matching size of a bipartite graph $(A\cup B, V)$ where $\lvert A\rvert = n$ and $\lvert B\rvert = n$ and the probability of a edge existing between $A$ and $B$ is a fixed $p$. If a general formula doesn't exist how about for $p = 0.5$ or some other $p$.
|
You have board size and one Knight but what is different is that when you move it you have to duplicate the knight and the 2 duplicates have to be in valid position from the knight
This gets repeated until the board is filled with knights just like visited in the original problem but both duplicates can be moved, once.... |
Problem definition
The world consists of an infinite three-dimensional cartesian grid, i.e. every position is in $P = \mathbb{Z}^3$.
Neighbours of a position $p \in P$ are defined by $N(p) = \{p + e_1, p - e_1, p + e_2, p - e_2, p + e_3, p - e_3\}$, where $e_i$ are the unit vectors, for example $e_1 = (1,0,0)^T$.
For a... |
Given a set $S$ of $n$ positive integers $S=\{a_1,\ldots,a_n\}$, can we partition $S$ into $k$ subsets of equal sum such that each subset has contiguous elements from $S$?
Here, a contiguous subset is in the form $\{a_i,a_{i+1},a_{i+2},\ldots\}$ for some $i$. For example, with $S=\{3,6,2,1\}$, possible contiguous subse... |
I am trying to implement a multi-agent path planning algorithm that works on non-planar graphs and large agents (that is, collisions may at the intersection of two edges and at points where the edges run beside each other, if the euclidean distance is small enough).
For context, one can imagine the given graph as repre... |
Why bit-based computer models?
The perhaps most commonly used computer model is a random access machine that can store natural (or even real) numbers in infinitely many cells indexed by natural numbers. This model's main benefit is that it greatly simplifies calculating Runtimes, as arithmetic and indexing are simply a... |
I'm building some teaching tools for teaching the lambda calculus and would like some kind of visual representation of it. I've looked at Alligator Eggs and while it is something very similar to what I'm looking for, I would like something that expresses church numerals in a more elegant way.
What other visual/graphica... |
First, can the Navier-Stokes problem be a formal computable one? like a P problem? Then, how to define the corresponding language? Would it only be the set of equations, or something else? Then, could the size of the input vary if the problem was the three dimensions one? Seems not if the number of equations is limited... |
As you know, big O notation hides all constants. For instance, both runtimes $T_1=n$ and $T_2=10^{10}n$ are considered to be linear ($\mathcal{O(n)}$).
Is there an iconic problem whose best known solution has a terrible (large) constant in the runtime expression?
|
Please explain to me if this is true or false. I had this in an exam, and I really need to know if I got this correct. I believe it is true because finite problems have finite solutions, which can be done in polynomial time.
|
L= {abc}
prefix = {epsilon,a,ab,abc}
suffix = {epsilon,c,bc,abc}
It's easy to find suffixes and prefixes for finite Regular languages. But what will be the approach for infinite Regular languages?
For example:-
Alphabet = {a,b}
L1 = Every string starts with a.
L2 = Every string ends with a.
L3 = {waw|w belongs to {a,... |
We got the following tasks in our Higher Algorithm class, to repeat our proof techniques from class:
Find asymptotic upper bounds (as sharp as possible) for $T(n)$ in each of the following cases,
using your favorite method.
You may assume that $T(n) < 10$ for all
$0 ≤ n ≤ 5$.
Where me and my colleague got stuck sp... |
I have read online and seen websites saying the optical disk drive is a storage device. In my opinion, the optical disk drive only writes data to the optical disk so it's not a storage device, am I wrong??
|
In simple precision format, the largest possible positive number is
$A = 0 ~~~ 11111110 ~~~ 111\ldots 111$
Its predecessor is
$B = 0 ~~~ 11111110 ~~~ 111 \ldots 110$
But what is the absolute difference (in decimal) between these?
Appealing to scientific notation,
$A = 0.(2^{22}+2^{23}+\ldots + 2 + 1) \times 2^{2^{7}+2^... |
Given sets A, B, C with a parent-child (one to many) relationship between A and B, and B and C.
There are concurrent attempts to modify the data.
Each concurrent modification has access to (a1, a2) in (A, A) different from all other modification attempts and a1 != a2. Each concurrent modification may change the parent ... |
I was given the following problem called the barter economy problem: Given a set of $n$ people $\{p_1, \ldots, p_n\}$ and a set of $m$ distinct objects $\{a_1, \ldots, a_m\}$, where each object $a_j$ is owned by exactly one person, and each person $p_i$ has a valuation function $v_i$ such that $v_i(a_j)$ is a non-negat... |
I am trying to wrap my head around the concepts of auto-reducibility and having access to an Oracle.
The way I understand is that a language is auto-reducible iff there is a Turing Machine $M^{L}(x)=1$ for every x $\in$ L with the special requirement that on input x the Turing Machine is not allowed to query the Oracle... |
In the book of Hopcroft-Ullman (the 1979 edition) there is a rule $Da\rightarrow aaD$ in the example of the CSL language $a^{2^i}$.
Valid rules in CSG have the form $\alpha A \beta\rightarrow \alpha\psi\beta$. I think the mentioned rule is not valid, since there is no way to get rid of the terminal $a$ at the right sid... |
As stated in the question title, if $f(n)$ has polynomial growth and $g(n)=\Theta(f(n))$, then how can we show $g(n)$ also has polynomial growth?
$g(n)=\Theta(f(n))$ gives us $0\leq c_1f(n)\leq g(n)\leq c_2f(n)$ for some positive constants $c_1, c_2$ for some $n>n_0>0$. But how can I conclude $g(n)$ also satisfies the ... |
Let's say that we have a set consisting of many strings encrypted with the same key by a xor cypher, moreover they are the same length as the key, both the key and the original strings might contain only small english letters and the space char.
We have encryption function E(k,m)=k⊕m and decryption D(k,c)=k⊕c, which me... |
In a graph with N nodes, where each node represents a house and is labeled from 0 to N-1, an adjacency matrix graph[i][j] indicates the distance from node i to node j.
Consider a list of tuples [[init_1, target_1], ..., [init_k, target_k]], representing delivery requests. Each tuple, like [[1, 2], [2, 3], [5, 3]], requ... |
I've been trying to wrap my head around the proof provided in this answer.
I understand that $P$ is a class where languages can be decided by a Turing Machine and that $P/poly$ is a bigger class that also includes languages that can be decided by circuits.
Take a language $L$ which is not in $\mathsf{E} = \bigcup_{c=1... |
I created a 8-puzzle search solver using BFS, A* with manhattan distance, and A* with misplaced tiles.
I generated data that said that for a particular random board, misplaced tiles did less node expansions to solve the board.
Is this possible?
I thought that manhattan distance is always less node expansions than mispl... |
Say I have an FPL class problem with the complexity O(2^k * n). If I limit the problem so that k is a known factor (for example 150). Then the complexity becomes O(2^150 * n). I have learnt that constants get removed from the complexity equation. Which means the complexity should now be O(n). Does this mean the limitat... |
I was wondering how you would go about making a two-tape Turing machine in linear time that starts with input # on Tape 1, where and are binary integers that might have leading 0's. It would accept the input if and have the same value such as 001101 has the same value as 1101. Would it be a good idea to replace the... |
$f$ and $g$ being known functions.
We suppose that the problem is solvable.
To me, for the moment, this question, if a decision problem it is or can be, is more an NP rather than a P problem, because if it was a P problem, we would have to answer it in polynomial time, and so test every $u$ function in a single polynom... |
We consider a partially filled starting grid, where $n^2$ is the side size of the grid, $m$ is the number of non-empty initial squares, $f$ is the function that places randomly initially the integers into the squares of the grid, the $((x_i,y_i))$ are the coordinates of the initial non-empty squares, $p_i$ are the init... |
i would like to perform a reduction for my novel problem to preferably the set cover problem, but i am a bit lost..
My problem can be described as follows:
Suppose you have given an binary word as input =101101…, an integer and a set of smaller binary words $_1,_2,…,_$
with $length(w)$ is a strict divisor of $length(u... |
I was trying to figure out how can I construct a non-deterministic Turing machine that decides the language $L = \{0^{n^2} | n \geq 1\}$
I looked at some of the proposed solutions here :
Turing machine for unary encoded quadratic numbers
and here:
How to check if a number is a square with deterministic single-tape Turi... |
In Java, I'm getting the error for all my return statements that I can't return a value with a void result type, but I don't declare the return type as void anywhere, and I'm really not sure what the issue is. Here's my code:
public class Card {
private int suit;
private int rank;
public Card(int suit, int rank) {
... |
A set of n independent tasks, each having integer execution times,
are to be executed using three identical processors. A task can be
executed in any of the three processors. Develop a sequential
algorithm to find minimal total execution time for scheduling all the
tasks. For this develop an initial recursive definitio... |
I'm aware that the worst case scenario recurrence relation corresponding equation is:
$$
T(n) = T(n-1) + T(0) + \Theta(n)
$$
However, I really don't get how the last term $ \Theta(n)$ was determined.
I dont understand why $ \Theta(n)$ and not $ \mathcal{O}(N) $
I don't get why it is $ \Theta(N) $ and not $ \Theta(N-1... |
The C semantics treat the result of a comparison or any true/false operation as just an int with value 1 for true or 0 for false. This is simple and intuitive.
However, mainstream processors do not work this way. Comparison instructions do not output a byte or integer or any value with 1 or 0 as the result of the compa... |
From a list of practice problems for a graduate Theory of Computation course. I've done quite a few problems at this point on deterministic Turing Machines, I just don't think I have fully grasped the notion of non-determinism in the context of TM's yet.
I suppose this TM would work something like this: Given an input ... |
Find an algorithm for edge connectivity in undirected graph using flow networks. Try to use $O(m)$ edges.
So basically the flow network should be used as a "helper function" and the graph that I give this helper function should have $O(m)$ edges.
How can I do that? So far I know about Ford-Fulkerson algorithm and Dinic... |
There exist plenty or practical FEC algorithms - RS, Golay, convolutional codes of all sorts. All of them assume that the original data and the FEC code are sent over the same channel with the same error rate. Are there any algorithms where the size of the error correction code can be reduced, assuming that the code is... |
I am currently studying algorithms and computational complexity at University.
I have recently got through three questions I found in an old exam:
Is it possible to sort in asymptotically linear time an array of rational numbers between $[1, 1.5]$ with limited numerator?
Is it possible to sort in asymptotically linea... |
In version gamma of the ACM/IEEE/AAAI Computer Science Curricula 2023, on page 50, one of the illustrative learning outcomes for the "Computational Models and Formal Languages" section of the curriculum states that students should be able to
Use arithmetization and diagonalization to prove Turing Machine Halting/Undec... |
I'm performing a sequence of text formatting using regex in Python.
I'm curious to know if it's possible to formally verify whether a single (or a sequence of) regex modification(s) is idempotent, which means that for every text, d ∘ d (text) = d (text), where d denotes the resulting total modification.
To be precise,... |
The problem of interest is
$$
\min_{x\in\mathbb{Z}^n} \frac{1}{2}x^\top Q x + c^\top x
$$
where $Q$ is a positive definite matrix. I am reasonably sure this can't be solved in poly-time, since the closest lattice vector problem (in $\ell_2$ norm) can be reformulated in the above form. Do we have a proof of $\mathsf{NP}... |
I looked through many sources which give this as an example for cfl. It also makes sense according to this:
But it fails the pumping lemma test.
Let's take n=5.
According to the Pumping Lemma, we can decompose
s into uvxyz like:
u=0, v=0, x=0,y=01, z=111
If we pump it, it clearly fails.
So, is 0^n1^n context free or n... |
There is this paper in which HIV is modelled using cellular automaton. I am trying to replicate this work but I am not getting the same results as the authors. In this paper the authors describe the rules they are implementing. I will post my implementation of the code after the rules description.
constants and other v... |
I recently faced this problem in CLRS ed.4 and couldn't find out how to attack it and solve it. Here's the recurrence:
$$T(n)=3T(\frac{n}{3})+8T(\frac{n}{4})+\frac{n^2}{\log{n}}$$
Here's what I tried:
$$\frac{3}{3^p}+\frac{8}{4^p}=1$$
For $p=1$, we get $\frac{3}{3}+\frac{8}{4}>1$ and for $p=2$, we get $\frac{3}{3^2}+\f... |
This is a problem inspired by a video game that I've been thinking about for a long while, and I haven't convinced myself that I can do any better than brute force + pruning techniques, which would still take way too long to solve.
Is there anything better? Any class of algorithm I should look into more?
Problem descri... |
As far as I and this wikipedia page know, there are no collisions (2 inputs with the same output) found in SHA-256 (yet).
what would happen if a collision were to be found,
1. would it be easier to find more collisions? (based on the first collision found)
2. is a single collision found a major security risk as the onl... |
Suppose $L_1\preccurlyeq_T L_2$, and $L_1$ is unrecognizable, can $L_2$ be recognizable?
With decidability, if $L_1$ is undecidable, then $L_2$ is undecidable, because $L_1$ is the “easier” question. Would this apply to recognizability, too?
|
This cstheory.SE post gives various randomized approximation algorithms for the set cover problem. Is there a randomized algorithm (which runs in $\mathrm{poly}(n)$ time) for the set cover problem which achieves an approximation ratio of $1$ (with high probability)? Is it possible to achieve such an algorithm, or is th... |
Assume we have:
$$T(n)=7T(\frac{n}{2})+n^2\lg{n}$$
Can we solve it using master theorem?
As we know $n^{\lg_2{7}}\approx n^{2.81}$. On the other hand, we have $f(n)=n^2\lg n$. So we should compare $n^.081$ and $\lg{n}$. As I know, $\lg{n}=\mathcal{O}(n^{0.81})$. So the answer should be $T(n)=\Theta(n^{\lg7})$. Am I rig... |
Given a set of 2D vectors. Find maximum magnitude of sum of a subset of the set.
I want to do my undergrad thesis on this topic. Can anyone suggest me some existing papers related to this topic or its real life use cases? I need research papers specifically.
|
I have a solid grasp on why we minimize the L2 norm of the weight vector ( w ) in Support Vector Machines (SVM) for classification problems — it maximizes the margin between classes and helps the model generalize well to unseen data. However, I'm finding myself lost when trying to understand the analogous concept in Su... |
Assume this recurrence:
$$T(n)=T(n-1)+\frac{1}{n}$$
As we can use Master Theorem and Akra-Bazzi method here, I tried to draw a recurrence tree and I reached the whole cost of this tree is $\frac{1}{1}+\frac{1}{2}+\frac{1}{3}+\dots+\frac{1}{n}$. What's a tight upper and lower bound for this recurrence (I'm talking about... |
Assume this recurrence:
$$T(n)=T(n-2)+\frac{1}{\lg{n}}$$
I tried to draw its recurrence tree and I reached that the whole cost is $\dfrac{1}{\lg{n}}+\dfrac{1}{\lg{n-2}}+\dots+\dfrac{1}{x}$ that $x$ is $2$ if $n$ is even, otherwise is $3$. So somehow we should solve $\sum_{i=1}^{\frac{n}{2}}{\dfrac{1}{\lg{2i}}}$ or $\su... |
Is my proof that FINIT is undecidable correct?
FINITE= { ⟨M⟩ | M is a Turing machine that accepts only finitely many strings } is undecidable.
Answer:
To prove this we can use reduce to Halting Problem, which is a known to be undecidable problem.
to prove that FINITE is undecidable, assume for contradiction that there ... |
how to prove that in the Nearest Neighbor algorithm for the Traveling Salesman Problem with one modification, if it finds a hamiltonian cycle, it's the optimal cycle. the modification is if the shortest path it could choose is an edge to a node already visited, the algorithm stops.
|
For an integer linear program: Given a matrix $A \in \mathbb{Z}^{n\times d}$ and two vectors $b \in \mathbb{Z}^{n}$, $c \in \mathbb{Z}^{d}$, compute $max\{ c^{\top}x|Ax \leq b, x\geq 0, x\in \mathbb{Z}^{d}\}$ is an NP hard problem.
Also given matrix $A \in \mathbb{Z}^{n \times d}$ and a vector $b \in \mathbb{Z}^{n}$, d... |
In exercise 22.3-13 of CLRS (Intro to Algorithms 3rd edition), the authors provide the following problem:
A directed graph $G = (V, E)$ is singly connected if the existence of a path from $u$ to $v$ implies that $G$ contains at most one simple path from $u$ to $v$ for all vertices $u, v\in G$. Give an efficient algorit... |
Here's the problem statement (as given on GeeksForGeeks website):
Given a sorted dictionary of an alien language having N words and k starting alphabets of standard dictionary, find the order of characters in the alien language.
Explanation: We're given a sorted dictionary having N words. Here a dictionary is an ordere... |
If I am doing a many-one reduction from L1 to L2, since it is described as a total function, does that mean that every possible encoding in L2 should have been achieved from L1 or is it possible that there might be some encodings of L2 that cannot be derived from this reduction.
If such encodings exists in my reduction... |
In the Narasimha's data structure book, there is a line
The amortized time of a push operation in the incremental growth of array stack (realloc on every push) is $O(n) [O(n^2) / n]$.
I am confused with this Big-O notation here, what does it mean? Is arithmetic legal on big-o notation functions?
|
This is from the Narasimha's data structure book
For nth element (n - 1 index), if we want to push an element, create a new array of size n and copy old array to the new, and at the end assign the value of n-1 index.
After n push operations the total time T(n) is proportional to 1 + 2 + 3 + 4 .... + n ≅ $O(n^2)$.
Sho... |
I'm working on a problem from the Digital Design and Computer Architecture course on Systolic arrays.
The question set up is as follows:
The following diagram is a systolic array that performs the multiplication of two 4-bit binary numbers (a
and b). For example, if a=1110 and b=1011, the result of the multiplication ... |
Given a range of "K" bit numbers, we want to identify the whole range by using a subset within that range, with the following criteria -
If there are > "n" consecutive 0s, it becomes the 1st [00] prefix identifier value - case (a)
If there are <= "p" consecutive 0s, (where p < n), that value has to be identified as ... |
I am interested in finding an efficient algorithm for the following problem:
Let $x \in [0,1]^n$ be some vector, with $x_n = 1$.
We want to recover $x$, solely by asking queries of the form $\texttt{argmax}(x + v)$ where $v \in \mathbb{R}^n$ is an arbitrary additive shift.
A simple algorithm is to do binary search over... |
Here, flip() is a function that returns 0 or 1 with equal probability. It can be proved function Random(n) returns a number from 0 to n-1 with identically distributed probabilities (using loop invariant).
function Random(n):
v = 1;
c = 0;
loop
v = 2v;
c = 2c + flip();
if (v >= n) the... |
The runtime of Quicksort can be significantly reduced if multiple threads running on multiple cores can be used. With just two cores, just partition an array into two halves and let another thread sort the second half.
The problem is that with many cores, say eight, the initial partition of the array takes a very signi... |
I want to define a typed domain-specific lambda calculus which can simulate the sequence execution like common programming language. I wonder how to give its corresponding BNF, can I use p;F, let x=I in F in and If p then F1 else F2 to denote the sequential structure, let blinding and conditional branch?
|
I want to learn how to write objective functions for any problem or real-life action(not mathematical problems) can anyone suggest a good source? On online I am mostly finding objective functions for mathematical problems. Can anyone tell from where can i learn or practice those ?
|
I am trying to understand the personalised page rank algorithm. I have a graph with multiple types of nodes and I want to calculate how important other nodes are w.r.t these nodes. I am using personalised page rank algorithm for the same.
I followed the notes from this blog https://medium.com/polo-club-of-data-science/... |
According to my CS knowledge so far, a lexer uses DFA(which takes linear time) for 'each' token type to find the next token, so in the worst case, it should try 'all possible' token types of a language. (there are some other reasons, e.g. to find the 'longest matching pattern' to distinguish between if a(keyword) and i... |
Most papers that I have seen on proving digital logic focus only on the combinational circuits (ie using boolean logic). But real life circuits also have flip-flops, ie a time element an a clock. How to model such time and clocks in theorem provers, eg in hol or coq?
(as a very simple example) how do I model a modulo-1... |
For example if the condition is i<=n, and the n is decreasing in the loops, how can i calculate the time complexity?
Lets say we have nested loops like below:
for (i = 1; i <= n; i++) {
for (j = 1; j <= n; j++) {
x = x + 1;
}
n = n - 1;
}
Or if the decrement of n is being done ... |
Let
$U \subset \mathbb{N}$ be a finite universe set;
$B$ be a set of nonempty subsets of $U$ such that $B$ covers all elements in $U$, i.e. $\bigcup_{b \in B} b = U$, and if $b \in B$ then $b \subseteq U \wedge b \neq \emptyset$;
$c(i) = \{ b \in B : i \in b \}$ be the set of all subsets containing element $i \in U$;
... |
Given a length N (e.g. 20) and an array of lengths which are all <= N (e.g. [15, 1, 6]) I'd like an algorithm that finds the minimum number of N lengths necessary to be cut into the array of lengths.
The practical application here is for ordering steel: given a design from an engineer I'd like to specify how many lengt... |
I am trying to prove by the pumping lemma that $L=\{0^m1^n:0\le m\le n^2\}$ is not a CFL. Here is what I have so far.
Suppose for contradiction that it is a CFL and let $N$ be the pumping length. Set
$$ s = 0^{N^2} 1^N $$
Let $u,v,x,y,z$ be a decomposition $s = uvxyz$ such that $uv^ixy^iz\in L$ for every $i\in \Bbb N... |
I know that Dijkstra's algorithm is used to find the shortest path between nodes in a weighted graph. And I know that this can be used to model road networks.
Somebody online asked (but nobody answered) how one would go about modifying Dijkstra's algorithm to determine if an electric car can travel to every town in a w... |
Firstly, we define A and B as two decision problems with the same set of inputs.
Define a new decision problem "A AND B" as follows: The input to "A AND B" is any valid input x for A and for B. The output is to decide if A(x) = Yes and B(x) = Yes. For example, in the "Independent Set AND Vertex Cover" problem, we must ... |
This is a basic question, but suppose I have two disjoint universes $\mathcal A $ and $\mathcal B$, and some fixed types $A:\mathcal A, B:\mathcal B$. Would it contradict anything if I postulate that $A$ is a subtype of $B$? This would mean that $a:A \implies a:B$, so there is an overlap between $A$ and $B$, but there ... |
I'm learning about the (min-mean) cycle-cancelling alg for min-cost flow in Ahuja, Magnanti, and Orlan's Network Flows book (Chapters 9 and 10). When talking about the alg, they prove this fact related to the $\epsilon$-optimality of a flow:
Lemma 10.14: For a nonoptimal flow $x$, if we cancel a minimum mean cycle in ... |
According to the book " Operating Systems Concepts ", ninth edition , page 210, we have the following statement :
Many modern computer systems therefore provide special hardware
instructions that allow us either to test and modify the content of a
word or to swap the contents of two words atomically—that is, as one
un... |
Given the grammar with productions:
\begin{align}
S \rightarrow aSb \mid SS \mid \lambda\\
\end{align}
I would like to show that it is ambiguous. As I understand it, if you can show that some string can be produced with these rules through more than one leftmost or rightmost derivation, then the grammar is ambiguous.
A... |
Let us say that I wanted to solve a Hamiltonian path problem by treating it as a Hamiltonian cycle(on a weighted graph). I use a TSP solver, and implement a dummy node of edge weight zero, whose distance to every other node on the graph is equal to zero. Can I run Dijkstra's algorithm (either alone, or with other DP fu... |
This is for the leetcode problem 169. Majority Element. Given an array of numbers, where there is a guarantee that there is a number that exists in the array greater than floor(n/2), one can find such a number by selecting a random index and checking if it's value is the majority element or not, and repeat until it's f... |
The typical definition of an RMW instruction with e.g. sequential consistency is an instruction where no memory operation can happen between the load and the store in the global memory order.
Is there a reason to use this definition? Why is it not sufficient to just require that no operation to the same memory address ... |
I am trying to wrap my head around the following proof
Choose some language A $\in$ $TIME(n^3)$ \ $TIME(n)$ (the existence of such a language is guaranteer by the hierarchy theorem)
Let B = {1}
Note that $A \leqslant_{p} B, B \in TIME(n)$ but $A \not\in TIME(n^{3})$
The way I understand is that A is in $TIME(n^{3})$ ... |
My apologies if the title is confusing. First I begin with the statement that may be wrong but what I always thought what happened.
"Dennis Ritchie created C compiler which was used to create other Unix or Linux compilers, which helped us create current Linux eco system."
The idea behind this was that if you take a mod... |
By the closure property of context-free languages, if $L$ is context-free, then $L^R$ (the reverse of $L$) is also context-free, but $L\cap L^R$ might be non-context-free. I tried to come up with an example of $L$, but it seems the set of $L \cap L^R$ could only have palindromes (including languages like $aaa \ldots$) ... |
I am currently facing a question "Can a graph with a unique MST product a different spanning graph using Dijkstra vs using Prim's algorithm?" The answer is false and I am struggling to understand why (and also to come up with a counter example)...
|
Suppose the following fill-in-the-blanks exercise:
___ ___ and ___ ___ went to the ___.
Suppose the correct solution here is "John Smith and Mike Jones went to the pub". In other words: [John, Smith, Mike, Jones, pub].
But the following alternate solution should count as well - the persons are swapped but they are the ... |
I'm a mathematics undergraduate interested in theoretical computer science, machine learning, and neuroscience. I wish to pursue graduate studies in computer science but I fear I might not be able to since I haven't and won't be allowed to take any computer science courses for the rest of my undergraduate years. My cu... |
I am having trouble with a problem where I am given an adjacency list and a list of the nodes that must be visited exactly once to connect two nodes. What is the most efficient way of doing this? This problem is the Hamiltonian Path problem except it is only certain nodes that have to obey this principle. Let me know i... |
I have a problem that is 0/1 knapsack, but you are also able to swap the weight of 2 items up to k times. I came up with a O(nkc) solution, but I am looking for a faster o(n*c) solution. I think the intuition is we should use all k swaps unless we can use less than k swaps and use all of the max values with the minimum... |
(This is mainly about reads, and commercial products not hypothetical machines.) When loading a CPU register with data contained in L2 or L3 of a multi-level cache. Can the data that is in L2 or L3 but not in L1 be read directly, or must the cache line be transferred into L1 before moving to a register?
Another way to ... |
I'm following a book about graphs and they introduce a concept called 'activity network'. In an activity network, each vertex represents an activity in a project (like building a house for example) that needs to be done. An arc between two activities $uv$ means $u$ needs to be done before $v$ and the weight of the arc ... |
I am currently trying to build a simple computer in Minecraft (8-bit data, 6-bit addresses, no paging or segmentation), with redstone, where I can make run simple programs written similarly to code in the Little Man Computer. However, I have come across the problem that I have no idea which addresses in RAM are free to... |
Using a 1 way 2 stack, and a 2 way 2 stack PDA, I want to check if the length of an input string is strictly a perfect square number. How can I do this in both approaches?
|
Following bar graph shows maximum percentage cpu utilization of F16sv2 (16vcpu &32GB) azure virtual machine in last 30 days. Only sometimes CPU usage goes more than 60 percentage.
How to find the right number of CPU cores for the workload so cpu never goes under utilized?
What factors should we consider while doing sc... |
I read the question and answer at Number of nodes of a parse tree when the Grammar is in CNF?, and I'm curious about a related matter: obviously with a unrestrained LR grammar (as opposed to CNF) the relationship between input length and the number of parse tree nodes depends on both the grammar and the input string, b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.