instruction
stringlengths
35
29.1k
I have the following question to solve; Given $K$ BST consisting of $N$ total elements, show how you can create a Red Black Tree in $O(N\log K)$ time. I had the following idea but it falls on the last part of insertion into the red black tree; Get an inorder scan of each BST (total of $O(N)$) into lists. From each li...
If we consider the class fair division problem where we have a set of $n$-agents and a set $M$ of $m$-items, where each agent has a valuation function defined on the set of items $$v_i : 2^m \rightarrow \mathbb{R}$$ The problem is to find an allocation across the $n$ agents $(A_1, ..., A_n)$ such that no agent envies a...
I was just reading this question on the quantum computation stack exchange. It asks whether the HSP is in NP or not, and the answer notes that NP is a class of languages, not oracle problems. The answer then goes on to mention the at a special case of the HSP, where the mapping is a group homomorphism is in this oracle...
We have two integers, $n$ and $d$. They are coprime (the only positive integer that is a divisor of both of them is $1$). They may be implemented as something that fits in a machine register, or they may be "big integers". Together, $n$ and $d$ represent the numerator and denominator of a rational number. The goal is t...
Reading a paper, I have found an algorithm that uses binary search to find a number between $0$ and $n\in\mathbb{N}$. The stopping criterion for this binary search is that $t_2-t_1<\frac{1}{k^2}$ where $k>=1$ is a natural number and $t_2>t_1$. Then, it is said that the number of iterations of the binary search is at mo...
Consider n-dimensional linear classifiers, that is, subsets of R n that have the form {(x1, x2, . . . , xn)| a1x1 + a2x2 + · · · + anxn ≥ b} for some real numbers a1, . . . , an and b. Given as input two sets X and Y of polynomiallymany points in R n , show that there is a polynomial-time algorithm to decide whether th...
Why do we need the main function and can't we execute the code without it? Can't we just execute our code outside the main function by making our own function?
Given N integers L1, L2, ... , Ln ,we have a robot that starts at (0,0) moves north on integer grid for L1 steps, then it either continues in its current direction or makes 90 degrees right turn then moves L2 steps and repeats for all Li. Problem: Can the robot return to the origin?
Let us consider m clauses containing 3 variables each i.e. A1,A2,A3...Am . Let the total literals in consideration be n. Then each clause : Ai = (xr $\lor$ xs $\lor$ xt) where 1 $\le$ r,s,t $\le$n and each literal can take a boolean value or its negation. Our expression $\phi$ which we need to satisfy hence looks as fo...
How to remove left recursion in the following Grammar: S→Bb/a B→Bc/Sd/e Im new to this, below is the way I'm doing it: S-> Sd/a B-> Bc/Bb/e I replaced the values of S and B with Bb and Sd to make the grammar easier to deal with. Then: S-> aS' S'-> dS' / ε Is this the correct approach to do this ?
Given points $p_1,\ldots,p_n$ in $\mathbb{R}^2$, the task is to find an axis-aligned unit square containing the maximum number of points. I came up with and $O(n^3)$ algorithm as follows. Observation 1: For $n\geq 2$, there is an optimal solution containing at least two points on the boundary not lying on a line parall...
I recently discussed DMA and non-DMA with my OS professor. Here is my current understanding: disk controller has its own CPU, maybe own ISA, tiny program that simply handles reading from the disk (firmware) it is sort of "client-server" in that the main CPUs are the clients and the disk controller is the server, handl...
I need to efficiently find the intersections between a set of vertical line segments and a set of horizontal ones. The segments in both families can overlap (but there are no duplicates). Presumably this is done in time $O(n\log n+k)$ for $n$ segments and $k$ intersections. Can someone describe an ad-hoc solution or pr...
If we consider the complexity classes RP and BPP, then to show RPBPP = BPPRP my first thought is we need to use some kind of majority voting to amplify our success probabilities. The issue is I don't necessarily see how we can get from a two sided error to a one sided error. How would I proceed to do that?
Hello everyone i'm from Turkey and i'm 18 years old. I'll get university exam after a month. I want Computer Science department. But there is only one department for it and this department's score is very very higher than i can do. I wanna carier about Quantum Engineering and according to my research i need get Compute...
If we let a language L in {0,1}* be dyadic if for each x in L, and each index i with xi = 1, i is a power of 2, then consider the class of languages recognized by a polynomial time oracle machine with a dyadic oracle. Is this the same as the class P/poly? If we start with some language L in P/poly, then we can use the ...
The problem is implementation of specific halftone circle pattern algorithm, which should generate a bitmap image composed of black and white circles reflecting the halftones of the original image. When viewed from a distance, the image should display smooth shading, but up close, it should consist of only pure white o...
Hy everyone. I'm trying to write the SJF (short job first) algorithm NON-PREEMPTIVE for scheduling processes in C. I want to implement an algorithm that orders some processes by the burst of the processes. I get in input a list of "n" processes where I have the id, arrival time, and burst time for each process. It seem...
I am seeking a linear-time algorithm to determine whether a directed acyclic graph (DAG) contains at least one pair of incomparable nodes. Two nodes $u$, $v$ are said to be incomparable if there is neither a path from $u$ to $v$ nor a path from $v$ to $u$. I can't see a linear solution to this. We can do a DFS for each...
Let $A = \{a_1, \ldots, a_n\}$ be a set of numbers and $w$ be some number. Define $p_w^{A}: \mathbb{R} \rightarrow \mathbb{N}$ as $$p_w^{A}(r) = |\{i \in \{1, \ldots, n\} | r \leq a_i \leq r + w\}|.$$ Note that $p_w^{A}(\mathbb{R})$, the image of the whole $\mathbb{R}$ under $p_w^A$, is finite. Define $MRT_w(A) = \max ...
I need to make a container in which I can store (x,y) as pairs, and for a given number 'a', I have to find a pair (p, q) such that p<=a and q is maximum possible. Note the constraints: x>=1 and x<= 10^7; y >=1 and y<=10^5. I am solving this problem in C++. I tried using a set that stores pairs of integers. I was able t...
As far as I am aware, most functional programming languages today use a call-by-value eager evaluation strategy with some exceptions like Haskell. I am curious if it is possible for a language to have a mixed evaluation strategy: for example, a language where everything is evaluated lazily by default but some functions...
I have a problem that I'm struggling to solve or even name, I'd really appreciate any help or pointer to potential existing solutions. Suppose there is a connected graph $G$ and we are trying to find a spanning tree $M^*$ with the following property. Let $D_M(v)$ be the degree of node $v$ in an arbitrary tree $M$. The ...
In many references I find that the simply typed lambda calculus was introduced because the Kleene–Rosser paradox showed that pure/untyped lambda calculus was inconsistent. However, since it is untyped, the usual definition of inconsistency (i.e., that every type is inhabited) does not apply. Then, in what sense is pure...
I am trying to write down the generalized form of the finite automata which accept strings which contain as a substring an arbitrary string. Here is what I have come up with — I was hoping someone could tell me if I've made any mistakes (i.e., if there are any "bugs" in my "design"). Let $\Sigma$ be an alphabet. For an...
I'am trying to prove the following binary quadratic integer programming problem NP hard. $$ \min \frac{\sum\limits_{i=1}^m(u_i-\bar u)^2}{m}\text{ , where }u=Q x,Q\in\mathbb{R}^{m\times n}\\ s.t. \begin{cases} Ax\leq b, \ A\in\mathbb{R}^{m\times n},b\in\mathbb{R}^m \\Cx=d, \ C\in \mathbb{R}^{m\times n},d\in\mathbb{R}...
Show that $ALL_{NFA}$ = {$\langle M\rangle : M$ is $NFA$ and $L(M) = \Sigma^*$} is $\text{PSPACE-complete}$. I've manged to prove that the langauge is in $\text{PSPACE}$. Indeed, it is easy to see that $\overline{ALL_{NFA}}\in \text{NPSPACE}$ (the machine just nondeterministically guess a word rejected by the automaton...
We understand the exponential function to constantly grow, which we consider bad for a problem. By constantly growing I mean the ratio $\frac{f(n+1)}{f(n)}$ never tends to 1, where $f(n)$ is the exponential function. However, when this ratio tends to 1, we can roughly say that as problem size increases by a small amoun...
Preliminaries. Let $n,m,i,j,p,c \in \mathbb{N}$ with $n,m,i,j,p,c \geq 1$. Let our alphabet be $\{0,1\}$, with non-empty languages $ L_i \subseteq \Sigma^n$ and $ L'_i \subseteq \Sigma^m$. The other preliminaries are the same as a previous question: We follow the standard definition for deterministic finite-state auto...
We want to implement a data structure, which can store pairs of $(key, value)$ (where $key$ and $value$ are some numbers) and has the following interface: Add $(key, value)$ pair to a data structure (if such key is already in a data structure then ignore this operation). Remove $key$ from a data structure. Given a pai...
I am currently working through Sipser's Introduction to the Theory of Computation. In chapter 5, he defines that a Language $A$ is mapping reducible to language $B$, written $A\leq_m B$ if there is a computable function $f:\Sigma^*\rightarrow\Sigma^*$ where for every $w$, $w\in A \iff f(w)\in B$, where $f$ is called th...
I saw the book suggested here. Does Sipser's Introduction to the Theory of Computation cover the Chomsky hierarchy? I ask since, looking through a pdf copy of the book, I found no matches with "Chomsky Hierarchy", but perhaps it is covered with a different name.
Often in testing, if we have a function, for example: def add_one(x): return x + 1 we'd want to prevent regressions by saving a set of input/output pairs and asserting the output remains the same for the given input (e.g. [(1, 2), (100,101), (1000,1001)]). Is there a term to describe testing fixed points of a func...
What is a good book for learning computability theory that covers the Chomsky hierarchy?
I am trying to study a research paper about VQ-VAE: Neural Discrete Representation Learning, Aaron van den Oord, Oriol Vinyals, Koray Kavukcuoglu, NeurIPS 2017. I have difficulty to understand the value of embedding vectors $e_j$ in this part (page 3 from the research paper): The posterior categorical distribution $q(...
I'm working with CARDIAC (Cardboard Illustrative Aid to Computation) that is a model created at Bell Labs in 1968 to explain students how the computers worked with the Von Neumann architecture to create a new model for pedagogical purpose. But, I couldn't find an extension to parallel and concurrent computation, becaus...
I have rectilinear polygons present, and they are surrounded by grids(grey rectangle with dots denoting center) as shown in the diagram below. There are some areas where grids are not present - like the big grey and red polygons. The grids are perfectly stacked horizontally and vertically. I have with me the coordinat...
Let $A$ be an array of real numbers with a unique maximum element, such that $size(A)=O(2^N)$. Assume that we have an oracle that can evaluate a sum over any subset of indices of $A$ in $O(1)$ time. Using this oracle, is it possible to find the index of the maximum of $A$ in $O(poly(N))$ time?
I am pretty new to ML and have a basic but fundamental question. Let’s imagine we want to create a simple Sentiment Analysis model using Machine Learning not Deep Learning algorithms, so we need to have a set of handcrafted features for this classification problem. Let's say we have 2 features (F1, F2) for each sentenc...
An optimization problem can be described by two functions $f$ and $g$, such that: $f$ is a binary predicate representing the constraints: $f(x,y)$ is True if the output $y$ is feasible for the input $x$; $g$ is an integer-valued function representing the objective value: $g(x,y)$ is the value of the output $y$ for the...
I'm trying to convert a right regular grammar to an NFA. I understand that I need to create a state for every variable and add transitions according to the production rules. But what if there is a production rule where there is only a single variable on the right side and nothing else? Example: $A \rightarrow B$ Would ...
Consequence of $\mathsf{NP\subseteq BPP}$ to $\mathsf{NP\subseteq ZPP}$? clarifies $NP\subseteq BPP\implies NP\subseteq RP$. What about for $PP$? Does $PP\subseteq BPP$ imply $PP\subseteq RP$ and $PP\subseteq ZPP$?
Let $G=(V,E)$ be an undirected complete graph, where $|V|=n,|E|=m$. Let $w:E\rightarrow \mathbb{R}^+$ be an injective weight function. Prove that for any MST, the $n-2$ most heaviest edges are not in the MST. I thought about proving by contradiction; assuming such MST can exist, and then replacing its heaviest edge wit...
The rate at which a neural network learns something depends on the loss and the backpropagation functions,neural network with different loss and backpropagation functions learn differently at a different rate.However this makes me wonder can we calculate in paper the amount of time or the rate of time at which a neural...
Given two graphs $G$ and $F$ on the same vertex set $V$. Compute a sub set $\tilde{V}\subset V$ which' sub graph of $G$ is of maximum density and does not have any pair that is connected in $F$. Formally, find $$ arg\max_{\tilde{V}\subset V}\Bigg\{\frac{\big\vert {E(G)}_{\vert\tilde{V}}\big\vert}{\vert \tilde{V}\vert} ...
The formal definition of the pushdown automata according to Mike Sisper's book on theory of computation is as follows: . The transition function however only takes in one symbol from the stack (after popping it) and returns sets where each set only has a single letter from the stack alphabet. But later in the book, it ...
Recently I am training for an algorithm contest. One of the older textbooks for that contest contains this question: Generate all strings $S$ that contained the letters $\begin{Bmatrix}A, B, C\end{Bmatrix}$ only, and satisfy these requirements: The string's length (number of characters) must be exactly 100 No two ad...
Say I have boolean formula in form of a CNF(x1,x2,...) with $x_i$ being boolean variables. Testing the satisfiability of the CNF is the SAT problem, i.e. determine if there are $x_i$ for which the formula becomes True. So far I understand, this assumes that the variables are independent. But what if my $x_i$ are not in...
You are given $n$ lists. The $i$-th list contains $k_i$ subsets of $\{1, \ldots, m\}$. You are also given an integer $s$. You should decide whether it's possible to pick up exactly one element (that is subset of $\{1, \ldots, m\}$) from each list, such that the cardinality of a union of all picked subsets is at most $s...
Question Is it possible to find a solution to the weighted minimum dominating set problem, by solving a (related), unweighted minimum dominating set? Elaboration In essence, can one convert a weighted_input_graph into an unweighted_input_graph such that the minimum dominating set of the unweighted_input_graph contains ...
Let $\mathcal{I} = \{I_0, \ldots, I_{m-1}\}$ a collection of subset of some universe $U$. We want to find a partition $P$ of $\mathcal{I}$ of minimal cardinality such that the intersection of each set in $P$ is not empty. Is this, or the corresponding decision problem, a well known problem? I found many similar problem...
I have been reading up on the bin packing problem. In the bin packing problem, we are given $n$ items with sizes $a_1,a_2,\dots, a_n$ such that $$ 1 > a_1 \geq a_2 \geq \dots \geq a_n > 0 $$ The goal is to pack the items into bins such that each bin can hold any subset of items of total size at most 1, so as to minimiz...
Seeking an indexing data structure that is smaller than quadratic in space. As part of an NLP algorithm using word embeddings of 300-dimensions, I am trying to improve the speed of Word Mover's Distance (WMD). (Isn't everybody?) Computing the cost matrix is expensive, as it is size MxN (where M and N are the number of ...
NPO is defined to be the class of optimization problems whose decision versions are in NP. I would like to get the complexity class of optimization problems whose decision versions are in P. Is such a complexity class already defined?
I can reduce 3-Sat to the following NP-Complete decision problem: Let $S = ${0,1,...,s-1}, $D \subseteq S$ and $P$ be a multivariate polynomial in $n$ variables. Decide yes iff there exists $\vec x \in D^{n}$ such that $P(\vec x) \neq 0 (mod \ s)$. That got me thinking that I can make the problem seem much harder by r...
How can we find a walk with the minimal length starting from a vertex $v$, passing through all vertices and returning back to $v$? We allow vertices and edges to be repeated along the walk. The length of a walk is the number of edges it has, counting repeated edges as many times as they appear. I'm not sure if such a...
I wish to learn CO&A (computer organisation and architecture) from scratch via some toy system and its simulator. I found the following resource: Toy Machine developed at Princeton University. Toy Machine, however, is quite old and although a good starting point, doesn't quite capture some recent logic. So the question...
How would one design an algorithm to PAC learn linear threshold functions with random classification noise using membership queries? More formally, the learner has access to unlabeled examples from an unknown distribution $D$ on $X$ and membership query access to the target concept.
Random number generators generally fit into 3 categories IMO: ad-hoc designs serving as stub to be replaced by something else if this ever happens, considerate designs aiming at achieving statistical quality and usable in their respective application domain, cryptographic RNGs of various kinds and purposes needs to fe...
I was requested to draw the graph of a finite state machine whose language is $$L = \{ w \in \{0, 1\}: w \text{ has $2k$ ones and $3q$ zeros }\}$$ In other words, the number of ones must be even and the number of zeros must be a multiple of $3$. I have failed in my attempts to draw the graph of a DFA that satisfies thi...
The Hidden Subgroup Problem (HSP) is an extremely prevalent problem in quantum computation, especially for factorization in Shor’s algorithm. The problem is stated Given an oracle for some function, $f: G \mapsto X$, that is promised to satisfy $g_1 H = g_2 H \iff f(g_1) = f(g_2)$ But the HSP is often spoken of in te...
The following problem statement is given: Let $S = \{s_1, s_2, \cdots, s_n\}$ be a sequence of unique positive integers and $K$ a positive integer, where $K \ge s_i$ for every $i$ between $1$ and $n$. The goal is to find a subset of $S$ whose sum is maximum, subject to the constraint that the sum must be $\le K$. Writ...
The answer I found on the Internet is false. But my argument is that if I know that X is poly-time reducible to Y, which means I can use Y as a sub-routine to solve X, i.e., if I have a blackbox of Y that gives an answer to X and I am getting the answer in polynomial time (since X is in P), then the blackbox of Y must ...
Background Using a simplified Quicksort algorithm where the first element of the array is assigned as the pivot we get the following pseudocode for the algorithm: Quicksort($a$): (1) If length($a$) $> 1$, then 1.1) pivot $← a [1]$. 1.2) less $← a[a <$ pivot]. 1.3) equals $← a[a ==$ pivot]. 1.4) greater $← a[a >$ p...
I am self-learning a lot of Computer Science and Mathematics. I am using ChatGPT 4 to help me in this endeavor. Basically, if I like a set of lecture notes or if a book doesn't have solutions, I upload the relevant pages as pdf and convert them into LaTex code using Mathpix and then copy and paste the relevant sections...
Is the only reason for why a modern computer can't implement all computations is that the detailed specification of some algorithmic action (as a natural number) can be larger than what the storage space of the computer allows to process? I am trying to understand the difference in input implementation between Turing M...
I know this is a very specific question, but: Let's assume that someone designed a 1.1 approximation algorithm for the load balancing problem involving exactly 2 machines. After running the algorithm on a set of n activities, the final loads are 80 for the first machine and 120 for the second one. Is this possible give...
Consider the problem of finding a perfect matching for a graph $G$ as a constraint satisfaction problem where the variables are the vertices and there is just one global constraint (which does not depend on the edges of $G$): My formulation of it is: Variables: A random subset of $|V|/2$ nodes $V'$ Domain: $V \backslas...
I have a desktop PC with the CPU Intel I7-12700F with 180 TDP, the CPU fan Zalman CNPS10X extreme, and Windows 11 and my problem is that The CPU cooling causes much noise when simple tasks are being performed; opening directories or windows, opening or closing small programs such as Notepad, Calculator, web browser, or...
I was reading "Open Logic book", "Sequent Calculus". Given the fact that all antecedents must hold for at least one succedent to hold, I can't get rid off the impression that using a "comma" on the left side doesn't bring anything new, and I could simply replace it with "$\land$". For example, let's take: What prevent...
I am studying Turing machines and Turing completeness and just remembered I saw something called the Turing test. It seems that the Turing test (from Wikipedia) is a test of a machine's ability to exhibit intelligent behavior equivalent to, or indistinguishable from, that of a human. while Turing completeness and Tur...
In class, professor mentions that there are Stream and Storage devices. I mean to ask about Stream devices. I've also heard the terminology character devices. On a Linux VM, the corresponding terminal devices can be seen via the proc file system: $ ls -l /proc/$$/fd total 0 lrwx------ ... ... ... 0 -> /dev/tty1 lrwx---...
I have a data (from simulations) that is coming from something similar to a bifurcation diagram: it is a lower hemicontinuous correspondence (actually limit points of each branch is included), or in other words a set-valued function mapping a point in the domain to a (non-empty) set in the codomain such that the set is...
I'm learning some computer science and mathematics by myself. I know that proving theorems in ZFC is undecidable in general, but, is there a formal way to express how complex it is? Is it as complex as the Halting Problem, i.e., knowing if a TM halts? Where can I learn more of this (subjects, books, articles)? Let me k...
Here is a very closely related, but NOT a duplicate question. One time, I decided to test how long it takes to compute $2^x$ compared to $e^x$ in Python. I expected $2^x$ to be faster as in binary, the base computers use, you can just append 0 to the number 1 $x$ times. I entered into Python IDLE (Python's Integrated D...
While removing null production from cfg as below, S->ABC A->aA|^ B->bB|^ C->aaC|^ now as shown above we know that A,B and C all are nullable that makes S also nullable. like I'd do as below: S->ABC|AB|AC|BC|A|B|C|^ A->aA|a B->bB|b C->aaC|aa The question is how do I remove null from S? I tried ...
I am trying to understand two player (prover-Merlin and verifier-Arthur) interactive proof complexity classes and had a few doubts. As I understand, the classes $MA$ and $AM$ involve two players, where Merlin tries to convince Arthur about solution to a problem by sending messages such that if the proof is correct Merl...
I have the following virtual address: +---------+----------+----------+ + 7 Bit x | 13 Bit y | Offset d + +---------+----------+----------+ I now have the following task: 1. Of how many pages consists the virtual address space? 2. What size has one page? 3. How much memory can be addressed by one entry in the page tab...
How can I prove that !(ab)(!a+b)(!b+b)=!a* in boolean algebra? This is an exercise from a past paper of my teacher but I can't really find the way to the answer. I would appreciate some help.
How do single and multiple dispatch differ? In particular, I am wondering why some programming languages, both interpreted and compiled (such as Python and Java), natively support single dispatch but not multiple dispatch. Possibly a bit naive to think so, but isn't multiple dispatch a straight-forward generalization o...
My CNF file ends with many pairs of clauses that represent that two variables are equivalent (eg: -3 7, 3 -7, 5 -11, -5 11, etc.). Do most SAT solvers automatically pre-process these and replace every occurrence of one variable by the other (eg: replace every 7 by 3, and every 11 by 5), or should I first do the replace...
Let $X_1,...X_T$ be i.i.d. random variables supported on the $[-1,1]$ segment, with an expected value of 0 and positive variance. Let $H_t = | \sum_{i=1}^t X_i|$, and let $H = \max_{1\leq t\leq T} H_t$. I'm interested in lower bounds on $\mathbb E[H_T]$ and $\mathbb E[H]$. Any ideas? Using Jensen's inequality, upper b...
I came across this definition in my book but I'm not sure that I understand it correctly. Isn't this the same as saying: $\langle S, s\rangle \rightarrow s = \langle S, s\rangle \rightarrow s$ implies that $s=s$? Why do they use a different prime symbol here even though they are the same statement $S$ being executed ...
The Maximum Acyclic Subgraph (MAS) problem is: Given a directed graph $G = (V, E)$, find the largest subset of edges which are acyclic. In this paper the authors state the following algorithm: A simple randomized algorithm achieves a factor 1/2 for this problem: Simply pick a random ordering of the vertices. In fact...
At work I'm looking for a data structure that supports the following operations: $$insert(X, A, B)$$ $$delete(X)$$ $$glb(C)$$ $insert$ adds the range $[A, B)$ into the data structure with value $X$ associated with it AND shifts all ranges after (exclusive) $A$ by $B - A$. $delete$ removes the range associated with $X$....
Sorry for making up a name for the thing, the main reason for posting this question is that I can't find out the name of the problem that i'm thinking about. I was messing around with min/max DP stuff, and when looking at a knapsack problem I wondered if you could apply DP if each item affected the total value of the o...
Let $M=\left\langle Q, \Sigma, \Gamma, \delta_M, q_0, q_{a c c}, q_{r e j}\right\rangle$ be a TM whose reading head can only move to the right. Prove that $L(M) \in R E G$. For simplicity you may assume first that for all $q \in Q$ it holds that $\delta_M(q, \sqcup) \in\left\{q_{a c c}, q_{r e j}\right\} \times \Gamma ...
I'm working on implementing a puzzle board game called Double-Choco published by Nikoli magazine Where the board is a 2-dimensional matrix with cells that are either white or gray. The goal is to divide the grid into blocks by drawing solid lines over the dotted lines. Each block must contain a pair of areas of white c...
Suppose I have an acyclic directed graph of Nodes which subscribe to Events. When an Event callback is activated for some Node, the Node's internal update() method is called. Then, because the Node has updated(), it needs to call all of the Nodes it is pointing to and tell them to update() as well, and this process rep...
My objective: is to have a robot follow me. (I'm using an arduiono bot for this) So I started off what some code that wasn't so dynamic. Essentially I had no issues with the robot following me (holding a cardboard because these robots need a good flat surface to see) when I was right in front of it, but when it turned ...
The following post discussed how to convert(approximate) NURBS curve into cubic Bézier curve: Convert NURBS curve into Cubic Bezier Curve I am trying to come up with an algorithm that converts(approximates) NURBS surface into cubic Bézier surfaces(patches), here is my thought(from the post): convert NURBS to piecewise...
I want to define a DPDA based on a set of rules: one or more uppercase letters ('A'-'Z') is a formula. one or more lowercase letters ('a'-'z') is a formula. if X and Y are formulas, then this is a formula: X followed by '&' followed by Y. if X is a formula, then this is a formula: 'μ' followed by one or more lowercase ...
I've run across an interesting problem at work that I'm not quite sure how to grapple. Broadly, there is a suite of of $n$ tests to ensure the quality of a product. However, the tests are both time-intensive and frequently run so it's necessary to tradeoff confidence for performance. Approach 1: knapsack For any test $...
The method to get the sat result is kind of straightforward, you can use some search algorithms like heuristic search to get a solution. But how does z3 get the unsat result like x < 2 && x > 2 I searched for some articles related to z3 but didn't don't know how. I would be very grateful if someone could give me the an...
When hand-manipulating algebra DNF (sum of products) is easier than CNF (product of sums). Possibly because factoring is more difficult than expanding. So why is it the opposite for computational boolean algebra? Perhaps one argument is that in CNF one can show that an expression is false by showing that one clause is ...
In the (unweighted) minimum k-cut problem, the goal is to partition the nodes in a given graph to at least $k$ subsets, such that the number of edges between different subsets is as small as possible. I am interested in a variant in which the number of subsets is not fixed in advance, but there can be at most $t$ verti...
I have an easy question about the DPDA. Could you read an input and push a different symbol to the stack. An example would be A transition from q1 to q2 where read input is v pop is epsilon(empty string) and push is x Both v and x are symbols
Give a real world, normalized example where table T1 has primary key (A, B), T2 has primary key (B, C) and T3 has primary key (A, C) and table 4 has a primary key (A, B, C) where (A,B) is a foregin key on T1, (B, C) is a foregin key on T2, and (A, C) is a foregin key on T3? The motivation is this form is allowed in a r...
r1 and r2 both are assigned 0.05 initially. If r1 is incremented by 0.01 in this way "r1 = r1 +0.01" we have 0.060000000000000005 as answer not 0.06.
I think the best way to explain my question would be to have sextuple (regular, context-free, Turing-recognisable, decidable, P, NP).were you fill out 1 for promblem which lies into that section, would an np problem such as chess be only 1 for NP or would also fall in decidable? Some other examples: The regular problem...