instruction
stringlengths
35
29.1k
Let's say we have boolean functions $f_1, \cdots, f_n$, each of which operates on pairwise disjoint variables (i.e. the variables for each function are unique to that function). Then, how can we show that $L(f_1 \oplus \cdots \oplus f_n) \geq \frac{1}{2}\sum_{i = 1}^n L(f_i)$ (where we use the De Morgan basis)? Here, w...
They say that protein folding is an NP-hard problem, meaning that if we could figure out how any protein folds, we could solve any NP problem in polynomial time. However, doesn't this basically destroy the field of cryptography? Suppose I want to factor a large semiprime. Couldn't I convert it into a protein folding pr...
I am digitizing my old books and I was wondering if I needed to buy OCR software, or if the OCR software that came with my printer (Epson) would be sufficient. This made me wonder if there were any programs or software that tests the accuracy of OCR. I imagine the way this would work is you would manually enter all the...
I understand how backpatching works during intermediate code generation, but I do not understand why it is needed. A common argument for using backpatching during intermediate code generation is as follows: Suppose the intermediate code generated is: goto L1 ... L1: When goto L1 is generated, the actual address of t...
I have a computer architecture exam tomorrow and my professor gave us some questions for practice. I just need to clear some confusions. The first question is: "a) In a Direct-Mapped Cache, modify the following Page-to-Cache address translation circuitry (attached with the post) if the Page Capacity is 1 KiWords and C...
If there is no calculus,we can't solve a problem like “surface area”. Is there some math problem that can be solved thanks to category theory? If there is no such math problem, it means that category theory is an “abstract theory”:it can explain things clearly, but without it, man can solve the same problems too, maybe...
I have a question about the DPDA. Is it possibly to have two transitions that read the same input but do different in the stack? An example would be A transition from q1 to q2 where I read input ( pop v and push nothing to the stack. And the second transition is from q1 to q3 where I read input ( pop x and push nothing...
We consider languages over the alphabet {a,b,c}. Given a character t in the alphabet and a non-negative integer j, by t^j we mean the string consisting of exactly j occurrences of t. Now let m be an unknown but fixed positive integer in the following language definitions: L1 = { a^n a^n | n <= m } L2 = { a^n b^m | n > ...
I'm doing Neural Architecture Search (NAS) by varying the number of layers and neurons per layer for a neural network (connections are feed-forward throughout), and then training it on a fixed task to test its performance. The end goal is to perform topological data analysis (TDA) on the best and worst architectures (g...
I know that by definition, all NP problems can be reduced to NP-Complete problems. But does that also applies the other way around? Can all NP-Complete be reduced to NP problems? My understanding is that it cannot be done, since that would mean that both are equally complex, therefore NP=NP-Complete. But the answer to ...
I want to prove that if a graph is 2-vertex-connected, then it can be produced by $K_3$ (the simple triangle), using only edge division ("splitting" an edge, $(u,v)$, by creating a new vertex, $x$, deleting the edge $(u,v)$ and adding the edges $(u,x),(x,v)$) and edge addition (just adding any edge). I want to prove th...
Can you enumerate the set of all words over a finite alphabet?
I have a list of $n$ items, where each item gives a score to every other item, so I get a $n\times n$ square matrix $M$ of scores. Each score is a natural number. Items also score themselves. Example for $n=4$: $$ \begin{array}{c|lcr} scores & A & B & C & D \\ \hline A & 3 & 3 & 9 & 11 \\ B & 7 & 1 & 12 & 5 \\ C & 11 &...
I need to create a randomized function between two participants, 1 and 2. The two participants have both n bit sized strings, and they want to determine whatever they have the same strings. 1 and 2 can communicate using only log(n) bits. The probability of error should be at most 1/3, but the function can be run multip...
I came across a modification of the classic house robber problem where there is a cost to robbing each house, and we want to maximize the amount robbed using the array (exactly as in the original problem) but with the added constraint that we now have some array C, and C[i] is the cost to rob a particular house. We do...
A colleague and I with pretty low-grade practical backgrounds decided it's time to try learning theory. This question is asked in a slide-deck he tracked down somewhere or another online without an answer to go with it. We're both leaning towards a simple disproof by Counter-Example: $A = \{a,b\}$ $B = \{ab,a,b\}$ But ...
I hope this is the correct subpage of SE, if not please direct me to the more appropriate place. Imagine the following scenario: You are put into a random but known position inside a given maze. The maze contains, in addition to walls (█) and pathways (.), the following things: R - A refresh point which is single use ...
K = {<J, a, b, c> : J is a Java program, a, b, and c are integer variables declared in J, and throughout the execution of J, a never has the same value as b and a never has the same value as c}. I'm aware the problem is not actually decidable as I performed a reduction from ATM (or halting problem), which proves it is ...
Suppose I have already sorted an array $a$ of length $N$, each element having its position index into the sorted result recorded together with the element. Now I randomly sampled a sub-array $b$ of the original array $a$ without putting back (that is, no duplicated elements). Since the position index is recorded togeth...
I found the following question in my book and I have no clue on what the answer should be: What is the condition on search graph so that BFS Algorithm for graph and BFS Algorithm for tree generate and expand identical nodes in the same order? Please Note you don't have to write a proof as I will prove it myself and p...
Although I understand the definition of batch processing (a method of running software programs called jobs in batches automatically) and some applications of this system (bank statements and payroll and timesheet processing), how do emails use this system? I saw that emails use this system, but how are emails done in ...
$FPT$ is the set of parameterized problems that are fixed-parameter tractable. If $L_{w,h}$ is the language associated to boolean circuits of weft $w$ and depth $h$, then $W[t]$ is the set of parameterized problems that can be fixed-parameter reduced to $L_{t,h}$ for some constant $h$. (I know that there are multiple e...
I want to find how many shortest paths are there from Node A to node B. For example, let's say we have a graph with 3 nodes and 3 connections: from 1 to 2 weight 5 from 1 to 3 weight 11 from 2 to 3 weight 6 The answer is 2. Also I should keep track what vertices were visited for every path. In the example above, I woul...
I would like to know if there exist some complexity classes that are defined according to the integrality gap of their problems? In particular, is there a class of problems for which their integrality gap is unbounded? Where by unbounded integrality gap, I mean an integrality gap that is equal to infinite, where the va...
From OSTEP Chp. 43: The imap is a structure that takes an inode number as input and produces the disk address of the most recent version of the inode This makes sense to me as a solution to the problem of LFS scattering needing to keep track of inodes. It could live on a fixed part of the disk, of course. Unfortunat...
Let's say we're some function problem, $R \subseteq \Sigma^* \times \Sigma^*$, where $\Sigma = \{0, 1\}$ and some oracle $O_R$ that solves $R$. Now, we're given some language, $L \subseteq \Sigma^*$ and an associated oracle $O_L$ that solves $L$. We say $R =_{poly} L$ if a machine equipped with $O_L$ can solve $R$ AND ...
Algorithm fairness is the field of research aimed at understanding and correcting biases like these. It is at the intersection of machine learning and ethics. Specifically, the field includes: Researching the causes of bias in data and algorithms. There are several ways to define fairness. I am interested in the indivi...
You want to organize a party and invite as many of your N friends as possible so that the following condition is met: at a party, everyone invited must know at least three other guests and must not be familiar with at least three other guests. The input to the problem is number N and the list of pairs (i, j) where i an...
My lecture notes for $T$-joins states: If $T = V$ then $T$ -joins of cardinality $V/2$ are exactly the perfect matchings of $G$ = $(V ,E)$. So, the minimum weight perfect matching problem can be reduced to the minimum weight $T$ -join problem by adding a large constant to each edge weight (to get a degree of 1 for eac...
"Abstract": I have recently crafted a new algorithm for constructing code trees which I believe are optimal (the same thing that is constructed using Huffman's algorithm, at Wikipedia). It is based on one observation which is in form of an illegal property (i.e. code trees with that property are not optimal) and severa...
I have a question about an "apparent" contradiction I found in my lesson notes on Application Order Reduction (AOR) and the Church-Rosser Theorem (CRT). I'd like to emphasize that I'm not suggesting there's a real contradiction, and it is most certainly just my lack of understanding of CRT at issue. Ok here goes. The C...
I know this post. But I still have no idea to adapt the bucket sort algorithm to handle input with a gaussian / normal distribution. Can someone provide me a Pseudocode / Python code for that? So far I tried the following, but sadly it does not work, and I don't understand why. def bucket_sort(numbers): mean = sum(...
I want to learn more about parsing techniques, and to do that I'd like to start with the simplest algorithm, understand its limitations, and progress from there. From what I've seen, the best candidate so far is LL(1). Is this correct?
Find a Grammar G, so that L(G) = {a^i b^j c^k | k = i*j ;i, j ≥ 1} Hello, I have difficulties solving this. I had a similar exercise, where the k was i+j, which was easier, because the solution was to just add a c for every a or b. But I am having real trouble with this one. I am guessing Cfgs wouldnt be enough here, b...
I have seen a proof by contradiction for the uncomputability of Kolmogorov complexity. The idea the basically the same as in the proof for halting problem (i.e., there are cases that lead to Berry paradox example). However, I would argue that since there are infinitely possible ways to interpret a given string, this fa...
Given a string of characters (say a, b, ...) I want to wrap those characters by tags <a>...</a>, <b>...</b>, and so on, so that for each character the innermost tag wrapping the character should match with it. For instance, considering a string aabbaaca, we may have <a>aa</a><b>bb</b><a>aa</a><c>c</c><a>a</a> (naive w...
I have read the series of papers about "the structure of claw-free graphs" (https://doi.org/10.1016/j.jctb.2008.03.002). Here the authors used the trigraph, that is the adjacency relation contains three types: 1 strong adjacent, 2 strong non-adjacent, and 3 semi-adjacent. If two vertices $u$ and $v$ are strong adjacen...
Is there anything known about the hardness of Vertex Cover on the subclass of comparability graphs? In particular, is it known whether the problem is still NP-hard? Related Results: In "Modular decomposition and transitive orientation, McConnell & Spinrad, 1999" the authors show that the problem lies in P for co-compar...
We are given an array of size $n$ (it is not specified if we have an integer array, a specific range or any other assumptions), which might be unsorted, and a real number as a constant $k<1$. We need to prove or disprove that it is possible to output the $\lfloor n^k \rfloor$ smallest elements of a sorted order, in $O...
In PRIMES IS IN P paper, page 6 under Time Complexity section, authors have mentioned "In these calculations we use the fact that addition, multiplication, and division operations between two m bits numbers can be performed in time O∼(m)". What is O~(m)? -I am aware of O(m) notation. How is multiplication and division ...
Given a set of input strings, how do I find a shortest string S so that all input strings appear as a substring of S? for example: foobar + bar -> foobar foo + bar + rfo -> barfoo I guess it's related to graphs, but don't know how to solve it. first check all the "substrings", for example, "bar" to "foobar". Remove "...
I'm doing a review of sorting algorithms and trying to self-learn how to prove them as well. The foundation of the quicksort proof is intuitive enough if I'm assuming that the recursion holds - but you also need to assume that the partitioning algorithm works as well. I'm having trouble approaching an inductive proof f...
Suppose $2$ bits are used to encode a message, A and B. If you know $A$ is $1$, you have one bit of information. If you know $A\land B$ is $1$, you have two bits of information. If you know $A\land B$ is $0$, you have $0.415$ bits of information. When is this number ever useful? P.S: The formula for calculating the i...
I'm trying to create a game but I am having some difficulties in coming up with a suitable algorithm for my problem. I have elements from 1 to n and I am trying to cover all of the elements using the minimum amount of elements as possible. Each element can cover an amount of elements to the left (x direction) and an am...
There is a number of questions on this website about the reversal of regular languages: Closure under reversal of regular languages: Proof using Automata Proving that the reversal of a language reversal is that language etc. I was wondering what was this concept useful for. Does the fact that the reversal of a regula...
So I need to design an algorithm for the following problem: Suppose we need to build an optical fibre network for 20 cities. We are given a distance matrix of the cities which tells us which cities are connected so that we can make a connection between them and a cost matrix which tells us how much each connection cost...
Over the alphabet $\Sigma=\{0,\ldots,9,/\}$, is the following language regular: $$L=\left\{x/y/z:z=\mathrm{str}\bigl(\mathrm{int}(x)+\mathrm{int}(y)\bigr)\right\}$$ where $\mathrm{str}$ maps an integer to its decimal representation, and $\mathrm{int}$ does the opposite thing. It contains $0/0/0$, $10/34/44$, $1/999/100...
Let $A$ be a language and define $$ CYCLE(A)= \{ yx | xy \in A \} $$ I need to prove, or disprove, $ A\in LSPACE \Longrightarrow CYCLE(A)\in LSPACE $. First I tried to prove $CYCLE(A) \le_{L} A$ which if true means that if $A\in LSPACE$ then $CYCLE(A)\in L$, hence I tried to define a log space transducer $M$ that compu...
I'm starting to think there's no possible solution to this problem, but before jumping to conclusions I want to confirm it with collective knowledge. Let's imagine that there's a 2D grid, where S units need to go to T points, but the caveat is that going through a known/explored path has a lower cost than going through...
Several algorithms for sparsest cut (and other kinds of balanced cuts) in planar graphs have been published, like for instance: Finding minimum-quotient cuts in planar graphs, James K. Park, Cynthia A. Phillips, 1993 Sparsest cut in planar graphs, maximum concurrent flows and their connections with the max-cut problem...
How should I go about creating a single-tape Turing machine for the following language: $$ x_{1,2} = \bigl\{ (a\#b) \mid (a,b) \in \{0,1\}^* \text{and a is a substring of b or a is equal to b} \bigl\} $$ Some strings that should be accepted are: 10#11011 1101#1011010101 000#1001011000 111#111 Some strings that shoul...
I need to construct a Markov algorithm as a set of an ordered rules which will recognize a language $L = \{ww |w \in \{a,b\}*\}$ and give $$\begin{cases} Y, \: \text{if given word is in L} \\ N, \: otherwise. \end{cases}$$ Is there a solution for this problem? UPD. Omitting the formalities Markov Algorithm is an order...
I came across this problem while studying the FFT, but I have no idea how to solve it. Can anyone help?
Refers to: https://en.wikipedia.org/wiki/One_of_These_Things_(Is_Not_Like_the_Others) Some of the actual games The idea is that there are four different objects, but one in particular stands out from the rest. I've always said that I didn't think AI would ever be able to this, that this is something that kids instinctu...
I need to prove or disprove that for all languages in $R$ there is a reduction to all languages in $P(Σ^*)\backslash RE$. And I'm having trouble to figuring out the solution, especially with dealing with the trivial cases.
When my professor introduced regular expressions, he said that the empty string is the simplest regular expression, where it matches everything. How can this be true? I would think the empty string matches nothing, but perhaps I have an incorrect Computer Science understanding of what "null" or "empty" means.
I'm taking some college courses and they have so much math. Why is that? I'm very good with computers already software and a little bit of hardware and I fix other laptops/Desktops Linux Boxes, Macs etc.. Is this normal or is it just a requirement to get a good job?
Let $P$ be a constraint satisfaction problem with $n$ variables, each with the same finite domain $D$, and with $m$ > 0 constraints, where each constraint is an $AllDifferent$ constraint of arity $k$, for some fixed $k ≥ 2$ I'm trying to prove/disprove the following statements: If $|D|$ is equal to the treewidth of th...
My problem of understanding is how to create a new a before the b's if you create new c's. Hopefully someone can help me out.
I am trying to look answer for this question of toc please help me find the answer. The question is : Construct epsilon NFA(Non deterministic finite automata) for regular expression (0+1)*1(0+1)
Given a graph $G=(V,E)$ and any edge $(u,v) \in E$, let us denote by $G_{(u,v)}=(V,E\setminus\{(u,v)\})$ obtained from $G$ by removing this edge. I am interested in the difference between the average distance in $G$ and $G_{(u,v)}$ (or equivalently the sum of all distances in these graphs). This value is a feature of t...
Consider the following algorithm $A$ to 6-color an rooted tree within $\log^{*}n$ rounds in a distributed system: 1: Assume that initially the nodes have IDs of size $\log(n)$ bits 2: The root is assigned the label $0$, and each other node $v$ is assigned $c(v) = ID_v$ 3: Each other node $v$ executes the following: 3.1...
Here is the Question : The hit ratio is the percentage of times that a page number is found in the Translation look-aside buffer (TLB). An 80% hit ratio means that we find the desired page number in the TLB 80% of the time. Suppose we have a hit ratio of 70% and 40 ns is needed for TLB, where main memory access time is...
I have the following problem and I am wondering if it is NP Hard or not. Let $A$ be a binary matrix whose rows and columns are indexed by the sets $\mathcal{I}=1,...,m$ and $\mathcal{J}=1,...,n$. A rectangle is a set $R=I\times J$ with $I\subseteq\mathcal{I}$, $J\subseteq\mathcal{J}$ and its value is defined by $$f(R) ...
Trying to solve the zero-sum problem described here, where two opponent players at each turn can choose to collect 1, 2 or 3 stones with different values, with the objective of getting more points at the end of the game (and assuming each player is playing optimally). All presented solutions based on recursion suggest ...
We need to partition an undirected graph into connected subgraphs of size between $2$ and $k$, where $k$ is an integer. When $k=2$, the problem is equivalent to the perfect matching problem which is known to be solvable in polynomial time. When $k=3$, the problem is similar to the partition into triangles problem, whic...
Define: RE = {L : L is recognizable by a TM}, R = {L : L is decidable by a TM}, and coRE = {L : L-complement is recognizable by a TM}. The question is: Does the complement of coRE equal RE? I know that the answer is false, but I'm not sure why my proof is wrong:
There is a well-known problem of the best time to buy and sell stock. Assume now we have two arrays, SELL and BUY. Each time SELL[i] > BUY[i]. Assume we have initial budget B, and we can buy any amount of stock bounded by our budget. We want to determine the maximum profit we can reach using the best strategy. I've tri...
I've lately been struggling to write correctness proofs for various algorithms, even when it is "obvious" to me that the algorithm works and is correct. For example, take the following problem: Given a binary string $s$ of length $n$, you can perform an invert operation on index $i$ (0-indexed) which inverts the prefix...
Consider the language $$E_{T M}=\{\langle M\rangle: L(M)=\emptyset\}.$$ Prove that $E_{T M} \in \text{coRE} \backslash\text{R}.$ I proved that $$E_{T M} \in\text{coRE}$$ using Turing machine I built which recognizes the completement of the language. What left is to show that it is not in $$ R$$ Any suggestions how can ...
Suppose we have $N$ points on $XY$ plane, ie. $(x, y)$ and $x, y \in Z$ and multiple queries where each query is of the form $y = mx + c$ and $m, c \in Z$. Is it possible to count number of points that lie on the given line more efficiently than $O(N)$ per query? I believe some preprocessing might help or some data str...
Can a CFG parse tree have a root other than starting non-terminal S? Except for the cases when tree has a height equal to zero and contains only one symbol from the main alphabet.
I want to find areas in a binary image that correspond to long and thin curves. In the example below, structures thinner than 3 pixels but longer than 20 pixels are highlighted. Observe that the bottom-most line is split because it locally comes in contact with the Data Matrix code. The structures need not be straight,...
given this lanauge: $L=\left\{\langle M\rangle\right.$ : there does not exist $\mathrm{w} \in \Sigma^*$ such that M rejects $\left.\mathrm{w}\right\}$. how can I determine whether it is in $R, R E \backslash R, \operatorname{coRE} \backslash R$, or $\overline{R E \cup c o R E}$? I tried to prove the it is in $coRE\back...
I'm confused by the use of the expressions "computable problem" and "computable function" in the context of computability theory. Are they refer to the same thing or are there differences?
I am studying for my final exams in complexity theory and I came across a graph problem which I cannot fully prove that it is NP-complete. Its gist is the following: Assume that you have a weighted directed graph, where the weight of each edge is the travel time between the two corresponding nodes. There are goods on ...
Since functional completeness is a kind of universality, there might be deep connections to other universal phenomena like Turing completeness.
I have 4,500 ($N$) unique items, and I want to auction each one off to the highest bidder (break ties arbitrarily). Each item has $T$ binary traits. Since it is too complex for the $B$ bidders to specify a bid for each individual item, instead the bidders express preferences in the form of "I am willing to pay $x$ for ...
In pure aloha the if one frame is been transmitted and another is send during the transmission then the whole frames get destroyed. Vulnerable time is the time period where there is the chance for collision. But why is it set to 2*Tp where Tp: Transmission time I watch some you-tube it said It is 2*Tp because we have t...
To prove that a problem is NP-complete, one has to show that it is both (a) in NP and that it is (b) NP-hard by reducing a known NP-complete problem to it in polynomial time. Regarding the reduction, I understand that the instance of the known NP-complete problem must be arbitrary to avoid loss of generalisation. Does ...
I am trying to understand an algorithm for solving Closest String using bounded search trees, as found in Parameterized Algorithms (Cygan et al., 2015). Assume we have a set of $k$ strings $x_1, ..., x_k$ all of length $L$ and an integer $d$. The problem is to determine if there exists a string $y$ such that $d_H(y, x_...
I'm a young programmer that was interested by machine learning. I watched videos and read articles about the theory behind simple neural networks. However, I can't manage to set it up correctly. I've already managed a simple linear regression AI but I can't manage to make it deeper. I wanted to make An AI that could ac...
I have a table like this (more specifically a nested dictionary) img a b c d e img1 0 0 1 0 1 img2 3 1 0 0 2 img3 4 0 0 0 1 img4 2 2 0 0 0 img5 0 0 0 0 2 img6 2 2 0 0 0 img7 1 0 0 1 0 img8 0 1 1 0 1 img9 0 0 0 0 0 img10 0 1 0 0 0 ..... … I need to add all the column names upto a thre...
I do not know if this question makes sense BUT AX has two halves al and ah but the higher halves of EAX and RAX are not addressable. When IMUL instruction is executed e.g. IMUL r/m16 the os uses ax and dx registers: DX:AX = AXr/m16* This made me question why is using two registers necessary for this instruction and Why...
this is a question I got from a test that we had before Let there be X, a subgroup of languages above $\Sigma $ such that X isn't empty nor all of the langauges in $\Sigma $ we need to say if the language L = {< M >| L(M) $\in$ X} is decidable. In the answer they said that there is an X, which is X = $P(\Sigma^*)/L^c_{...
I am trying to learn about formal languages and I was wondering how I would go about defining the language that contains all strings which have matched parentheses and this is the definition I came up with — $L = \{(x*)|x\in L\}\cup\{\epsilon\}$ Here, $($ and $)$ denote the literal characters '(' and ')' respectively. ...
I'm looking for a directed graph data structure where each node is unique and contains a set of elements (at least one). Each node must contain all elements from nodes pointing to it so it possible to walk from each root node and visit all supersets. I actually only need insert and walk operation, but I struggle to co...
I've been stuck with this problem for quite a while now, and after reading so many papers I'm unsure whether this is even possible. The problem is quite simple: Given $G = (V, E)$ an undirected graph, find the minimum number of vertices such that their removal from $G$ leaves us with a graph of maximum diameter $2$ (th...
I've been working on Quantum Circuits for a 1.5 months. And firstly i've created Full Adder in Quantum Circuit. And first times i was creating Full Adder with too Qubits. But last week i created another circuit like that: And code here: def LessQubitAdder(X, Y): xBin, yBin = DecimalToBinary(X), DecimalToBinary(Y) ...
My goal is to find the local minimums of a smooth multivariate function $f_t(\vec y)$ for multiple values of $t$. I have created an algorithm $foo(t,\vec x)$ which returns the results of Newton's Method (by "results", I mean that $foo(t,\vec x)$ returns $\vec a$, where $\vec a$ is a local minimum for $f_t(\vec y)$) on ...
Given this shell sort algorithm implementation: void shell(float ∗a ,int l ,int r) { int i, j, h; for ( h = 1 ; 3∗h +1 <= r−l; h = 3∗h + 1 ); for (; h > 0; h / = 3) { for (i = l+h; i <= r; ++ i) { for (j = i; j >= l +h && a[j] < a[j−h]; j −= h) { swap (a+j−h , a+ j ); } } } } I want...
I am trying to find a textbook reference for an algorithm that gives you a relative estimate of a quantity $a$ (i.e. $|a-\overline{a}|\leq \epsilon_{rel} a$) from an algorithm that gives you an estimate with relative error $|a-\overline{a}| \leq \epsilon_{abs}$ for $a \in (0,1]$. The algorithm that I can think of (whic...
I have a medical dataset, which is something like this | Disease | Symptoms | | -------- | -------- | | Disease 1 | ['Symptom1', 'Symptom2', 'Symptom3', ...] | | Disease 2 | ['Symptom2', 'Symptom11', 'Symptom7', ...] | | Disease 3 | ['Symptom55', 'Symptom91', 'Symptom65', ...] | I want a generate a model t...
I want to implement an AI capable of playing the game RoboRally (https://en.wikipedia.org/wiki/RoboRally) using Monte Carlo Tree Search (MCTS). In RoboRally, there are 2-8 characters controlled by (human) players, each of which must reach checkpoints. However, each turn, a character can only move by playing cards chose...
Given a ternary string S of length N, do the following: Find the first strictly decreasing pair of digits. Randomly change one of the digits in the pair to another value. The string is circular (i.e the digit after the last digit is the first digit) The program terminates when there is no strictly decreasing pair. Ex...
We need to partition a graph into subgraphs of 3 vertices each, such that every subgraph has at least 2 edges. The problem is similar to the partition into triangles problem (which is NP-complete) but not the same because each subgraphs may contain 2 or 3 edges (unlike the triangles problem, which requires 3 edges in e...
How to go about analysing the I/O complexity when there are multiple levels of memory involved? Looking up I/O complexity analyses returns papers such as this one, which generally assume for simplicity that the memory is just two-level (disk and cache).
Given this Shell sorting algorithm implementation: void shell(float ∗a ,int l ,int r) { int i, j, h; for ( h = 1 ; 3∗h <= r−l −1; h = 3∗h + 1 ); for (; h > 0; h / = 3) { // outer loop for (i = l+h; i <= r; ++ i) { for (j = i; j >= l +h && a[j] < a[j−h]; j −= h) { swap (a+j−h , a+ j ); } ...
I've been reading a paper "A Linear Time Algorithm for Maximum Matchings in Convex, Bipartite Graphs" by Steiner and Yeomans. In this paper at some point they solve an off-line minimum problem that is stated as follows: You are given an empty set $S$ and a sequence of $n$ $\textrm{INSERT}(i)$ and $m$ $\textrm{EXTRACT-M...
The paper Linear Temporal Logic and Linear Dynamic Logic on Finite Traces has the following examples on page 4: Q1. (Update to Q1: solved. See the comment by DCTLib.) The first example says that the REf (reg-expr over fin words) $\varphi^* \equiv$ ☐$\phi$ I disagree: the LTLf formula ☐$\phi$ says that in every moment ...