instruction stringlengths 35 29.1k |
|---|
Is it possible to use a quantum computer and or a simulation to perform a cyber attack on classic computers? This is part of a research objective I'm trying to figure out.
|
I've encountered this question recently: Given $\Sigma=\{\sigma_1, \sigma_2, ..., \sigma_n\}$ and $n\ge 2$, determine whether the following language is regular or not:
$$
L_1=\{w\in\Sigma^*|for \ 1 \le i \le n, \ \#_{\sigma_i}(w) \ is \ even \iff i \ is \ even \}
$$
And I need to use the Myhill-Nerode theorem to solve ... |
I got black-box (too big to analyze) boolean formula f(...) with 3 sets of input arguments: $x_1... x_i, y_1... y_j, z_1... z_k$. And I want to find such values for x-arguments that for every y-arguments exist z-arguments witch satisfy formula: $(x_1...x_i): \forall (y_1...y_j) \exists (z_1...z_k) f(x_1...x_i, y_1...y_... |
If I want to find the reversal of a regular expression using an automata, Do I have to transform the automata to DFA if it wasn't ?
|
If we want to design a PDA that accepts all words those the first half equals reverse of the second half and there is a '#' between them, "ab#ba" for example.
We start push each letter we read and when we read the symbol '#' don't push it and start popping from its next letter and check for match between the current le... |
Given a chessboard with 4 rows and 4 columns (4x4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Assign a Boolean variable to each cell of the board as below (1, 2, 3, etc. are variable names)
If a variable is True, then there is a queen on the corresponding cell and vice versa.
Use CNF clauses to describe con... |
Given a graph $G$ with $n$ tip vertices, $n-2$ internal vertices, and a cost on each edge $C(v)$, find a minimum spanning tree subject to degree constraints:
tips have a degree of $1$
internal vertices have a degree of $3$.
There are no edges between pairs of tips in the given graph. These constraints ensure an unroo... |
For example, I am given this and my output is:
11+11* = 11, 1, 11, 111, 1111, ......
Since + means or sign, my logic is:
11 appears once or more
Then I work on solving 11*
Is it perfect?
Thanks.
|
The set of all words with the same number of 0’s and 1’s.
The set of all words contained in {0,1}* that have an even number of 0’s and an odd number of 1’s.
I guess first one is NO.
Second one seems no too as we get {0,1,00,11,000,111,...}. Not all of them contains even number of 0s and odd number of 1s.
Am I on the ... |
Consider this algorithm:
RANDOMIZED-SELECT(A, p, r, i)
1 if p == r
2 return A[p]
3 q = RANDOMIZED-PARTITION(A, p, r)
4 k = q - p + 1
5 if i == k // the pivot value is the answer
6 return A[q]
7 elseif i < k
8 return RANDOMIZED-SELECT(A, p, q - 1, i)
9 else return RANDOMIZED-SELECT(A, q + 1, r, i - k)
The book CLRS... |
I need to iterate through all formulas of 7 variables in 3-CNF which have unique satisfying assignment (1,1,1,1,1,1,1).
I could iterate through all formulas which are true under that assignment -- that is, all formulas with no clauses of sort (not a or not b or not c). But there are 2^(7*(7,3)) = 2^245 such formulas.
A... |
I'm making a program that's supposed to be able to find pieces of wood in a dataset to cover a surface. For now I'm focusing on parallelepipedic shapes to simplify the problem (eventually I'd like it to be able to handle any shape).
The user should be able to approximate (almost) any 2D or 3D surface with a big enough ... |
From my theory of computation lecture I recall:
If $A \le_m B$ and $B$ is decidable then $A$ is decidable (uses a computable function as a reduction).
If $A \le_p B$ and $B$ is in P then $A$ is in P (uses a polynomial function reduction).
I wanted to know if there is an analogous notion of reduction for the class N... |
the question is related to networking frameworks; callback-based approach requires you to call a callback function every time you receive a new data packet; this is not a good approach for high-load and high-throughput network servers; is it faster to have a 'while-true' loop running in a separate process or a thread, ... |
Why are Regular sets not closed under infinite unions and intersections, with my flawled reasoning I came to a conclusion that since infinite unions can have no relationship between strings of a language hence it must be regular but the opposite is infact true, can you please help me understand why so, and under what c... |
I am studying data mining and I stumbled upon types of attributes.
They are
Nominal
Ordinal
Interval
Ratio
Data mining book by Tan,Steinbech,Kumar says
Permissible transformations for-:
nominal-: any one to one mapping, eg a permutation of values.
Ordinal-: new_value=f(old_value). An order preserving change of ... |
The problem of enumerating all lists of integers such that the list sums to a known value $k$ is well known and takes exponential time to compute.
If the problem is restricted so that the integers must be greater than $\sqrt{k}$, I feel like the runtime should now be quadratic. Is there a proof of this? More generally,... |
Studying for my finals. I saw the following question:
Prove or disprove: If in a given text the frequency of the letter A is 0.5, then the number of bits encoding in the Hoffman code for the text is 1.
In the solution they said that this statement is true but didn't explain why. I'm trying to prove this statement for... |
Question in title. Looking for whether there is a term that is, if not widely understood, at least citeable to a source.
This is equivalent to asking for the set of nodes that are comparable to the given node in the preorder induced by the digraph. But that's as much of a mouthful as what I wrote in the title.
Example:... |
Given a B-Tree that contains the keys $k$ and $2k$, we know the height
of the tree will be reduced if we delete the key $k$.
Prove or disprove: The height of the tree will also reduce if we
remove $2k$.
Now the solution is that it's true, but the explanation is lacking.. When the height of a B-Tree is reduced it mean... |
I am working on building ML/DL solution for a problem where that data is considered, naturally similar and I am worried if that would be considered as data redundancy.
My question is, is that so? and if yes what can I do about this then, since this is a feature of the actual real data?
|
While this question already exists and does talk about a heuristic with the Farthest Point First technique, I would like to approach the problem in a more efficient way. I do agree that this is an NP Hard problem, but the Farthest Point First technique might not be the best here, since I am looking for something more c... |
We know that the worst-case time complexity of any comparison sorting algorithm is $\Omega(n\log n)$. Is there a lower bound on the worst-case running time of sorting algorithms of any type? Not just comparison-based? I.e, a lower bound on the sorting problem.
|
Let's say we have a string $s[0..n-1]$ and a pattern $p[0..m-1]$ with $m < n$. I am looking for an $O(nm)$ solution to the following problem: find the number of substrings of $s$ not containing $p$ as a substring. Can you please help?
|
So let's say we have the function $f(n)$ that gives $k$ such that $k$ is the smallest number that gives a busy beaver function $B$ value from input $k$ that is greater than $n$. Or more succinctly the smallest $k$ with $B(k) > n$. Can there be computable functions that are not in time complexity class $O(n^c)$ for some... |
Determine if for given some $L$, $S_L=\{\ L(M) | <M>\in L \}$ then for any
$L$, if $S_L=RE$ then $L\in R$. Correct or Incorrect and explain why.
I think the claim is incorrect, and I'm trying to explain it with cardinals.
I know that for each language we have $\aleph0$ turing machines and $|RE|$ is also $\aleph0$
bu... |
I am looking for an algorithm to a problem that I encountered when working with 3D modeling:
On a 3D triangle surface mesh, I have multiple lines, some of them are open, some are closed. The are on one side of each line is defined as inside, the area on the other side of the line as outside. Inside is shown with small ... |
W-types generalize the type of well-founded trees, i.e., possibly infinetely branching trees. I understand that inductive types may be encoded as such in dependent type theory (CIC, MLTT, etc), this answer being particularly helpful in that, but is it possible to derive the usual induction principles from those? E.g., ... |
Referring to the Wikipedia proof :
Wikipedia proves the space hierarchy theorem using the following language:
$$ L = \{ (\langle M \rangle, 10^k) : \text{$M$ does not accept $(\langle M \rangle, 10^k)$ using space $f(|(\langle M \rangle, 10^k)|)$} \}. $$
Why do we need the padding with $10^k$? How does it help us in th... |
I've been scouting the internet for days and after a lot of digging, I decided to resort to my last hope and ask: I'm talking about the "hey Google", "Alexa" and so on voice activations. All results I could find suggested recurrent neutral networks but I have some serious doubts about that for several reasons:
Running ... |
I am trying to understand why the time complexity of the Bit Manipulation solution (https://leetcode.com/problems/add-binary/solution/) to the Binary Addition problem is O(M + N), where M and N are the lengths of the input strings a and b, respectively.
From my understanding, the worst case scenario is that each column... |
I have an algorithmic problem that I am hoping someone can help me out with:
Given: 3D triangle surface mesh, an open polygonal chain (blue).
Wanted: A line that closes the blue line in clockwise direction (green).
The green line provides a correct solution, the red line a wrong solution. Using a shortest path algorith... |
I'm looking for a book on the subject of algorithms and data structures, but I want to specifically learn about the parallel implementations. Books that teach CUDA and OpenCL usually have small sections that briefly touch on this subject, but they are mostly focused on technicalities. I'm looking for something more fun... |
I'm doing an assignment where I need to multiply two 16 bit numbers and store result as an 16 bit integer array.
a is binary with length of n
b is binary with length of m
I have already found out that a * b would have length of n + m if a and b are repdigits consisting of 1 or n + m - 1 if they're not.
Can I also find ... |
I've seen Conway's game of life mentioned in different circles and it seems many people (myself included) have made an implementation of it at one point or another. Other than the fact that it is inherently interesting that complex patterns can arise from such simple rules and the fact that its simple enough to make a ... |
I have an array of numbers, and I need to check if there is a repeating pattern in the array.
Like, for example, if I have an array A=[1,1,6,1,1,6,1,1,6,1,1,6...] this should return "Yes" (pattern present), 3 (for length of the pattern) or "1,1,6" (the pattern).
In contrast, if I have this array A=[1,1,6,1,1,6,1,2,3..]... |
I have been given two True/False questions regarding sorting an array. The questions are as following -
Question A
Given an array A with 3n keys that contains three equal parts
A[1,n], A[n+1,2n] and A[2n+1,3n], each with n keys. Each part is
sorted. Is possible to sort the keys of A into a
new array B in O(n) steps (w... |
We are given an array $A[1..n]$. We don't have direct access to $A$, but we can query what is the sum of $A[i..j]$ for every interval $i..j$. We would like to find the maximum of $A[i..j]$ over all intervals $i..j$. How can we prove that we must make $\Omega(n\log n)$ queries?
My thought is that we can solve the proble... |
My question is about part 15.5 in CLRS (third edition)*, on optimal binary search trees.
I am confused about the following sentences:
Consider any subtree of a binary search tree. It must contain keys in a contiguous range $k_i, …, k_j$ for some $1 \leq i \leq j \leq n$. In addition, a subtree that contains keys $k_i,... |
Assume that the oil company saves for each person that works in the
company a record with its name, its salary, its age and its date of
birth. You can assume that no two fields are identical for any two
employees. a. The accounting department wants to store the records of
all employees such that the following operatio... |
Given an unweighted directed graph $G=(V, E)$, two vertices $s,t \in V$ and a subset of vertices $U \subseteq V$, suggest an algorithm which concludes if there exists a shortest path from $s$ to $t$ which passes through all the vertices in $U$.
The time complexity of the algorithm should be $O(|V|+|E|)$.
I have found... |
I just came across a blockchain concept called "Proof of Space-Time" in which participants compete to verify blocks by generating and storing essentially random data to answer essentially random cryptographic challenges. The more data they can afford to store, the higher their probability of winning a challenge.
The d... |
Consider the following claim.
Let $a_i$'s and $y_i$'s be positive real numbers such that:
\begin{gather*}
y_1 \leq y_2 \leq y_3 \ldots \leq y_n \\
a_1 y_1 + a_2 y_2 + a_3 y_3 + \dots + a_n y_n = v \\
y_1 + y_2 + y_3 + \dots + y_n = 1
\end{gather*}
Show that there exists an $i$ such that:
$$AVG(a_i, a_{i+1}, a_{i+2}, \... |
I tried to show the following language is DCFL (Deterministic Context-Free Language):
$$L=\{wo^n\mid w\in\{a,b\}^*, n_a(w)=n_b(w)=n, |w|=2n\}$$
I tried to show that $L$ has a DPDA (Deterministic Push-Down Automota), but I get stuck to find a DPDA for $L$.
|
Given are $n$ integer numbers in the range $0$ to $5n$.
A SubSort algorithm organizes the numbers into $k=n/100$ sets,
$s_{1}$, …, $s_{k}$ , each containing $100$ numbers, such that the
following conditions hold:
i. In each set, $_{}$, the 100 numbers are not necessarily sorted.
ii. All numbers in set $_{}$ are smalle... |
Integer Multiplication: $x$ and $y$ are two n-bit integers, where $n=3^k$ for some $k>0$. We break $x$ into three parts $a$, $b$, $c$, each with $n/3$ bits; and $y$ into three parts $d$, $e$, $f$, each with $n/3$ bits. The multiplication is:
$$xy = ad \cdot 2^\frac{4n}{3} + (ae + bd) \cdot 2^n + (af + cd + be) \cdot 2... |
Suppose
$$L=\{wo^n\mid w\in\{a,b\}^*, n_a(w)=n \text{ or} |w|=n\}$$
Can we conclude that $L$ is DCFl?
I think it's DCFL because
$$L=\{a^no^n\}\cup \{\{a,b\}^no^n\}$$
Since
$$\{a^no^n\}\subseteq \{\{a,b\}^no^n\}$$
We can coclude that $L$ is DCFL. Becuase
$$L= \{\{a,b\}^no^n\}$$
But i think my argument, maybe isn't true,... |
The question is:
A given graph is given with only weights 1 or 2 on its arcs. (I.e. each arc has a weight of 1 or a weight of 2)
And a origin vertex s.
Write an efficient algorithm that finds the shortest paths (most easy in weight that is) from s to the rest of the vertices.
I really don't have a better idea than pe... |
Consider the following algorithm for bin packing:
Initially, sort the items by their size.
Put the largest item in a new bin.
Fill the bin with small items in ascending order of size, up to the largest item that fits.
Close the bin. If some items remain, go back to step 1.
There is a very similar algorithm for the du... |
I would like to brainstorm/get some advice/tips regarding the following question. Given an array,you can either insert elements or you can delete elements from it.Note the insertion/deletion must be done in such a way so that in the end,for any element X in the array,X occurs X times. The objective is to find the minim... |
Specifically, what NP-hard problem can we reduce (the decisions version of) GAP to and how do we prove its correctness?
The decision version of the generalized assignment problem is to determine whether there exists an assignment where every job is fulfilled (as opposed to maximizing the number of jobs that can be fulf... |
There is a lot of Turing machine out there. Most of them are purpose-specific.
What make universal Turing machine universal?
How do we know or prove if a computer is universal?
Edited:
Is programmability of universal Turing machine the key to be universal?
|
I'm writing some software that involves processing a large collection of images that are arranged spatially. It basically involves loading pairs of images into caches and computing an operation on the pairs. I'm neglecting the cost of computation as it can't be avoided, but loading into the caches from network/disk doe... |
Shorter version of my question:
Is there any polygon union algorithm that allows me to change one of the polygons quickly?
Longer version:
Currently the major performance bottleneck I'm facing in one of my own project is to quickly compute the union of multiple polygons. I've been using the polybooljs library, which is... |
Assume that we have a set of nodes and multiple graphs with different edge values for the same set of nodes. As an example, there are 4 nodes A, B, C and D. And we have 3 graphs named GRAPH_1, GRAPH_2 and GRAPH_3 as shown in the figure below.
From using any number of graphs I need to find the shortest path between two... |
I have been reading the proof in the following paper, and I am unable to understand some parts in the proof. This paper shows that a distribution $A$ over $[n]\times[m]$, $n\geq m$, can be $\epsilon$-tested for independence with just $\tilde{O}(n^{2/3}m^{1/3}\mathrm{poly}(\epsilon^{-1}))$ samples. As part of their tech... |
Suppose given a square on plane, the location of side left-down part is on coordinate(0,0) and right-top part on coordinate (10,10). Now there are points on coordinates $$S=\{(9,4),(5,8),(4,3),(1,7)\}.$$
Now we want move from (0,0) to (10,10) in any direction that remain inside the square, such that on moving from sta... |
Is the following equivalence true?
$$(r_1^*r_2^*)^* = (r_1 + r_2)^*$$
I think these are equivalent since both the expressions generate the same strings: $\{\epsilon,r_1,r_2,\dots\}$ etc.
|
Suppose given a graph $G(V,E)$ that we want to count the number of pair of vertices that have common neighbor.
I think for any pair in $\binom{|V|}{2}$ we must check its neighbor that is common or not. So the running time is $O(V^3)$ in complete graphs.
My question is, are there simpler algorithm that run in $o(|V|^3)... |
I have 2 3D surface meshes. These meshes have vertex-correspondence and have the same topology (same edges and triangles connecting the vertices). However, the vertex positions (3d coordinates) are different - that is, the meshes are a vertex deformation of each other. They are pose 1 and pose 2 of the same surface mes... |
Given a DAG $G=(V,E)$ and a weights function on the vertices $w:V \to \mathbb{R}$, suggest an algorithm that computes for every $v \in V$ the sum of the weights of vertices that are reachable from it.
My idea is to use topological sort on the graph and then start from the end to the start, and for each vertex $v \in ... |
What does $k \ln(k) = \Theta(n)$ mean? Does it mean that $k$ is a function of $n$ and we actually had better write $k(n)\ln(k(n)) = \Theta(n)$?
|
Suppose given an un-directed graph $G$, such that bridge edge of $G$ has negative weight.
From Wikipedia:
In graph theory, a bridge, isthmus, cut-edge, or cut arc is an edge of a graph whose deletion increases the graph's number of connected components.
Now there is a claim:
The Dijkstra find correct shortest simpl... |
Can someone recommend a reference/textbook on the RAM model of computation? Preferably something with a concise definition and doesn't get too much into computer architecture. I'm very fine with this is the RAM model this is how much time space,... accept it.
There seems to be some inconsistency as to whether or not th... |
I was trying to implement bubble sort in python, but turns out it's not bubble sort, it's faster than bubble sort. Can somebody please enlighten on me what sorting algorithm I implemented?
def not_bubble_sort(data, n):
for i in range(n):
for j in range(i+1, n):
#swap
if data[i] > data[j]... |
Since the Y combinator itself is a function (albeit a higher-order one), I was wondering what the fixed-points of Y itself are.
|
More often than not, most programming problem can be solved in more than 1 way. You see this in website for practicing solving coding challenges where you often have myriad of solutions to the same problem.
My question is, do all these myriad solution all turn to the same AST in the language used? For example if I have... |
I have a set $S$, which contains $n$ real numbers, which generically are all different. Now suppose I know all the sums of its subsets, can I recover the original set $S$?
I have $2^n $ data. This is far more than $n$, the number of unknowns.
|
I do not have a formal computer science background here so I am looking for pointers.
How would you advice I go about describing a formal way to describe procedures like cooking recipes, manufacturing process, driving to a location etc.
Given the fact that these types of process does feel like algorithms, but they feel... |
Say you have the finite alphabet {a,b,c,d,e,f,g}. It's trivial to enumerate all strings of length <= 1000 over that set.
But what would be an efficient way of specifying a subset of those strings that include "e" at least once?
The obvious and least efficient way is to enumerate all strings and discard the ones that do... |
Consider an approximation algorithm which does better than $f(n)$, in expectation. Suppose we know that $\mathbb{E}(OPT)=g(n)$.
Given that we use the convention of "larger divided by smaller" for approximation ratios, can we say that the "expected approximation ratio" is better than $g(n)/f(n)$?
The other possibility i... |
Referential transparency is a relatively new concept to me, but I understood that it means that a function will always give the same answer given the same arguments.
Would passing arguments by reference break this property somehow in a functional language?
|
I am looking for any literature or reference for the worst case complexity of using quicksort on a sorted array with median as pivot. Different internet sources give conflicting answers and often skip this exact question or don't give logic for their answer
Can someone explain whether is it O(nlogn) or O(n^2) and why s... |
How can create a Turing machine that checks whether or not an input string is a well-defined regular expression? For example, it recognizes a language that consists of string over {0,1} and the symbols used to write down REs (U,*,+, ...)
|
An event that occurs with high probability is one whose probability depends on a certain number $n$ and goes to $1$ as $n$ goes to infinity, i.e. it can be made as close as desired to $1$ by making $n$ big enough.
I often see that authors tend to try to prove an event $A$ happens with high probability by showing that $... |
AlphaZero is a computer program that was originally built to master the games of chess, shogi and go. It was trained solely via "self-play", in parallel, with no access to opening books or endgame tables.
The Amazon.com e-commerce system identifies users of similar tastes in terms of their profiles and shopping orders.... |
I often hear Turing machine is a mathematical model of computation. Sometimes, it's said to embody any computer program. Sometimes, it's said to be an idealised computing device consisting of a read/write head.
But is it a theoretical model for hardware or a theoretical model for software?
|
suppose you have graph G and you want to remove node n and n and all of his children but keep the ones that are connected to other nodes
if i want to delete A it will delete C but not D becase its connected to B.
and if i want to delete D then E will not be deleted because it is connected to A
is there
|
We can interpret $f(n) + o(f(n)) = \Theta(f(n))$ as for any $g(n) \in o(f(n))$ there exists some $h(n) \in \Theta(f(n))$ such that $f(n) + g(n) = h(n)$. But can we perceive it as for any $g(n) \in \Theta(f(n))$ there exists some $h(n) \in o(f(n))$ such that $f(n) + h(n) = g(n)$? If yes how do you prove this second rela... |
I was solving the following question:
Show that $L_1 \cap L_2 \in \mathrm{NP}$ for $L_1,L_2 \in \mathrm{NP}$.
I came a cross this solution on the internet which is:
$M$: On input $w$ —
Run $M_1$ on $w$; if $M_1$ rejects then REJECT
Else run $M_2$ on $w$; if $M_2$ rejects then REJECT
Else ACCEPT
But is it the proo... |
I have come up with a relaxation-free variant of Dijkstra's shortest path algorithm, and I would like to see if it's correct. Here is the pseudocode for finding the shortest distance from a node $\alpha$ to another node $\beta$.
Initialize an empty priority queue $Q$ and an empty hash map $H$.
Add $\alpha$ to $Q$ with... |
While reading a book on computer organization, I ran into a design principle stating that "smaller is faster", indicating that fewer registers means less clock cycle time. Could you prove why?
|
There are certain points about the halting problem that do not make sense to me. I couldn't seem to find a good breakdown of it that addresses my notes below. I was wondering if someone could clarify or correct my understanding of it.
To start, every version of the proof I have heard seems vague on how it defines the... |
When my instructor taught compiler construction he explained all the phases of compiler and their working nicely. But when I read online here, at last line it is written that
Parse trees are not always produced.
So, what does it mean? I thought parse trees are always produced after lexical analysis part. Is there any... |
How would you describe the runtime complexity if I have an algorithm that at each step, the size of the array reduced by an exponentially-increasing amount?
For example, for each step in the algorithm, it is actually processing n - 2^k items, where k is the number of steps it has run so far. So for the first step, we p... |
I am working on a problem which is related to The processor. The problem is the problem 4.12 in the book whose title is "Computer Organization and Design". The problem has the assumption as follow:
Here is an image Figure 4.45
And the question number 3 makes me stuck on it
The answer for this problem is MEM/WB has f... |
Which of these is true or false.
1)If Control Flow graph(CFG) doesn't contain any loop, the program will never go into infinite loop.
2)If CFG contains loop, the program may or may not go into infinite loop.
Another question:-
3)Checking for infnite loop in a program is equivalent to checking for halting ability of tur... |
Full disclosure, I'm asking this after watching a couple pop science videos; I do not know anything about the actual physics and hardware. I suspect the presenters expected an audience like me because they explained irreversibility at the level of a programming language ( irreversible_add(a, b) = a+b erases information... |
I am trying to figure out on how to approach the problem on finding proving the asymptotic of an exponential recurrence. It is described as such:
t(n)=4t(n/2)+2^n with t(1)=1 for n>=5
From what I know, the recurrence should lay in Θ(2^n).
My own attempts:
Usually I would approach this problem via master-theorem case... |
Need some guidance on where to begin. I am just learning python if it has any bearing.
I want to create a page on my site where users log in, choose multiple topics from a list, choose between levels of difficulty, choose whether or not to be timed, and then be presented with random multiple choice questions on the to... |
Wondering what are the real word applications of the Complete binary trees or Almost complete binary trees where the the last level of the tree may not be complete and all nodes in the last level are aligned to the left.
|
Suppose there is a language L∈NP, that is not NP-Complete and L≠∅ and L≠Σ∗. Which of the following statements can we infer from this?
P = NP
P ⊊ NP
P ≠ NP
NP ⊆ P
|
Why is a game like Tic-Tac-Toe in PSPACE? For example for a nxn grid you have nxn! possible game tree paths (duplicates and illegal moves aside), then don't you need (n^2)! memory slots?
|
The title explains the question easily. Also the radius of the circle is always an integer. The naive algorithm I thought was to check each and every lattice point of the rectangle but I wonder if we can solve it in less time complexity.
Here the lattice point means the simple integer point in 2D geometry plane
|
I'm confused to if there exists an algorithm that can solve the below maximum independent set in polynomial time where it is parameterized by a k value.
maximum independent set
Input: A graph G with weight and a positive integer K
Output: A safe set of maximum total value that uses at most k integers
say I have these p... |
Consider a Boolean Circuit $C$ which takes $n$ inputs and has one output. Notation: Let $\textit{size}(C)$ be the size of circuit $C$: the total number of gates in $C$. Let $G = (V,\Sigma,R,S)$ be a context-free grammar where $V$ is the set of non-terminals. Circuit-Value is the circuit value problem, and CFGM is the c... |
How should one go about this kind of problems? I'm supposed to use a graph structure for this.
Say I have a file containing a couple of courses with their prerequisites.
I have to organize the semester with courses while respecting prerequisites and the max number of courses per semester. The first semester should be f... |
Firstly I don't have CS or DFA/NFA background knowledge about their theorems or lemmas, so I don't understand some related questions' answers like here. However, I can easily intuitively understand a language $L\subseteq\{0,1\}^*$ of strings which has equal number of 0s and 1s cannot be accepted by a FA thus non-regula... |
What is the VC Dimension of the class of $k$-dimensional cross-polytope (1-norm ($l_1$) balls)?
A $k$-dimensional $l_1$ ball with radius $r\in \mathcal R$ and center $\mathbb v\in \mathcal R^k$ is
$\{\mathbb x\in\mathcal R^k: ||\mathbb x-\mathbb v||_1\le r\}$.
Namely, denote $\mathbb x = [x_1,x_2,...,x_k]$ and $\mathbb... |
In coding competitions I usually see problems that involve dealing with values in given ranges. A typical example is, given a list of 3-tuples defined as so
3-tuple = (Left bound of interval, Right bound of interval, Value on this interval)
Now these intervals can be overlapping so we can have something like
list = [(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.