instruction
stringlengths
35
29.1k
I am learning the Theory of Computation, and I came across the language $\Sigma^n$. Could someone please explain what that could mean if $\Sigma$ is the alphabet? Thank you so much!
I'm trying to get CFGs for these two languages which still remain unsolved in my practice problems sheet: $L = \{ a^kb^ra^m | m=k+r\}$ $L = \{ a^nb^m | 1\leq n\leq 2m\}$ With the first one, I thought of this: $$S\rightarrow aSa | T$$ $$T\rightarrow b T a | \epsilon$$ but what if $k>r$ or $r>k$? With the second one, I t...
I am not able to find out the time complexity of the Leiden Algorithm. Can anyone here help me? https://doi.org/10.1038/s41598-019-41695-z.
I need to find the Myhill-Nerode equivalence classes for the language $$ L = \Sigma^*\setminus \left( \{\epsilon, cc \} \cup \{ cca^i: i\geq 2 \} \right) $$ over $\Sigma = \{a, b, c \}$ I'm familiar with the idea of separating suffix, but I really don't know where to start here. Thanks!
So I was wondering if there is a way of reading process memory of one device on another. So lets say a process is running on computer A, I then use some form of connection lan, pcie etc. Once the two computers are connected. Would it be any way possible to then, say open something like cheat engine and read process mem...
According to this recursion formula for dynamic programming (Held–Karp algorithm), the minimum cost can be found. I entered this code in C ++ and this was achieved (neighbor vector is the same set and v is cost matrix): recursion formula : C(i,S) = min { d(i,j) + C(j,S-{j}) } my code : #include <iostream> #include <ve...
Imagine you have a matrix m of dimension MxN What I'm trying to do is get a set of elements (of length N*(N-1)/2) of the diagonal elements (each of whose individual length would be M) of the outer product which is formed by every possible pair of columns within the matrix m For instance, I would take outer product of ...
I'm relatively new in machine learning and I am trying to put together my undergraduate thesis on masked face recognition. I've read Ejaz and Islam's paper (available at https://www.researchgate.net/publication/340690545_Masked_Face_Recognition_Using_Convolutional_Neural_Network) about feature extraction using FaceNet ...
I'm reading Computer Organization and Design MIPS Edition 5th Edition The Hardware/Software Interface on how memory cache works. I came across the following paragraph on page 393; The other key aspect of writes is what occurs on a write miss. We first fetch the words of the block from memory. After the block is fetche...
Consider a bipartite graph G=(U+V,E) and suppose |U|=|V| and that G has a perfect matching. Therefore by P. Hall's condition, for every subsets A of U, the neighborhood N(A) of A has size at least |A|. I am interested in subsets A for which N(A) has the same cardinality as A. Do they have a name? It seems that any perf...
I would like some help for the computation theory. There is a PDA that accepts the language $\{0^n 1^a 2^b \mid n = a+b\}$, so how can I express it into context free grammar? Any help would be appreciated! That's what I was trying, I am not sure if it is correct or not S -> 0SA | 0SB | empty A -> 1 B -> 2
For example, if I have 11X1111X as input, the result should be X. For another example, input: 1111XX -> 1111X. I am a complete beginner and all my tries so far failed to meet the expectation. This was my latest try:
I am trying to solve some questions on partial decidability of languages and I am getting confused in how to construct proper arguments through the idea of Universal Turing Machine. I am not posting my questions here, so I would like some examples showing a certain language is partially decidable with a proof.
I am trying to understand the No-Free-Lunch-Theorem for search (can be found here: http://axon.cs.byu.edu/~martinez/classes/678/Papers/Wolpert_NFLsearch.pdf) and have a question regarding the assumptions that were made by Wolpert et al. with respect to the "general nature" of a search algorithm. In the paper, the follo...
With Given Graph $G$ why finding that $G$ has a vertex cover of at most $4$ is in $P$ and Not in NP Complete. it means there us poly-time algorithm for this problem !!?
I read in my notes: If we use Dijkstra $|V|$ times ($|V|$ number of vertices) for finding all-pairs shortest paths in graph $G$, we get time complexity for Dijkstra algorithm as $O(VE+ V^2 \log V)$, and if we run Bellman–Ford algorithm $|V|$ times, we get time $O(V^2E)$. The above details are not important. I read to...
I wonder if there is a formal definition of lexical scope so that people can prove things with respect to it, for example, that an interpreter implements lexical scope. You may ask what level of formality I am talking about. For example, I deem the usual definition of the free variables of a lambda term formal: a varia...
The Problem (in words) I want to sort $N$ items where the value of item $i$ at position $p$ is given by the function $f_i(p)$. The "best" order for these items is the one that maximizes the total value of my items but I am willing to accept a "good" order if it means finding it quickly. The Problem (in maths) Given $N$...
Here's the problem: I have some $n$ ordered containers, each with $m$ slots. I have $p$ temporary slots that I can use to move items between containers. Sorting within containers is not costly, however moving items between containers is, so the more temporary slots that can be used to move items between containers, the...
In the CLOSEST STRING problem, one is given (bit-)strings $s_1, \dots, s_t$, each of length $L$ and an integer $d$. The question to be answered is whether there exists a string $s$ that has hamming distance to each $s_i$ that is at most $d$. In this paper, the authors show that (assuming ETH) the problem cannot be solv...
Quick question: Say for example there are 10 colinear points. my question is does a convex hull have to be a convex polygon? or can it be a line as well according to the formal definition of the convex hull? Thanks in advance.
I would like to know if there is any reason why many programming languages use the notation % for the modulo operator? It is used in the most "famous" languages: C C++ C# Go Java Julia Lua Perl Python
Hi I am wondering if L is a CFL and R is RL then would the difference R - L be a context free language? The difference might be the CF part of the language left then it would be, but I'm not sure how I could go about proving this without giving an example
I have a question about the Floyd Warshall algorithm. Here is the code from the Wikipedia page: let dist be a |V| × |V| array of minimum distances initialized to ∞ (infinity) for each edge (u, v) do dist[u][v] ← w(u, v) // The weight of the edge (u, v) for each vertex v do dist[v][v] ← 0 for k from 1 to |V| ...
Recall that $\mathsf{AC^1}$ is the class of circuits with unbounded fan-in, polynomial size, and logarithmic depth. Is this class closed under Kleene star? I thought it would be simple since it is easy to check every subword (using a polynomial number of gates), but the part where I have to check every partition makes ...
If we are given an NFA and a DFA, can we determine if there exists a string accepted by the NFA and rejected by the DFA and vice-versa. What complexity class would these problems fall into?
The Post correspondence problem (PCP) asks, given two sets of words $a_1,\ldots,a_n$ and $b_1,\ldots,b_m$ over the same alphabet, whether there are indices $i_1,\ldots,i_s \in \{1,\ldots,n\}$ and $j_1,\ldots,j_t \in \{1,\ldots,m\}$ such that $$ a_{i_1} \ldots a_{i_s} = b_{j_1} \ldots b_{j_t}. $$ It is well-known that P...
Suppose I want to randomly sample from a large set of items, each of which has a "score". I want my probability of sampling to be proportional to the score. One simple way to achieve this is divide each score by the total, then randomly sample based on each probability. This is at least O(N), and running it the next...
i am studying on trapezoidal maps. In the last section, "Analysis" of this paper, it says "The expected query time is indeed O(log n). Again the search structure size can be quadratic in the worst case, but the expected size is O(n)." Here is what i did not understand well. How it is possible to reach a quadratic size ...
I am currently studying hashtables and whilst the concept of chaining makes perfect sense, as does why searching is O(n) and also inserting (at head) is O(1), I dont understand why deleting an item is also O(1), hopefully someone can help me understand. I am referring to text such as this: In the worst-case scenario, ...
Trying to find the length of the longest representative of an equivalence class in suffix automaton, such that it has the form: $\{v\in{}\Sigma|v$ is the longest representative $\wedge$ $(\exists{}u\in\Sigma*)(v=uu)\}$|. In other words how can we find the length of the longest node $v$, such that $\overset{\overset{w}\...
I am revising for my algorithms exam and I have come across one topic in particular that I do not quite understand; What I would like to ask, if there is a certain way to find out O-Notation? Actually I know that the purpose of O-Notation, it helps us to estimate the effciency of algorithm. But in a specific questions ...
I was asked this question today: given a very long string x, which contains only lower case alphabets. A valid substring can only started with [a, b, c, d, e] and ends with [h, i, j, k, l, n] IF we sort the valid substrings alphabetically, what will be the first one and what will be the last one? If we do need to sort ...
I have been practicing problems on graphs and shortest paths and I encountered a problem that I'm struggling to understand. Can you give me any tips and/or can you confirm that I got the general concept of the problem right? In a given undirected weighted graph $G=(V,E)$ and an integer $k$ and edges with positive weig...
I am solving a problem that is asking to provide an equivalent for $\neg ((a \wedge b) \Leftrightarrow c)$ and the equivalent shouldn't contain $\wedge$ (and), $\Rightarrow$ (implication) or $\Leftrightarrow$ (iff). What I have worked out is: $\neg(\neg((\neg a \vee \neg b) \vee \neg c) \vee \neg(\neg(\neg a \vee \neg ...
According to this statement: Every regular language is context-free. Regular languages are closed under complement, so the complement of a regular language is regular. Consequently, any regular language and its complement are a pair of complementary context-free languages. $\{a^n b^n c^n \mid n\ge0\}$ is not determin...
I need to create a parabolic shape with a given starting point, maximum point, and end point. I thought the most efficient way to do this is to use a bezier curve. However there is no major relationship (that I could find) that relates a control point of a Bezier curve with its maximum point (which is why I am asking t...
I want to find an algorithm to find the shortest path in a vertex-colored vertex-weighted graph. Every vertex with the same color has the same weight and the total weight of a path should be the sum of the weights of the colors used. If we have for example a path A->B->C where A and C are red colored and B is blue colo...
In class we defined "local features size" $\rho$ as follows: Let $C$ be a smooth closed curve in the plane, and let $x$ be a point of $C$. The local feature size $\rho(x)$ of $x$ is the shortest distance from $x$ to the medial axis of $C$. (The medial axis $M(C)$ of a closed smooth curve $C$ is the locus of the center...
Suppose we have a statement: "Tom has a car" and we have an auxiliary clause that is has(x, y): x has y then to write the statement in logic I am guessing the following ones: $\exists$y has(Tom,y) or has(Tom,car) The reason I am not sure which to select is I don't know whether or not "car" is a specific constant simila...
How is possible to construct a finite state transducer that multiplies a number by 5? We can assume that numbers are supplied in binary notation, from least significant bits to most significant.
In a sorted array, I am trying to find just one pair that sum up to a certain value. I was wondering if anyone could help me improve my code in performance or memory. I know the code which is $O(n)$. If there are other method for finding pairs the sum up to a certain value that is much more efficient. I was asked this ...
I always wonder why machine learning is native to computer science rather than its more close fields like statistics and mathematics? In machine learning we CS engineers learn stats and maths and implement it by coding. Wouldn't it be much more easier for say a mathematician and a statistician to learn coding and imple...
I have two data sets of a particular structure: User 1: Salad1: Tuna, Mayo, Lettuce ... Breakfast1: Egg, Avocado, Toast User 2: Salad1: Tuna, Mayo ... Breakfast1: Egg, Toast, Sausage There are thousands of dishes, and the goal is to ensure that all the ingredients from User 1 dish are present in the cor...
I am stuck at the following exericse: Let $\rho$ denote the local feature size. Draw an example where the curve C contains the line segment from $(-1, 0)$ to $(1, 0)$, but where $\rho( (0,0) )$ is arbitrarily small. Here are the definitions that I heard in class: Let $C$ be a smooth closed curve in the plane, and le...
I am currently studying the textbook Artificial Intelligence: A Modern Approach, 4th Edition, by Russell and Norvig. Chapter 3 Solving Problems by Searching says the following: Another type of grid world is the sokoban puzzle, in which the agent's goal is to push a number of boxes, scattered about the grid, to designa...
TLDR: CLRS is claiming that a certain "pseudo" or "proto" tree structure does not have fast deletion, but I seem to have an algorithm that is efficient, and I would like to know whether it works or not. In particular: In Section 20.2.1 of CRLS, the book introduces a "proto" Van Emde Boas (vEB) structure that has some, ...
I have a question about the following recurrence relation: $$T(n) = 27 \cdot T\left(\frac n 3\right ) + n^3 \log n$$ Using the master theorem, will this be $T(n) = \Theta(n^3)$, or $T(n) = \Theta(n^3 \log \log n)$?
When you first learn more about computation you can imagine it in terms of boolean circuits. That is you get a boolean vector $v \in \lbrace 0,1\rbrace ^n$ which you can then apply a circuit $C$ to which then produces an output boolean vector, and $C$ must be constructed from some basic gates (and or not). It's fascina...
Let $G$ have a vertex cover of size at most $m$ and let the degree of $G$ be bounded by $k$. Then $G$ has at most $m(k+1)$ vertices. Note: Remove all vertices of degree $0$. Answer: The idea is to have $m$ graphs like the below one. But how can I prove this proposition formally? Thank you in advance for your answers....
I'm studying Comparability and Complexity, and through the course, a number of problems (namely, the halting problem for Turing Machines, etc.) have been proven undecidable through elementary proofs and reductions. Next, the course discusses polynomial time reductions between several problems, which makes sense: it's r...
The following problem is a problem I faced in one of my coding competitions. Given two positive integers $N$, $M$. You can have $M$ distinct types of stones, for which different types of stones must have different weights. Find the maximum of $k$ such that any weight in $\{1, 2, ..., k\}$ can be formed as a total weig...
Just a thought-experiment, could a program be written so that the computer generates it's own if-statements (semi/randomly) and runs them, gathers the results, then tests them in new scenarios, and iterates from there? This idea came to me because it's kind of how we humans operate. When we're born, we have a genetic ...
This is what do I have to solve: Byron Book: Exercise 8.3 chapter 8 Verify the use of Chebyshev’s inequality in (8.6) of Example 8.16. Show that if the population mean is indeed 48.2333 and the population standard deviation is indeed 26.5170, then at least 8/9 of all tasks require less than 127.78 seconds of CPU time. ...
Given a graph $G$, is there a 3-coloring with colors $c1$, $c2$ and $c3$ such that at most $k$ nodes are given the color $c1$ and that no two adjacent nodes are given the same color? Is there a decently fast algorithm to solve this? My only solution is to go through every subsets of size $1$ to $k$ and remove those nod...
I realize this may be an opinion-based question, but relevant nonetheless in my opinion. Context: I have a local search optimization algorithm, A. I designed A to address a specific biological question. A returns many local optima and often gets stuck near said optima. My target audience (biologists) don't understand t...
The following function getCombinations, is a recursive function that can be used to generate all combinations of an array. How exactly can we find the time complexity of this function? I would appreciate the workings or simply an idea about how to approach this. Thanks in advance function getCombinations(chars) { var...
Context: I'm looking for a better state resolution algorithm for https://github.com/MichaelMure/git-bug Summary of the current algorithm and shortcomings git-bug is a distributed bug-tracker that embed in git, the distributed version control system. To do so, bugs are stored in the native git data structure (commits an...
I have the following problem. I do not know where to start or how I should approach this problem. I am not sure about how to prove if a problem is in a complexity class of P . I know how to do NP but P confuses me.
I want to learn whether I can create regular expressions from the given Context Free Grammar. I found some examples that can be translated to regular expressions. However, all of them were like this: "S-> aB | bC". Whereas my example is like: "S-> AB | BC". Here is my example: Can I create RE's from this? What is the ...
I started to learn about compilers and interpreters. But I still can't understand how program execution happens under the hood. This is what I have understood so far. Compiler The Compiler does not run a code, instead, just converts the code into another (low-level) code. This part is clear to me. Interpreter First I t...
Given a graph $G$ on $n$ vertices with $m$ edges, show an algorithm that determines if there's a $P_3$ as an induced subgraph in $G$ in $O(m+n)$ time. ($P_3$ is the path on 3 vertices). What I was thinking at first is that any vertex $v$ that has at least two neighbors could indicate a $P_3$ but it wouldn't be induce...
in my notes I have one fact: in a binary tree with $n$ elements ($n$ divisible by three) there is a node $u$ such that the number of nodes in the subtree with root $u$ is at least $\frac{n}{3}$ and at most $\frac{2n}{3}$. Does it work for every binary tree or only when $n$ is divisible by three? How can I quickly prov...
So we all know it's easy to read a number from lowest place value to highest. A simple algorithm would be like : while(n): a=n%10; n/=10; but the question is how do you read it oppositely? for eg : 12312. must result in me getting first 1 then 2 then 3 and so on. I don't wanna form an array or reverse the numb...
This problem was given to 9-graders. We write down numbers except for the ones which contain the digit c. Find the nth such number. I looked at the indications, but the algorithm used there stumped me. I will describe in here: if $c \ne 0$, then we transform the number n - 1 (since 0 is part of the series) in the 9th b...
I am given with this information: "CMP OP1,OP2 will compare registers OP1 and OP2 if they are equal, flag values will be ZF=1, CF=0, if the first operands value is greater flag values will be ZF=0, CF=0, if the first operands value is less than the second operand flag values will be ZF=0,CF=1." I need to design instruc...
Given a sum of flat symbolic products like $axc + byc + ayc + bxc$, how can I efficiently factorize it as a product of sums like $(a+x)(b+y)c$? For my problem, the products are not commutative -- it's more like a sum-of-tuples becoming a tuple-of-sums. What have I tried: So far, I have this Prolog program (run in Swish...
I'm working through Samuel Mimram's book Program = Proof. In the first chapter, he discusses recursive types in OCaml, and inductive types. An exercise he provides on the topic has me a little bit confused. In the exercise, he asks the reader to define the function induced by the inductively defined type of lists, and ...
I'm struck how to find DP recurrence for: You are given a binary square matrix M of size nxn. We define a (p,q, l)-triangle of M, where p >= 1, q >= 1, L >= 1, p+L >= n+1, and q+L >= n+1, as the set of elements M[i, j] satisfying p =< i < p+L, q =< j < q+L, and i+ j < p+q+L. Design an algorithm to find the largest (p,q...
What is the space-complexity of Van Eck's sequence? https://oeis.org/A181391 Input: $x$ (number in binary representation with $n$ bits) Output: $x$th number in Van Eck's sequence Length of input: $n$ The naive algortithm would generate one entry of the sequence after the other and store all previous entries. Storing $2...
I was asked to define a CFG for the complement of $\{w\#w \mid w \in \{0,1\}^*\}$ and I'm struggling to define it. I think it is quite similar to defining a CFG for the complement of $\{ww \mid w \in \{0,1\}^*\}$, but I'm finding that the '#' really messes things up. Is the language even context-free?
We have $n$ customers, $(x_1, \dots, x_n)$, sorted on the read line. For convenience, we also use $x_i$ to denote its coordinate on the line. We need to locate $m$ facilities on the real line. We note that these facilities can be located anywhere on the real line. Each facility $j\in [m]$ is associated with an entrance...
Cyclomatic Complexity is defined with reference to the control flow graph of the program through this formula (borrowed from Wikipedia): M = E − N + 2P, where E = the number of edges of the graph. N = the number of nodes of the graph. P = the number of connected components. I can't understand the last. What is "the nu...
I'm trying to make non deterministic automata for specific language . I cant understand my mistake! Rules: 1){a,b,c} 2) if I have the sequence "bb" and later in the word I have the sequence "cc" so this is not possible that I have the sequence "cba" between them. Thank you !
Is it connected to BST search O(log n) or height log n? How to prove that insert will give give you correct BST in minimum O(log n) time?
Does the following 2-3-4 tree have a height of 3 or 2? If I count from the external nodes i.e. the ones with the square boxes then height should be 3. Not sure if they are to be included in the height as they are represented as NIL. If they are not to be included then the height of the tree should be 2. Any clarifica...
I have a problem regarding Recursion Theorem in Computation Theory. So Turing machines can have themselves as input. So they can simulate themselves(this technique have been used in many proofs i saw). what does a Turing machine that only simulates itself does?(assume the machine has only 2 commands get it's descriptio...
An array of combinations is generated from two arrays, indices: 0 1 2 3 4 5 array 1: [a, b] array 2: [A, B, C] repeating array 1: a, b, a, b, a, b repeating array 2: A, B, C, A, B, C combinations: [aA, bB, aC, ...
Question: Write a function that takes in the head of a Singly Linked List and an integer k and removes the kth node from the end of the list. The removal should be done in place, meaning that the original data structure should be mutated (no new structure should be created). Furthermore, the input head of the linked li...
What's the difference? is a Recursion tree private case of Binary tree?
I am studying Term Rewriting by reading Baader/Nipkow's book "Term Rewriting and All That". I am in chapter 3 - Universal Algebra, in the section 3.2 - Algebras, homomorphism and congruences. I am trying to do exercise 3.10: Let $\mathcal{Z}$ be the additive group of integers. (a) - Determine all subalgebras of $\math...
I often see big-O notation for time complexity algorithms and I see an equation that looks like $O(n) = n\log n$, which naturally generates a graph like the bottom one: I know the x-axis represents some amount of information, and the y-axis represents some amount of time. However, what is the amount of actual time or ...
The problem I am working on is specifically this: A Maze is given as N*N binary matrix of blocks where source block is the upper left most block i.e., maze[0][0] and destination block is lower rightmost block i.e., maze[N-1][N-1]. A rat starts from source and has to reach the destination. The rat can move only in two ...
I was wondering if its possible to use floyd warshall with constraints meaning lets say you have a group of "special vertices" of size logn and you want to calculate all the shortest paths but each path has to go through at least one "special vertex" is this even possible or is it hard n
regarding the following post: Prove that $BPP^{BPP} = BPP$ Let $L\in BPP^{BPP}$, by definition $BPP^{BPP} =\bigcup_{O\in BPP}BPP^O $, therefore there exists a language $A\in BPP$ such that $L\in BPP^{A}$. This means that there exists a $\mathsf{PTM} $ $M^{A}(x,r)$ such that $\mathbb{P}_{r}(M(x,r)\neq L(x))\leq \frac{...
(originally asked on StackOverflow) Two recent questions on StackOverflow by the same author1 are generally solved by the same technique. This feels to me like it would be a studied and perhaps well-solved problem. I would like to know what it might be called and where to find more information about it, assuming it i...
Let $[n] = \{1, 2, \dots, n\}$. Suppose we have a subset $S$ of $[n]$ of size $k$. Can we sample one element uniformly at random from $[n] \setminus S$ in $O(k)$ time? It's okay to use $O(n)$ auxiliary memory assumed to be initialized with zeros, as long as your algorithm can run and clean up back to the initial zero s...
What algorithm do computers use to compute the square root of a number ? EDIT It seems there is a similar question here: Finding square root without division and initial guess But I like the answers provided here more. Plus the person asking the similar question had the question formed in a personal way. My question ha...
So I've been working on a problem for fun and I'm worried I've run into some sort of contradiction, so I'm trying to figure out where I went wrong. I've simplified the issue down to this: Decider acceptance can be reduced to LBA acceptance Part 1: A decider can be reduced to a decider with an empty input alphabet. Let...
I'm new to functional programming. So the terms cons appends an element to the front of the list. Where cons ≜ λx:λl:λc:λn: c x (l c n). How should I go about proving that cons works correctly using beta reduction for a sample function. For example reducing cons 3[2,1] to [3,2,1]? Is there a formula like for the artihm...
Not sure precisely how to ask this question, but I want to understand if it is meaningful to ask about probabilities when aspects of the definition might be undecidable. My curiosity extends to potential implications for definitions of entropy in physical systems. Let me try to get a little more precise about the que...
Please help me with the following question: Define the language LONGERB to be the set of strings over $\{a,b\}$ where the longest substring containing only $b$’s is strictly longer than the longest substring containing only $a$’s (e.g. $aabaabaaabbbba$ is in LONGERB because the longest substring containing only $b$’s ...
Context: I'm operating a service with 5 accounts simultaneously servicing tens of millions of users. The accounts using the service have extreme bursts due to various campaigns by each account and the incoming requests from one account can suddenly go up 100x. All our queries are about equally expensive, so it makes se...
I have some $n$ numbers which are powers of $2$, say $a_1,a_2,a_3,\ldots,a_n$ which are not necessarily all distinct. I have option to give them any sign. I have to find if I can make their sum after that equal to num. I have following algorithm which I am sure will work, by a lot of arguments and verification, but I a...
I was watching the algoritmhs course by mycodeschool and he said that when we add a new item on a given position the worst case would be $O(n)$. Everywhere I look says insertion is $O(1)$... Now I understand that insertion itself might be $O(1)$, but if I have the following interface (this is something I made up, not a...
Let's say I am using the divide and conquer algorithm outlined here, but I only want to return the minimum distance. I understand why that algorithm puts an upper-bound at 7 but I think that can be trimmed down further. I can't come up with a geometry of points where if you are comparing them in order by sorted y value...
I'm trying to figure out how close (in orders of magnitude) current computer technologies are in terms of energy efficiency to the Landauer Limit. However, I'm finding (seemingly) conflicting information about this, and the discrepancy seems to arise from different metrics and assumptions. This Royal Society piece (wit...
Consider 4 positive integers a,b,c,d having exactly 10^11 bits (considering the leading zeroes) in the binary representations. Positions are numbered from 1 to 10^11. Every 3rd bit of a is equal to 1 (in other words bits number 3,6,9 and so-on), every 7th bit of b is equal to 1, every 4th bit of c is equal to 1, every...
NxN Checkers where both players are playing to win is EXPTIME complete. If we fix NxN to be 8x8 and prepare a very large lookup table then it can be solved in constant time and space. How to formulate Checkers to make it P and NP-complete? (2 different formulations) Note: I am interested in usual competitive Checkers. ...
For an undisclosed reason, I need a list of $n$ squares in a two dimensions space where each square does not overlap. So the challenge is simply: given a two dimensional area $a$ (topLeft: int, topRight: int, width: int, height:int), a number of squares required $n$ and a size for each square $s$: generate a list $L$ o...