instruction
stringlengths
35
29.1k
There is a theorem stating that, given a random algorithm with a binary output that has a success probability $\geq 2/3$, you can always create the another algorithm that solves the same problem but with a success probability $\geq 1-\delta$ by just repeating the original algorithm $\mathcal{O}(1/\log\delta)$ times and...
I am looking at $L=\{a^nb^m |n\neq m \}$. I would like to prove that $L$ is not regular. This can easily done by assuming it is regular and looking at $\overline L$, or by using other theorems. Despite that, I am interested in proving its not regular by using only the pumping lemma. Let $k$ be my pumping constant. I tr...
The Simon's problem is that, given a function $f:\{0,1\}^n\to\{0,1\}^n$ such that, for all $x,y\{0,1\}^n$ t satisfies $$ f(x)=f(y)\text{ iff }x=y\oplus s $$ where $s\in \{0,1\}^n$, and the Simon's problem is to find the secret string $s$ by querying $f$ as few as possible. Or in other words whether the function $f$ is...
The maximum cut problem is a combinatorial optimization problem that seeks to partition the vertices of a graph into two sets, $S$ and $T$, in a way that maximizes the number of edges that cross between the two sets. The problem is tractable for planar graphs. However, the vertices can be assigned to any of the two set...
Suppose you're given a black box $A$, and you're told $A$ can invert a matrix (assuming the matrix is invertible) $M$ in $O(T_A)$. You're also given a black box $B$, and you're told $B$ can multiply two matrices $X$ and $Y$ in $O(T_B)$. There are two problems as follow: How is it possible to compute $X \times Y$ by ju...
Let $D(V, A)$ be a $k$-partite DAG; $P = \{ p_k : 1 \leqslant k \leqslant |P| \}$ such that $p_k \cap p_l = \emptyset$, $\forall k,l : k \neq l$, and $\bigcup_{1 \leqslant k \leqslant |P|} p_k = V$ be the set of partitions; $A = \{ (i, j) : \forall_{1 \leqslant k \leqslant |P| - 1} (i \in p_k \wedge j \in p_{k + 1}) \...
Need a grammar that can create this language, I am having issues getting a language to work and was looking for help.
I'm currently working on an interesting problem in function approximation thta just came to mind and am seeking insights or methodologies that might aid in approaching it. The problem is as follows: Given a continuous function say, $f(x) = \sin(x)$, I want to find a polynomial $P(x)$ of degree $n$, where each coeffic...
Background: I've a degree in computer engineering that I completed 5 years ago. I got really good grades at algorithms class but forgot everything that I studied. My notes were lost while migrating to a different place. Now, I want to relearn it. I have very little memory of how I learnt it at that time. Resources How ...
I do not even know where to start with this assignment. I need to prove the following directly, that is, without using any Theorems or Lemmas. I have the following definitions: $$\begin{array}{rcl} \eta &: & A \to A_\bot\\ \eta\ a & = & \left\lfloor a \right\rfloor\\ (\star) & : & A_\bot \times (A\to B_\bot) \to B_\bot...
So I have been tasked to anonymize clinical data that..most of the time would be present in the form of tables. I've looked into algorithms like generalization,redaction,K-anonymity, l-diversity,t-closeness. But I am not sure how to robustly implement them. I've also looked into Microsoft presidio. Are there any better...
While converting NFA to DFA the number of states in both should be same or different?
I want to understand how the algorithm of selection sort sorts the given array, $$A[5]=\{5,9,11,10,2\}$$ Step -$1:-$ I compare A[0] with remaining elements of the array and since $A[4]<A[0]$ I swap them which leaves me with, $$A=\{2,9,11,10,5\}$$ Step-$2:-$ Repeating the similar procedure for $A[1]$ gives $$\{2,5,11,10...
I have a dataset with 1055 samples and 168 features. I want to remove some features in order to train a model on my dataset. The model should output a binary field (either 0 or 1 that is known). Some features are fake, since some of them have been generated randomly and added to the dataset . I want to only keep the re...
I'm trying to read the following article, and in the abstract they write: Let $\xi$ be a non-constant real-valued random variable with finite support, and let $M_n(\xi)$ denote a $n\times n$ random matrix with entries that are independent copies of $\xi$. For $\xi$ which is not uniform on its support, we show that: $Pr...
I have asked it already on math.stackexchange.com and stackoverflow.com but they said it was off-topic and could not help me. They pointed me to cs.stackexchange.com so hopefully somebody here can help me or atleast point me in the right direction. We have been using a bayesian average on a website of ours for a couple...
Is there an algorithm that would fit in the following situation: I have a sub image A of a larger image, and a set of sub images B that could (but not necessarily) share border with A. Now the algorighm should find likelyhood of A sharing a border with a sub image in B. There may be errors or small gaps between the sub...
Consider vector<int> C I aim to calculate $\displaystyle \sum_i i*C[i]$ using some stl library. In there any stl function there to do that?
I have a directed graph (DAG) containing many nodes, all with various attributes (node attributes not edge attributes). I have a single target (finish) node and a set of source (start) nodes. I want to find a path through this graph that minimizes the sum of all the attributes on said path, and return the top N minimiz...
Consider the RWM online algorithm as defined in this Wikipedia article; this version is with multiplicative update. Let us assume that we define our weights as a fraction; that is, $w_i^t = 1 / (M_i^t+c)$, where $i$ is an expert, $M_i^t$ is the number of mistakes of expert $i$ until, and including, time $t$, and $c$ is...
I have a tree, $T$, with $n$ nodes. My goal is to assign a non-zero weight to each node such that the following condition is met: Upon removing any arbitrary node, the total weight of nodes in each resulting connected component should be equal. Consider the following tree as an example: 1 -- 2 -- -3 -- 4 | ...
I'm currently studying the 3x3x3 rubik-cube-solving algorithms developed by Kociemba, Korf, and Thistlethwaite and I'm interested in understanding their computational complexities. Could someone please explain or provide the Big O notation for the time complexity of these algorithms?
In my studies of discrete mathematics, I've learned that a tree graph is inherently bipartite. I'm interested in finding an algorithmic approach to determine its bipartition. It seems to me that Breadth-First Search (BFS) could be a reasonable method for this task. However, I'm struggling with the formal proof of this ...
Given any number $N$ find a positive integer $k$ such that: $N + 12 k$ is a square. And the second case when we add an additional constraint that $k$ must be as small as possible.
If we have a finite (directed) graph G, and a set of walks P in G. And assume that there exists an n so that all walks of lengths greater than n have at least one p in P as subpath, how would we find n? Does anyone know a polynomial time algorithm in |G|? For example if we have the graph 1 -> 2 -> 3 -> 4 and P = {(2,3)...
This question is an extension of this one. Let $D(V, A)$ be a $k$-partite DAG; $P = \{ p_k : 1 \leqslant k \leqslant |P| \}$ such that $p_k \cap p_l = \emptyset$, $\forall k,l : k \neq l$, and $\bigcup_{1 \leqslant k \leqslant |P|} p_k = V$ be the set of partitions; $c_p \in \mathbb{R}^{+}$ be the profit of partition ...
I've been reading the wikipedia article about probabilistic context-free grammars (PCFGs), and they state that PCFGs have application in areas as diverse as natural language processing to the study the structure of RNA molecules and design of programming languages. but I'm having a hard time finding examples of their...
My textbook (Saurabh's Introduction to VLSI Design Flow) mentions while discussing formal verification that a representation of a Boolean function is said to be canonical if the following holds: If a representation is canonical, then the two functionally equivalent functions are represented identically. Conversely, if...
I need help with this question. If it’s possible to do this without limits, please show. Thanks. Q: If f(n) is Ω(n) and g(n) is O(n), then prove or disprove the following statement: f(n) is O(n)
I am a high school student who is very interested in computer science and has been studying it since middle school. I've heard a lot of news about the rise in computer science majors in college and how that affects school acceptance rates. Should I be worried about this and how it'll affect my college application expe...
i have seen some articles where they use the diagonalization argument to prove the existence of non-primitive recursive functions. But this should only work if we can create an infinite list of every possible primitive recursisve function in a computable way, like say for eg we should be able to find the output of nth ...
A caterpillar is a subgraph which consists of a path with at most four leaves (legs) attached to each node (but a node can also have no leaves). This is not the same as finding the longest path, because we measure the number of vertices (including the legs), not the length. Find an algorithm with time complexity of O(n...
For any set of strings A, define the set FirstHalves A = {x∣∃y such that len(y) = len(x) and xy in A }. For example, FirstHalves {01, 111, 1010, 001101, 1011} = {0, 10, 001}, ie the first halves of the even length strings. Let B = {01, 011, 0111, 01111, 011111, ...}. What is the set FirstHalves B? You can simply write...
As the title says, the question is about finding the maximal bottleneck edge in path P. Bottleneck of a path P in an undirected graph G = (V,E) is defined to be the weight of the edge with minimal weight on P. Given a graph G and s,t in V, find the path between s and t with the maximal bottleneck. In other words, find ...
Given a $n \times n$ matrix $M$ of positive integers and a constant $d$. If $R,C \subset \{1,...,n\} $ let $$S_M(R,C) = \sum_{r \in R,c \in C }M_{i,j} $$ I want to find the sets $$R,C \subset \{1,...,n\}, |R|,|C| = d $$ such that $S_M(R,C)$ is as big as possible. I suspect this to be a known problem. I am wondering if...
Given $\{\rho_i,v_i\}_{i=1}^N$, the densities and volumes of $N$ items, and $K\in \mathbb{Z}_+$. Let $v_0=1$ be the initial volume, and the initial mass is zero. The values $\rho_i,v_i\in \mathbb{R}_+$. For $S\subseteq [N]$, the corresponding average density is $$d(S):=\frac{\sum_{i\in S} \rho_i v_i}{v_0+\sum_{j\in S}v...
Let $G=(V,E)$ be an unweighted directed acyclic graph with a set $V$ of vertices and a set $E$ of edges. The all-pairs shortest path problem can be solved efficiently using the Floyd-Warshall algorithm. The new objective is to find a subset of maximum cardinality $S \subseteq V$ such that for every pair of vertices $v$...
I have two 64-bit numbers a and b which have a few properties: only 49 out of the 64 bits are used (15 bits are always 0), and the two number's binary representations are disjoint (a & b == 0). I am looking for a good way to hash the two numbers together into a deterministic 64-bit integer. Tabular hashing with randoml...
I have a system in which I need to be able to calculate the week number and day number from any Monday to the current date. Weeks can only be 1-4, then it starts over. So, if we are 5 weeks from the "Monday start date", then we're actually on Week #1 again. Days can only be 0-6. 1 = Monday, etc. Start date must always ...
Consider a quadratic function over positive integers. For example say a simple function of the form: $f(n)=3n+4n^2$ Now given any positive integer $C$ find two integers such that: $f(i)-f(j) = C$ What is the complexity of such problems? I tried searching for a bit but didn't find an answer..
(22)10 - (65)10= (?)2 Perform this operation using 2's compliment method.Use 8bit representation of numbers
I'm a new professor and working at a computer science college. I'm going to be responsible for giving a one-hour lecture to motivate my students to study automata groups. I'm very experienced as a teacher and I think that I'm a really good speaker, but no idea about how to make these topics friendly and attractive for ...
Given $N$ a whole number and a set $S$ of divisors of N, where no repetition is allowed. Decide if there is a combination of divisors with a product equal to $N$. Remove non-divisors from $S$. Remove duplicates from S by using set() in python. Treat $S$ as list of non-duplicates and sort from smallest to largest. This...
I'm a new professor and working at a computer science college. I'm going to be responsible for giving a one-hour lecture to motivate my students to study automatic groups. I'm very experienced as a teacher and I think that I'm a really good speaker, but no idea about how to make these topics friendly and attractive for...
in $\epsilon$-NFA (NFAs involving $\epsilon$ transitions) when we have $\epsilon$ transitions, I understand it as where can we go if we don't read any symbol from the input tape, then I think every state $q$ from which we are considering transition must belong to $\delta(q,\epsilon)$ because if we don't read anything, ...
I have read that Ethereum can theoretically support large documents (1 MB), but that such transactions would be very expensive and they risk not being validated. Most blockchain document services I have found assign a hash to a document then put the hash on the blockchain, but I am wondering if any blockchain ledgers e...
I have this language , le langage L={ a ^ s * b ^ t * c ^ m / where s >= t or s >= m } I cant find a grammar for this language please help me Grammar like S -> aS……
Prove\Disprove\Prove that equivalent to $NP=P$ or $NP\ne P$ given $L_1 \in P$ , $L_2 \in NP$ is $L_1 \cup L_2 \in P$? Obviously $L_1 \cup L_2 \in NP$ because NP is closed under union and $P \subseteq NP$ so $L_1 \in NP$ as well. I tried to assume in contradiction that $L_1 \cup L_2 \in P$ and build a $TM$ for $L_2$. Le...
Starting from a vertex of an unknown, finite, strongly connected directed graph, we want to 'get out' (reach the vertex of the labyrinth called 'end'). Each vertex has two exits (edge which goes from vertex in question to an other one), one exit is labeled 'a', the other exit is labeled 'b'. We have limitless 'memor...
See this answer first: Proving worst-case running time is in $\Omega(n^2)$ Understanding the linked answer for insertion sort leads to the following statement. Prove that the statement is either incorrect or correct. Statement: If you find $(y)$ for worst case running time of an algorithm using some possible worst inpu...
Benchmarking typically consists of getting the current CPU time, executing test code a large number of times, and then subtracting the new CPU time from the previous one. However when you benchmark code multiple times, the results tend to vary either slightly to significantly each time. You will very likely not get the...
For concreteness, here's the specific problem description: suppose we have a set $S$ of $n$ items $a_1, a_2, \ldots, a_n$ with weights $w_1, w_2, \ldots, w_n$ respectively. The goal is to select a subset of size $k$ such that the probability of selecting the subset $a_{i_1}, a_{i_2}, \ldots, a_{i_k}$ is exactly $\dfrac...
Is there support in the foundation of mathematics for dimensioned quantities? Those immersed in real-world software problems, continually confront the absence of dimensioned quantities in programming languages. Occasionally this results in a billion dollar disaster, such as the Mars Climate Orbiter. This absence appe...
From what I have seen on YouTube such as https://youtu.be/Kzx88YBF7dY?si=5j9tzjMFGCn3aCXW, We have: Halt: program x input ---> yes halt/ no halt and opposite : halt if Halt returns no halt, and, looping if Halt returns yes halt so the input of opposite should also be : program x input right? not just a single program. ...
So I recently learned about dual-port and multi-port RAM but I tried doing some research on modern RAM architectures and if they use it but I couldn't find anything on it.
I recently read about the “computer” built out of matchboxes designed by Donald Michie that could teach itself how to play tic tac toe. Here is the Wikipedia article about it: https://en.m.wikipedia.org/wiki/Matchbox_Educable_Noughts_and_Crosses_Engine I thought it looked interesting, so I decided to make a digital ver...
In Ben-David & et al.'s Understanding Machine Learning, the authors wrote: Let $\mathcal{H}_n$ be the class of axis aligned rectangles in $\mathbb{R}^n$ , namely, $$ \mathcal{H}_n = \{h(a_1,\dots,a_n, b_1,\dots, b_n) :\forall i,a_i \le b_i\} $$ where $$ h(a_1,\dots,a_n, b_1,\dots, b_n)(x,y)= \begin{cases} 1\text{ if }...
In the C language, there's the 2 similar-in-form but distict-in-meaning constructs: (type)value which is a casting, and (value), which is a grouping. How do a $LR(1)$ parser deal with this? I can think of a compiler that breaks syntax and semantic boundary able to disambiguate it by providing information about the mean...
I have read and understood various proofs, but have not been able to understand precisely why we require $S=\Omega(\log n)$.
From the internet: A finite-state machine is formally defined as a 5-tuple (Q, I, Z, ∂, W) such that: Q = finite set of states I = finite set of input symbols Z = finite set of output symbols ∂ = mapping of I x Q into Q called the state transition function, i.e. I x Q → Q W = mapping W of I x Q onto Z, called the outp...
I am writing a program in TI Code Composer Studio assembly-only empty project using the MSP-EXP430FR6989. The assembly-only empty project uses MSP430 Assembler Code Template for use with TI Code Composer Studio. Here is the project requirements: Use the MSP430 seven-segment daughter board to display and multiply two 8-...
Consider the scenario where we are given a collection of n integers. These integers are unordered and may include duplicates. Additionally, we have a set of m ranges, each defined by two integers representing the lower and upper boundaries of the interval. Similar to the integers, these intervals are unordered and dupl...
Are there any well established algorithms for finding an object's location in 3D space when we know its approximate distance to at least 3 known locations? Trilateration seems to be a well understood and popular topic and yet the only algorithms I've found come from fringe academic papers. I'm looking for a widely acce...
I have this E-R diagram Now im asked to add a entity named as "kiosk".At a kiosk up to 2 items of expedition of different category can be expedited.How do I add this in the E-R diagram? The category is a attribute of a item of expedition (top left corner) so how do you reference to a attribute of another entity of t...
In "Computational Complexity: A Modern Approach", it states that to prove that $NSPACE(s(n))\subseteq DTIME(2^{O(s(n)})$, we can do the following: By enumerating over all possible configurations, we can construct the graph $G_{M,x}$ in $2^{O(s(n)}$ time and check whether $C_{start}$ is connected to $C_{accept}$ in $G_...
I need to understand the motivations behind distributed computing, namely the fact to perform a computation by making physically separated computer, connected by communication links, work together. I am in particular interested in a review explaining their interest in the context of being more resilient to errors (I kn...
Let M be a non-deterministic Turing machine (NDTM) that accepts a language L if and only if: for each $ x\in L $ M doesn't accept x for at most m branch(path) calculations. for each $ x\notin L $ M doesn't reject x for at most m branch calculations. let M be a Turing machine non deterministic, with one or two optio...
I am trying to read about Alternating Turing Machines (ATM) that have both existential and universal quantifiers for all their internal states. Given that these models are conceptual, I tend to imagine that there is some form of reflection in terms of an advantage provided to the deterministic Turing Machine to provide...
According to this paper [1], higher-order Datalog is more expressive: ... we demonstrate that on ordered databases, for all k ≥ 2, k-order Datalog captures (k − 1)-EXPTIME. This result suggests that higher-order extensions of Datalog possess superior expressive power ... But how is it possible for higher-order Datalo...
Let’s say there are n fixed words permitted in some game of Scrabble, on an m x m squares board. We are assuming an idealized scenario where anyone can write any word on the board. Assume both players have an unlimited number of every word. Or, assume there is only one player, playing every round. Assume all the allowe...
I know that quasi polynomial algorithm is neither polynomial nor exponential. But I want to know if we find such algorithm for NP complete problem, will it be of any use? Or is there such algorithm exists already? I want to know why it becomes impossible to solve NP complete problems on regular machine. Is it because i...
While computers are very reliable, they can also do errors because of noise. I would like to have an idea of the rough order of magnitude of error per floating point operation in a computer, in a typical environment (in a typical office, like not deep underground for instance), with a reference to a good paper. I am no...
There is a famous equivalence between types of grammars and automatons. However when discussing recursive functions, we only consider equivalence of General Recursive functions with Turing machines. However primitive recursive functions are considered separately and I don't know any equivalence of that computational mo...
Given any connected undirected graph, we can convert it into a tree by "detaching" some edges from one of their endpoints. For example, consider the graph with the following edges: $$ (1) ~~~~~~~~~~~~~ a-b, b-c, c-a, c-d, d-e $$ We can detach the edge b-c from the vertex c (adding a new vertex c' of degree 1), and get ...
I'm curious about whether there exists a hierarchical or layered concept within the broad categories of algorithms, where they can be further divided into subcategories based on their characteristics and problem-solving approaches. Is there a clear association or inheritance relationship between different algorithm cat...
In the untyped lambda calculus (with variables, abstraction and application as the only constructors), we have a "pair" construct, given by $(a, b) = \lambda x, x a b$. The projections are then $\pi_i = \lambda x_1 x_2, x_i$ and there is a product function $ \langle f, g \rangle = \lambda x, (f x, g x)$. TL; DR; Do we ...
Instance: An undirected graph $G$ and a positive integer $k$ Question: Does $G$ contain a vertex cover of size $\leq k$ or a clique of size $\geq k$? Obviously, this problem is solved by polynomial reduction, but is it from Clique or Vertex Cover? And how? I've tried to reduce from both problems, but seem to get stuck....
I have the following Regular Expression (classic Computer Science definition of Regular Expression, not PCRE or modern computer language RegEx): {(ΣΣ)*00(ΣΣ)*}Σ ∪ Σ{(ΣΣ)*00(ΣΣ)*} It "feels" like it should be reducible to me but I can't see how. Is it reducible or am I just asking for trouble trying? The term in {} just...
Can every problem with a greedy solution be solved using dynamic programming? Why or why not? I'm not completely sure how to formally reason about this, my understanding about the structure of problems with a greedy/dp solution is quite handwavy. I found conflicting answers for this online, so I'm not sure what to trus...
I am looking to implement a general base conversion algorithm. I was wondering if there already exists such a thing, since I couldn't find one. Currently, I am able to go from int to int, but I also want support for negative, rational and, in principle, all complex numbers as both bases and the value to convert. Does t...
Is there a text that goes through some explicit examples of converting tree automata to tree regular expressions? I'm working through Comon's "Tree Automata Techniques and Applications", and I'm trying to work out some examples of regular expressions from tree automata. I'm convinced that the procedure given in the tex...
I heard hypervisors try to make this undetectable to the client .A good hypervisor will have zero latency and be transparent. Can a program detect whether it's running in a virtual machine by trying to create a VM underneath it (and failing)? Or is a VM more like a subroutine call, where the context is passed to it and...
Linear programming is the very common problem of computing $$\min_{Ax\leq b}c^\top x,$$ where $A\in\mathbb{R}^{n\times m}$, $b\in\mathbb{R}^n$, and $c\in\mathbb{R}^m$. This is an optimization problem, but it can be turned into a decision problem with an additional parameter $s$, by asking: Does a vector $x$ exist such ...
I'm looking for algorithms for stacking gage blocks. For those unaware, gage blocks are used in machine shops for measuring with high precision and come in sets something like this... Mitutoyo's 56 block metric set 1 0.5mm block 9 blocks from 1.001mm to 1.009mm in steps of 0.001mm 9 blocks from 1.01mm to 1.09...
I believe that I have a misunderstanding in the P=NP problem while I was thinking of how can it be proved in a non-constructive manner. We know that we can build an infinitely large text file with solutions for each of the solutions for every possible combination for that problem (in a similar manner of building a dete...
I encountered this problem here: https://theory.stanford.edu/~trevisan/cs172/ps05.pdf Consider the language $$PFTM := \{\langle M \rangle : \text{$M$ is a Turing machine and $L(M)$ is prefix free} \}$$ where L(M) is the set of strings accepted by M. (a) Prove that PFTM is undecidable. (b) Is PFTM recognizable? (c) Is t...
Consider two binary strings of two alphabets of length $l$, to find the hamming distance each corresponding bit needs to be compared. The runtime will be $O(l)$ or simply $l$ many comparisons are required. The goal is to reduce the number of comparisons with error less than $t$. My idea is to divide input strings into...
I am going through the fourth edition of Algorithms by Sedgewick & Wayne. On page 190 there is a discussion of lower bounds for the 2-sum problem, where the 2-sum problem is stated as: find all pairs of integers in an input array that sum to zero where each integer is distinct. In the lower bounds discussion it says: C...
I can't import datasets on RStudio on either my computer or Posit Cloud. I think it's because my laptop is too old to install packages necessary to import datasets on it, and not sure for Posit Cloud. Someone else imported it for me in a lab so I know it's possible, but when I try myself it seems like it only let me im...
Can someone explain for me how to build a XOR gate using 5 NOR gates? The thing I'm looking for is a proof similar to this: $A^B\ =\ (!A)B\ +\ A(!B)$ $=\ !!((!A)B)\ +\ !!(A(!B))$ $=\ !(!!A\ +\ !B)\ +\ !(!A\ +\ !!B)$ $=\ !(A\ +\ !B)\ +\ !(!A\ +\ B)$ $=\ !((A\ +\ !B)(!A\ +\ B))$ $=\ !(A(!A)\ +\ AB\ +\ (!A)(!B)\ +\ B(!B))...
I've started learning automata recently, and am struggling to figure out how to find a finite automaton that satisfies the following: Given DFA $A_1 = (Q, \Sigma, \delta, q_0, F)$, find a finite automaton $A_2$ such that $$L(A_2) = \{s \mid (s\cdot s) \in L(A_1)\}$$ Where $s\cdot s$ is the concatenation of $s$ onto its...
Given a composite number $P$ and two integers $x$ and $y$ such that: $x^2 = y^2 \pmod P$ we can factor $P$ using factor = $\mathrm{gcd}(P, x-y)$ or $\mathrm{gcd}(P, x+y)$. Now are there a similar relation where we are given multiple $(x_i, y_i)$ pairs such that: $(x_i^2 - y_i^2) \pmod P = r_i$ (where $r_i \neq 0$) We ...
Given two regular languages L1 and L2 over alphabet Σ, we define the operator RQ(L1, L2) = {w | there exists a word v in L2 such that wv is in L1}. The task is to determine the smallest language class among Regular, LL, CFG, and DCFG that certainly contains RQ(L1, L2). So, I started with the most restricted of the lang...
The question mathematically has been answered here: https://math.stackexchange.com/questions/4886084/guaranteed-graph-labyrinth-solving-sequence/4887473#4887473 To summarize, in an unknown strongly connected, directed graph in which all vertices have out-degree 2 (so from a vertex, we either go $a$ or $b$), we are plac...
Let A and B be NP-complete problems. Suppose I have established reductions from problem A to problem B and vice versa. Now, considering a specific instance (or set of instances) of problem A that can be solved efficiently in polynomial time, does this imply that the instances reduced to problem B can also be solved in ...
I am going through various virtualization concepts, and am trying to understand their benefits. Based on what I have read, Amazon EC2 is an example of server/hardware virtualization, and it helps us achieve high utlization of hardware. In the absence of hypervisor, we would have low utlization rate of hardware. Also, s...
Given : Profit[n]: a n item array indicating the profit on a day (may be positive or negative) Cost[n]: a n item array indicating the cost of holding a stock on a day (always positive) Task: Find $1 \leq i \leq j \leq n$ that maximize Total Profit divided by $\sqrt{\text{Total Cost}}$ from day $i$ to day $j$. Exten...
When extending the simply typed $\lambda$-calculus with products, we extend $\beta$-reduction with the rules $\pi_i \langle M_1, M_2 \rangle \to_\beta M_i$, which makes sense (cf. Sørensen, Urzyczyn, Lectures on the Curry-Howard Isomorphism, p. 87). But in some cases we also have the equation $\langle \pi_1 M, \pi_2 M ...
Are there ASICs (application-specific integrated circuits) optimized to solve the SAT problem, such as by the DPLL algorithm?
Let's say I have a group of people that meets every week. I would like to assign them to groups of 4. How can I assign these people such that, week after week, collectively, every group consists largely of "strangers"? For example, John, Paul, George, and Ringo being assigned together means John has been grouped with P...