instruction
stringlengths
35
29.1k
In models like GPT-2, TXL and Grover, is there a good way to know which input weights (tokens) resulted in each token of the output?
Highest Safe rung problem : There are many rungs on a ladder in increasing order of height. A bottle is thrown from a rung, and depending on the height of the rung, the bottle may break or may not (bottle breaks for higher height rungs, and doesn't for lower rungs). We need to find the maximum height safe rung for whic...
In the book CLRS the authors say that every quadratic, asymptotically nonnegative function $f(n) = an^2 + bn + c$ is an element of $\Theta(n^2)$. Using the following definition \begin{align*} \Theta(n^2) = \{h(n) \,|\, \exists c_1 > 0, c_2 > 0, n_0 > 0 \,\forall n \geq n_0: 0 \leq c_1n^2 \leq h(n) \leq c_2n^2\} \end{a...
Suppose the parameters/inputs of the computation include the time at which the configuration of a particular deterministic chaotic system needs to be computed. Say, for instance, as input we have a start configuration of the chaotic Rule 30 cellular automata and a time-step $t$, and as output, we require the configura...
Given a 2SAT instance in CNF where each clause has at most two literals. Let $m$ be the number of clauses and $n$ be the number of variables et let $k$ be a positive number. Question: Is there a truth assignment such that the number of variables that are true is $k$ or more? I cannot find the name of this problem, if i...
if I want to design a NFA (that's NOT A DFA) that accepts the set of all strings that do not contain the substring 1010, is this correct? because I can just accept 1010 by capturing it in the starting state itself, right? the starting state accepts 0,1 so I can essentially take the string 1010 and self loop it in the ...
I am interested in better understanding the neural network used in the paper LogicENN A Neural Based Knowledge Graphs Embedding Model with Logical Rules. To my knowledge this is the most advanced and complex knowledge graph embedding. The neural network is described as follows: Entity pairs, $[h,t]$ , are input and rel...
I have two arrays(A,B) and a sum M. I need to find one number from each array that makes the sum M. If there is no two elements that form sum M, then nearest and less than M sum is the solution. See examples below. What is the efficient way to find the solution for this? eg1: A =[200,300,600,900] B =[1000,200,300,50...
Let's say there are students from four backgrounds (Mathematics, Applied Mathematics, Computer Science and Statistics) all from top programs. They are applying to a machine learning PhD program at a top American university. In terms of getting in, which background is most favorable? What can the pure math student do t...
Continuing https://tex.stackexchange.com/questions/435986/how-to-draw-the-box-of-dijkstras-guarded-command-language, what is the difference in the intended usage of ⫾ (Dijkstra choice, U+2AFE) and ⫿ (n-ary Dijkstra choice, U+2AFF) in the context of the Guarded Command Language (GCL) of Dijkstra? In other words, when do...
Prove, that $A^+\subseteq A^*$, where $A$ is a formal language. The definition of $A^+$ is $\bigcup_{i\in\mathbb{N}\setminus \{0\}}A^i$, which would be $A^1 \cup A^2 \cup \dots \cup A^i$. Likewise, $A^*$ is $\bigcup_{i\in\mathbb{N}}A^i$ and therefore $A^0 \cup A^1 \cup \dots \cup A^i$. Suppose, $x\in A^+$. By defin...
I have a general (undirected) graph with a set of nodes, a set of edges, and a weight for each edge. I want to find a minimum clique cover of the vertices of the graph, that is, a partition of the graph into the smallest number of cliques. A clique is a set of nodes such that each pair of nodes is connected. I also wan...
I have a set of bytes (utf-8), and need to encode them into the smallest dataset possible using a Base N encoding scheme. Is it simply the higher the Base N encoding is (ie something like Base85 encoding) the smaller the output will be, or is there a point where using a higher base encoding creates longer outputs? What...
There was an exam in the class. The course is "High Performance Scientific Computing". One of the question in the exam is as follows: Consider the linear system $$ \begin{bmatrix} a & b \\ b & a \end{bmatrix} \times \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$$ with $a,b>0$. a) If $a$ i...
One approach for querying knowledge graph is to use nearest neighbor (NN) data structures. Read the paper On Integrating Knowledge Graph Embedding into SPARQL Query Processing for more details. Roughly speaking, the authors redesign the loss function used for knowledge graph embedding methods to generate vector represe...
Some Languages are trivial to find their respective context-free grammar. Like for example $ L= \{a^nb^n: n \geqslant 0\}$. However some are really difficult to solve. I would like to have some advice on how I can tackle them. For example I have the following language that I have been trying to solve for a while : I t...
Suppose there are sets $S\subseteq Q, T\subseteq Q$ such that $T=\epsilon (T),S=\epsilon (S)$. Prove $\epsilon(S\cap T)\subseteq S \cap T$ Definition of $\epsilon$- closure for epsilon NFA is: $\epsilon : 2^Q \rightarrow 2^Q $ a) $S \subseteq \epsilon (S)$ Base case b) If $q \in \epsilon (S)$ then $\delta(q,\epsilon...
I am looking to colloquialize short natural language strings and titles to more proper grammar, and do the same in reverse. For example, I'd like to find an ML algorithm that, given the proper data set and training, can convert "y'all" to "you all" or "she was like" to "she said". Even professional titles: "Director, ...
The question is: Given a dictionary consisting of a set of words and a string: find the minimum number of words the string can be split into. If the string can not be decomposed into a list of words return -1. I tried finding the longest prefix and proceeding but that doesn't seem to work. I searched this question on...
Questions: Give an example of a homomorphism, using the same alphabet, Σ, for both languages A and B. Now, give a second example of a homomorphism but this time using two different alphabets, Σ and Γ, for languages A and B, respectively. Questions to stack overflow: How do I give the examples above? Do I make the ...
Or does it finish the method? Sorry for noob question.
I have always been curious as to how google solved the solution of real time collaboration in their google docs product where they allow multiple users to edit and read the same document in real time. I believe this is very similar to the well known readers and writers problem. In some of the solutions that i have seen...
I am a bit puzzled as to why the continuous knapsack problem is a non-trivial problem https://en.m.wikipedia.org/wiki/Continuous_knapsack_problem Using the terminology in the Wikipedia link above, If the Knapsack had a capacity of $W$, couldn't we just pick $W/w_i$ of the material $i$ having the maximum value per unit...
I came across following question: Consider the grammar: $E → E + n\text{ | }E × n\text{ | }n$ For a sentence n + n × n, the handles in the right-sentential form of the reduction are (A) $n, E + n$ and $E + n × n$ (B) $n, E + n$ and $E + E × n$ (C) $n, n + n$ and $n + n × n$ (D) $n, E + n$ and $E × n$ Solut...
I was asked a question in an exam You are given an array A[1..n] of length n with each cell containing a ⟨height,weight⟩ pair. All height values are distinct, and so are all weight values. The array is sorted in increasing order of the height values. Your task is to design a recursive divide-and-conquer algorithm that ...
Our recurrence is $$ T(n)= \begin{cases} T(\lfloor{n/2}\rfloor)+(\log(n))^{2}, & \text{if $n>1$} \\ 1 & \text{if $n=1.$} \end{cases} $$ I have identified $a = 1 > 0$, and $b = 2 > 1$. I am having trouble identifying the $c$ (for $n^{c}$ in $f(n) =(\log(n))^{2}$. The best I could break it down to was $(\log(n))^{2} = \l...
I'm looking into discrete-time Markov chains (DTMCs) for use in analyzing a probabilistic consensus protocol. One basic thing I haven't been able to figure out is how to model a set of independent processes: consider $N$ processes. These processes will concurrently execute a series of identical instructions labeled $0,...
I am reading papers in machine learning and they say things like, "This computation took $x$ number of GPU years". What is a GPU year? How long is that?
Suppose we have two discrete random variables and we want perform maximum operation to obtain the max PDF. We know that max of two independent random variables is: if $Z = max(X,Y)$ $pr(Z = k) = pr(X = k) pr(Y < k) + pr(X < k) pr(Y = k) + pr(X = k) pr(Y=k)$ Where in the above figure pr(Z=3) for instance is pr(X=3)*pr(...
My task is to design Turing Machine that ignores its input and returns all the prime numbers. I have some basic idea how to do that but I am not completely sure whether my approach is correct or not. So no matter what the input is, we should ignore it. I think it would be sufficient to add another tape with cells $1^*,...
Let $G$ be a $k$-regular graph (each vertex have a degreee $k$). It is trivial to store the graph in $O(\log n)$ space or words such that $j$th neighbour of any vertex can be found in $O(\log n)$ time. Assume that neighbours of each vertex are ordered. Note that $k=O(\log n)$ Is there an representation of graph $G$ th...
I'm having trouble figuring out a regular expression over the alphabet {0,1} that contains all strings with no TWO consecutive 1's. I'm also wondering if there is a pattern that could be extended to three consecutive 1s. etc... Would something like this be correct? (0 U (10))* U (0 U (10))* 1
Problem: Fix a constant $k$. Given a set of $2d$-dimensional points $N = \{N_1, N_2, N_3, \dots, N_n\}$, each associated with an arbitrary weight, find a set of points $X = \{X_1, X_2, X_3, \dots, X_k\} \subseteq N$ such that the pairwise distance between any two points in $X$ is at least $D$, and $\sum_{i=1}^k \mathi...
Let $A$ be a finite set, and $S \subset \mathcal{P}(A)$. Is there a data structure for $S$ that would allow to quickly retrieve an element $q \in S $, given a key $p \in \mathcal{P}(A)$, such that $q$ is (one of) the smallest superset(s) of $p$? The assumption is that $A$ is relatively small and that the elements in $...
I am taking a course in Operating Systems. I am going through old exams and there is a question about monitors. We are supposed to give a solution for the producer-consumer problem using monitors. That is quite clear. But, it also says in the question: List also the assumptions that you make about monitor semantics Can...
I know that the grammar <expr> = <expr> + <expr> | <num> <num> = 0|1 is ambiguous because it cannot decide between (1+1)+1 or 1+(1+1). However, that would also mean that <expr> = <expr> + <num> | <expr> * <num> | <num> <num> = 0 | 1 would also be ambiguous because it couldn't tell if 1+1*1+1 is (1+1)*(1+1) or ((1+...
I came across some code today for converting binary to decimal, and I realised that I don't fully understand how it works. Here it is in Python: #Binary to denary conversion binary = input("Input a number in binary:") denary = 0 for digit in binary: # A left shift in binary means x2 denary = denary * 2 + ...
Suppose I have a set of points that construct a convex polygon in the Cartesian plane with the points as its vertices. I randomly choose two vertices and want to know if they are consecutive vertices on the polygon. Does anyone know of an algorithm that would do this, as in you would input the array of points and the t...
I'm a new Computer Science student in a masters program, switching from Applied Math. I'm really new and lacking some background, but I am interested on what literature is out there on graph algorithms, just so I can get an idea of what is possible, what is impossible, what work has been done before, etc. I'm trying to...
Just out of curiosity, I was wondering whether there is a conditional lower-bound on the running time of an algorithm for the Single Source Shortest Path Problem (on directed or undirected graphs). I found papers with lower-bounds on some special models of computing such as PRAM or distributed systems but I was wonderi...
$L_1$ = A sequence of $0$ or $1$'s such that at least one $1$ is in the sequence $L_2$ = Turing machines that decide $L_1$ I think the first language is decideable, as the input string is of finite length and you can check every character in the string. However, my intuition says the second language is undecideable. Th...
From my understanding, using such operators on large numbers doesn't have an impact on running time, since the integer rounding becomes negligible after a certain point. For example, the recurrence $$T(n)= \begin{cases} T(\lfloor{n/2}\rfloor)+(\log(n))^{2}, & \text{if $n>1$} \\ 1 & \text{if $n=1.$} \end{cases} $$ is un...
Say we have two equal-sized arrays that contain a 1 or 0 at each of their indices. These two arrays are identical, except at one unique index. We want to find and output that particular index. For simplicity, assume we can use two subroutines that can sum any subarray in our first and second arrays, respectively. How...
Let's assume that DAG is complete: there is directed edge among every to nodes. Does topological sort of vertices exist for any such graph? I.e. is it possible to make linear list of nodes in which the left node has edge into the right node. Maybe this is the question about existence of Hamiltonian path in every comple...
Let L be the set of all strings over {0, 1} whose lengths are at most three. Since L is regular, the pumping lemma holds for L, and thus there is a pumping length p associated with L. What is the smallest possible pumping length associated with L? For this problem, I think minimum pumping length for this language sho...
A subsequence of a word is obtained by dropping some letters from it. The letters that are dropped need not be consecutive. For instance, ba, bna and banaa are all subsequences of the word banana. We are interested in counting the number of distinct subsequences of a fixed length of a given word. For example, the word ...
Suppose I have a greedy approach to solve a certain problem. Say, I wish to solve the problem of coloring a particular graph. Now, my naive approach would be: First, find a maximum indpendent set of vertices in the graph, and give it one color. Next remove the set of vertices found in the previous case from the graph, ...
This is a question I've been asked to do and I honestly have no idea how to approach this. Help please?:)
Consider this language: $L = \{a^nb^ma^nb^m \mid n,m \ge 1\}$. Can we give for this language a context-sensitive grammar?
Prove that every NP problem is solvable in $O(2^{n^{k}})$ where $k$ is constant. My approach was that, let's look at the 3-SAT problem. We can solve it by bruteforce in $O(2^n)$, where $n$ is number of variables in 3-SAT. Also, we know that 3-SAT is NP-Complete, that means every NP problem is polinomially (let's say ...
L = {x=y ⊕ z|x, y, z are binary integers, and x is the XOR of y and z} is non-regular, i.e., no FA exists that could recognize the language. How can I give an implementation level description of a TM that decides on L?
I was wondering how I can show that the language $\{a^n b^n c^n \mid n \geq 0 \}$ is Turing-recognizable. Also, if it is Turing-decidable?
Consider the function $f$ that maps strings over $\{a, b, c\}$ to strings over $\{0, 1\}$ by replacing each $a$ by 0, each $b$ by 0, and each $c$ by 1. For example $f(cabbc) = 10001$. The function $f$ extends naturally to languages: if $L$ is a language over $\{a, b, c\}$, then $f(L)$ is the language over $\{0, 1\}$ de...
If I have language: L = {x | x = n^2 for some integer n} How can I give a high-level description of Turning Machine that decides on the language?
I want to check whether a arbitrary binary number is less or equal to another binary number in a cnf-formula. I can already construct a formula, which is not in cnf: Lets say n and m are two-digit binary numbers: $n = n_2 + n_1$ $m = m_2 + m_1,$ where $n_i, m_i \in \{0,1\}$ for $i \in \{1,2\}$. Then the boolean formula...
The problem comes from the book текстовые и жадные алгоритмы (String and greedy algorithms) by a fairly unknown Russian computer scientist Николай Сухоруков. We are given two numbers $A$ and $B$ of the same length but possibly with leading zeroes, which are bounded by $10^{(10^5)}$, but this is fine as this is a string...
The grammar have the following producitons, \begin{align} S&\rightarrow aTbS \mid\epsilon\\ T&\rightarrow aTb\mid\epsilon \end{align} Already turned this homework in, but I need to convert this grammar to chomsky normal form. Our teacher didn't go over this very well and all the documentation doesn't make sense to me a...
Answer https://stackoverflow.com/a/26151549/1375882 suggests that Sperner's lemma can be used to prove the existence of index for the search Hamiltonian path in complete directed graph. But Sperner's lemma is about simplex, its triangulation and colouring. How such notions can be mapped to the complete graph with n-ver...
I have an algorithmic problem where I need to find the biggest area of a certain type of pixels inside a 2D matrix with following conditions: Each pixel needs to be connected either diagonally or adjacently. The area is considered coherent only if it is surrounded by the other type of pixel( x-es on the edge are not) ...
I need help to solve the recurrence T(n) = T(n−√n) + T(√n) + θ(n)
Giving a the following: A list of a store items $T=\{t_1, t_2,...,t_n\}$. A list of prices of each item $P=\{p_1, p_2,...,p_n\}$. A list of quantities of each item $Q=\{q_1, q_2,...,q_n\}$respectively. And total bill $M$. Our goal is to find any possible list of items that its total value is equal to $M$ using dynamic ...
HITTING SET INSTANCE: collection C of subsets of a set S, positive integer K. QUESTION: Does C contain a hitting set for C of size K or less, that is, a subset S' of S with |S'| <= K and such that S' contains at least one element from each subset in C Prove that HITTING SET is NP-Complete problem?
The Hitting Set Problem is defined as having a universal set $\mathfrak{U}$, and nonempty sets $S_i \subseteq \mathfrak{U}$ for $1 \leq i \leq n$, and finding a set $\mathcal{H} \subset \mathfrak{U}$ such that $|\mathcal{H} \cap S_i| \geq 1$ for all $1 \leq i \leq n$. We may ask for the minimal cardinality of $\mathcal...
I was studying for an algorithm exam and was having trouble answering (or rather proving) one of the practice problems. I want to find the correct symbol among $o$, $\omega$, $\Theta$ that would best describe the relationship between two functions $f(n) = (\log n)^{100} + n^{0.01}$ and $g(n) = (\log n)^{50} + n^{0.05}$...
I thought of using Depth First Search (DFS) to find all possible paths in O(|V|+|E|). However, computing the product of all the edge weights for a path is O(2^N). Is there any way to compute this more efficiently?
Given a semigroup is it possible to give a total order to it? If not possible in the general case then what about the case of finitely generated finite semigroups? Does there exist a natural extension of the syntactic order given to a semigroup w.r.t. an upper set? (currently it only induces a partial order)
So, I took up a new course (AI) in my uni and came across these two test $TURING$ $TEST$ and $CHINESE$ $ROOM$ $TEST$. But I am not able to understand is the Chinese room test really accurate? Does it really dis-approve the TURING test?
Is there any way to make recursion tree that satisfies the height $h(n) = h(n−\sqrt{n}) + 1$ to show $h(n) = O(\sqrt{n})$?
Surely any language with a finite longest word can be made regular by having an automaton with paths to 26 states for all letters and then having each of those states go to another 26 states, etc., with states going to a looping non-final state whenever there are no possible words to be made beginning with the letters ...
I was reading our university slide on the Diffie-Hellman where it is mentioned that one of the disadvantages of D-H is that For large prime, $p-1$ is an even number so, $\mathbb{Z}^*_p$ will have a subgroup of order 2 What does this statement mean?
Failed to find similar term, here I coin the noun RR(Right-to-left, Rightmost derivation) as an opposite concept of LL. The question is inspired by an interesting example grammar $G$: $$S \rightarrow S S + | a$$ It's obviously an RR(1) language. After some time to explore, I find an equivalent LL(1) grammar: $$ \begin{...
We (a group of CS postdocs and Ph.D. students) are starting a shared reading of a machine learning book ("An Introduction to Statistical Learning", James, Witten, Hastie, Tibshirani). Before diving into it, however, we felt the need to get some more solid background on simple and pure statistics. We would like to start...
Say we have the letters $\Omega = \{1,2,\dots n\}$, and two sets of subsets of $\Omega$, $S_1, S_2$. I want to find $S_1 \cdot S_2 := \{(s_1,s_2) \in S_1 \times S_2: s_1 \cap s_2 = \emptyset \}$. With the sets I'm working with, the cardinality of $|S_1 \cdot S_2|$ should be considerably smaller than $|S_1||S_2|$, thus ...
In our university, we were taught that since all 26 letters cant be placed together in a $5*5$ square matrix we must put $i/j$ together like this represented in the below diagram. Here our key is $monarchy$, now what would have happened if the key contained $j$ in itself? say if the key would have been $jargon$ then ho...
I have found a dataset which involves surnames dispersion around the world that sorted by population which I use it for a name recommender system. Its readme page caught my attention because it has mentioned that suitable for cybersecurity and ML fields. Unfortunately on I'm a newbie person in these fields, and I can n...
I was reading about pseudorandom number generators and how they need a seed and how that seed is usually current system time in milliseconds. One of the most common algorithms is the linear congruential generator, which is an algorithm that based on some fixed constants and this seed through some mathematical computati...
Using non-determinism to create a PDA to recognize non-palindromes is easy. My first instinct was to say yes, but it would be extremely complicated. After thinking about it, I don't think you could.
I am learning about algorithmic complexities and I read that if f(n) and g(n) are asymptotically positive functions and if $f(n) =O(g(n))$ then the relationship $log(f(n)) = O(log(g(n)))$ holds. I would like to know what are the necessary and sufficient conditions for this relation to hold?
I am studying solvers of quantified boolean formulas (QBF) as a generalization of SAT solving. The standard DIMACS format of SAT specification is extended to QDIMACS, which adds "a ..." and "e ..." lines denoting which variables are to be existentially quantified and which variables are to be universally quantified. Fo...
As a prover, we just try to convince the verifier that it's correct, no matter whether it is or not. So we can just analyze every possible route. For $\text{PCP}[O(\log n),O(1)]$, won't there just be polynomial many possible routes, and checking all just cost polynomial time? In computational complexity theory, an int...
I'm learning Marching squares for a graphic program I'm working on and, while I understand how to connect points along an edge of a single square depending on the vertex values, I am unclear about how to connect two curves belonging to adjoining squares. The part I'm trying to understand is this: Say I'm linearly inte...
An IB question requests: Construct the logic diagram for the Boolean expression NOT A OR B AND C. The answer looks to me like not A or (B and C), whereas what I expected only gets partial credit. Can someone explain?
Binary Search is a fairly simple and standard algorithm that can be used (among other things) to find a target element in a sorted array. There are subtle variations in code to do this, however all of them work the same for the case in which an element exists for the most part. The subtleties that I'm trying to wrap my...
Given $n$ sequences with length $m$, $s_i=\langle c_1^ic_2^i\dots c_m^i\rangle, i = 1,\dots, n$, where $c^i_j\in D$ is a partial ordered set and the partial order relation $\sqsubseteq$ on $D$ answers any query $x\sqsubseteq y$ in constant time. We define the neighbourhood relation over $\{s_i\}$ as: For any $\pi=\lang...
I have 3 input variables and the output for all 8 possible combinations is 0 (false). When making a circuit, how would I show this using gates or no gates at all? Thanks!
Let $G$ be a context-free grammar and $w$ be a string of length $|w| = n$. Consider the language $A_{CFG}$ = { <$G$, $w$> | $G$ is CFG that generates $w$ }, where <$G$, $w$> is a string encoding of $G$ and $w$. Now we have to show that $A_{CFG}$ is decidable, or in other words, there exists an algorithm that determines...
Here is the problem: Input: A series of source/sink nodes at fixed positions with given outwards/inwards flow Edges are NOT specified. The edges can connect any nodes. The total source and sink flow match A concave cost function that gives a cost per edge in terms of flow capacity Expected output: The minimum cos...
Given the regular expression $(1 + \varepsilon + 0 )(1 + \varepsilon + 0 )(1 + \varepsilon + 0 )(1 + \varepsilon + 0 )$, how many distinct strings are in the language? How do you determine this from looking at the regular expression? Do I have to generate a table of all possible combinations or is there a more straight...
This is a very basic question but I spent some time reading and find no answer. I am not computer science majored but have read some basic algorithm stuff, for example, some basic sorting algorithms and I also have some basic knowledge of how computers operate. However, I am really interested in the idea of a Turing ma...
How were the GPT-2 token embeddings constructed? The authors mention that they used Byte Pair Encoding to construct their vocabulary. But BPE is a compression algorithm that returns a list of subword tokens that would best compress the total vocabulary (and allow rare words to be encoded efficiently). My question is: ...
I have a bipartite graph made of two sets (SET 1 and SET 2) and I want to determine how many vertices from the SET 1 I can remove while still having every vertex of the SET 2 connected to at least one vertex of the SET 1. In this example, E and F can obviously be removed as D and C are connected 5 and 6. But we could...
I don't get how to intuitively come up with an example for an ambiguous grammar. Let's take as an example this grammar: Declaration ::= Type D ; Type ::= "int" | "char" D ::= "*" D | D "[" number "]" | D "(" Type ")" | "(" D ")" | name I am told out...
Imagine we have a set of numbers $\{x_1,x_2,\dots,x_m\}$. We want to compute the different ways to make a big number $P$ by those small numbers. For example, if $P = 5$ and we have $\{1,2,3,4,5\}$ we can make $P$ by: 1+1+1+1+1 or 2+3 or 1+4 or ...
Let $T$ be a labeled tree with vertices $V = \{1, \dots, n\}$ and edges $E$. Define the length of an edge $e = \{ u, v \}, u \in V, v \in V$ to be $l(e) = |u - v|$, i.e. the distance between the nodes in the linear arrangement of the tree. Let the length sequence $L$ of $T$ be the sorted sequence of lengths of all the ...
You all may know that simple Matrix Multiplication algorithm: for(i = 0; i < n; i++) for(j = 0; j < n; j++) for(k = 0; k < n; k++) C[i,j] += A[i,k] * B[k,j] end for end for end for When we want to parallelize it, we can, at first, parallelize the outer loop, which is the most easiest thing ...
I've got a question. How can i simulate Turing machine with a double-sided infinite tape by a Turing machine with one-sided infinite tape? The condition is, that the simulation of one step of the first machine must be equal to O(1) steps of second machine. Do you have any idea, how to do this?
Consider propositional logic over the connectives $\land$, $\lor$, and $\lnot$. Notation: $| \alpha |$ is the length of formula $\alpha$. We are given a formula $\phi$. Cancel all cancellable negations in $\phi$ by applying all possible valid biconditionals (EDIT: such as the examples below) to get $\phi'$; for clarity...
I understand that an NP-hard problem is a problem X such that any problem in NP can be reduced to X in polynomial time. Does there exist a problem that is hard to solve but problems in NP cannot be reduced to it in polynomial time i.e. it does not satisfy the definition of NP-hard but is strictly not in NP? If not, wh...
To illustrate my confusion let's say I'm given this unambiguous grammar in BNF: S ::= T O x T ::= empty T ::= "if" E "then" T x "else" T O ::= empty O ::= "if" E "then" T O Here is the corresponding derivation tree: S ...
I'm following the slides at https://homepage.cs.uiowa.edu/~tinelli/talks/FT-11.pdf where Tinelli explains how k-induction works in the context of SMT based model checking. A parametric and resettable counter is given as a Kripke structure by the following formulas: Variables: $x := (c, n, r, n_0)$, where: $n_0$ is a...