instruction
stringlengths
35
11.4k
I currently hold a bachelors in Computer science and a masters in Art History. I really want to combine the two and I know of Digital Humanities but I'm not completely aware of where Digital Humanists could work besides Museums, libraries, etc. and even at museums and the such, I imagine that the demand for Digital hum...
I'm working with this definition for one-way functions: We call $f$ a (strong) one-way function if it is computable in polynomial time for any polynomial time randomized algorithm $B$ and any constant $c$ $$ \mathbb{P}\big(f(B(f(x))) = f(x)\big) = o(n^{-c}) $$ where $x\in\{0,1\}^n.$ And this defintion for h...
Suppose I have a random number generator G that takes in a seed s from the set of integers. Suppose we have a sequence of numbers Q where |Q| = k. Does there exist a seed s such that G(s) produces the sequence Q, for any Q with any length? This is an existence question; does it exist or not, the process of finding a ra...
If we have some collection of decision trees with single-variable splits and a constant value at each leaf node, the average over all trees gives some function from $\mathbb{R}^n \to \mathbb{R}$. Is it possible to efficiently find the subspace on which this function achieves its maximum? Enumerating all intersections c...
In the real world, how is a node mapped to the position on the ring, Each nodes's IP address is hashed using SHA-1 hashing algorithm which will produce this hash - 73.128.154.69 hashed into 60CBFB98C9052A425D684A2C3D8D8D38424129A3. This should have been in the range of 0 to (2^m) - 1 where m is the number of bits. I ...
I was browsing Agda's stdlib source code, since I was trying to get into it seriously and therefore wanted to know more. I was amazed at that Agda is way more developed than I thought and it's significantly much closer to Haskell than Coq. However, I was quite a bit panicked when I see some code like following: toList∘...
I have a question about big O notation. Let's say I have 3 algorithms which, for an input of size $n$, have time complexity $O(n)$, $O(n^2)$ and $O(n \log n)$, respectively. Assume that all 3 algorithms take $a$, $b$ and $c$ seconds for the worst, average and best cases given an input of size $n$. What could be the act...
I have an assignment to create a pushdown automata for $L=\{a^{3n} c^m b^{2n} \mid n,m\geq 0, m\!\mod\! 2=0\}$ and I am confused how to handle $2n$ and $3n$.
We were introduced to the standard C rand() function, and how to use it. At some point during the class we were asked how to roll a die. The simple answer was to create a random number, take its modulo 6, and add 1. rand()%6 + 1 However, the right answer was building a function that returns a value in the range [0,1) ...
Is there a regex that checks for divisibility by 123 in binary strings? This question can be found in the Algorithms’ textbook by Sedgewick and Wayne official website (question 7b in the Creative Exercises section). Creating a regex to check if a binary string is divisible by 3 is simple: (0|1(01*0)*1) * A regex to che...
I'm trying to better understand the concepts of static and dynamic linking, in terms of the ways JavaScript libraries are used in modular systems. Does it ever make sense to describe a JavaScript library run in a browser as "linked" in a technical sense, the way you would a C++ library? For instance, in these examples:...
Two-part question: Is there any more specific name than "unbalanced binary tree" to describe the tree below? The distinguishing characteristics are: i. The root node and left children must have either 0 or 2 children. ii. Right children must have 0 children. iii. All nodes must be positive non-zero integers. iv. Any n...
I would like to prove that $(A \cup B)^* = A^*(BA^*)^*$, where * means the Kleene star. I would like to use induction to prove this equality but I do not how to proceed and how is the best way to set the induction hypothesis. Could someone please help? Thanks !
Show that the Pumping Lemma for CFLs is not powerful enough to prove that the language $L = \{a^ib^jc^k \mid i ≠j ≠ k ≠ i \}$ is not context free. From my understanding, we want to prove that all 3 conditions of the pumping lemma hold. This will not guarantee that the language is context-free. However, I have found a c...
I'm working on this RSA encryption problem and the catch is that it must be done by hand and mathematically. Let's say $p=11$, $q=13$ $$N=p \cdot q=11 \cdot 13=143$$ I chose $e$ to be relatively prime to $(p-1)(q-1)$, $e=23$ So the public key is $(23,143)$ Now I want to find out $d$ and for that I've come across $2$ ...
I'm having trouble wrapping my head around random number generation so I figure it would be better to ask now, rather than screw up later. Let's say I want to write a function that generates a random lucky number from 0-9 when the user clicks on a button. I'm thinking of using the last digit of the multiple of the x an...
Given a set of non-negative integers $A = \{a_1,a_2,\dots,a_N \}$, the $k$-partitioning problem is to partition the numbers into $k$ sets $\{A_1,A_2,\dots, A_k\} $ such that the deviation: $$ \underset{j,k}{\text{max }} \left|\sum_{a_i \in A_j} a_i - \sum_{a_i \in A_k} a_i \right|$$ is minimized. Is there any non-trivi...
Given $(G,D,d)$, a graph, the graph diameter and the maximum outdegree of the graph. Verify that $G$ is strongly connected in $O(D\log d + \log n)$ space complexity. I thought about using the $STCON$ problem for the whole nodes in the graph, but that will yield a space complexity of $O(n^2 \log^2n)$ (according to Savi...
I wish I knew the correct terminology for the question that I would like to ask, but I don't, so please forgive me if I am not calling the right things by the right names. The practical problem that I am trying to solve (and whose specific nature is to do with data compression) can be phrased as follows: We have a dire...
I am trying to implement samplesort in MPI. The first step of samplesort is to partition the array with $n - 1$ splitters $s_1, s_2, \cdots, s_{n-1}$ into $n$ subsequences, where subsequence $i$ all have values in the range of $[s_i, s_{i + 1})$ (let $s_0 = -\inf, s_n = \inf$). My question is: how to implement this eff...
While trying to understand the concept of polynomial hierarchy, I noticed that there are several ways to define it. And the most confusing thing about the situation is to see the equivalence between those definitions intuitively. What I want to know for now is the relation between oracle machines and existential/univer...
NOTES: there are a myriad of graph data structures, I use a spin-off of a directed adjacency hash. the code provide in this post is python3 on the premise that it lends itself to readability. this post was not posted to SE code review as: a. there are not sufficient tags for graphs (just graphs and graphics) b. the ...
I have been reading about set-associative caches. As far as I have read, in case of n-way set-associative cache each way stores, a block (let's say 16 bytes) and therefore each set will be of size 16n bytes. But what if I have to load a whole page into the cache. Since the size of a page is much larger than a block, ho...
I want to develop an algorithm which finds the optimal sequence of multiplications to multiply n matrices. For example, if we have: M1 x M2 x M3 x M4 x M5 x Mn The algorithm should place the optimal parenthesis to reduce overall number of scalar multiplications. For example, a possible output may be: (M1 x M2) x (M3 x ...
+---------------+---------------+---------------+---------------+---------------+ | id: 20 | id: 19 | id: 18 | id: 17 | id: 16 | | pos: (-2, -2) | pos: (-1, -2) | pos: (0, -2) | pos: (1, -2) | pos: (2, -2) | +---------------+---------------+---------------+---------------+---------...
I'm working with a control-flow graph, which is simply a directed (usually cyclic) graph with an entry (initial) node, and I have calculated all the dominators on the graph. It's noteworth that every node has either 1 or 2 transitions. I need now to change the entry node of the graph to a node to which the entry node h...
I have been through multiple definitions of DAG and all of them say that it is a directed graph without cycles. Also, it is said that it has topological ordering. Now the following figure is directed graph and does not have cycles. But looking at the ordering of edges (look at edge (2,1)), it is not topologically orde...
I have some sort of a misunderstanding regarding the Suzuki-Kasami distributed mutex algorithm. I am writing my question here because I failed on gaining access to the original paper. I will call processes sites for convenience. My question Why the token holder $j$ releases its token only when $RN_j[i]==LN[i]+1$ and no...
Given a directed acyclic (and unweighted) graph and two distinct vertices S and T, is there an algorithm that will tell me if there is any path (not necessarily the shortest one) between the two? If it helps, I don't need the list of vertices on this path, just the fact that path exists. I sure know of all the graph sh...
I am interested in the details of the implementation of the "sweep-line status" data structure, which is used to implement the Bentley-Ottmann algorithm to find all intersections (and the corresponding involved segments) of a set of segments (or line-segments). The algorithm and the sweep-line status data structure is ...
I'm trying to solve the following algorithm question: A maze is given by a graph (with let's say $v$ vertices and $e$ edges), where $k$ vertices are different keys and, $k$ vertices are the corresponding doors (there is always one key for a single door) and one vertex is the end of the maze. Find the shortest pa...
L = {$xy ∈ \{a, b\}^∗ : |x| = |y|$ and x contains the substring aa} I am trying to prove that this language is not regular using MyHill-Nerode theorem but I am unable to find equivelance classes of this language. Thanks.
I would like to use Multiscale Combinatorial Grouping for my PhD research. However, I am restricted to use open-source implementations and this one runs on Matlab. Does anyone know of an equivalent contour detection method that works on large images that is implemented open-source, preferably in Python? Here some more...
I am self-studying formal languages and want to solve an example problem. Given formal languages $A,B\subset\Sigma^*$ over an alphabet $\Sigma=\{a,b,c\}$ with $$A=\{\omega\in\Sigma^*\vert\left|\omega_a\right|=\left|\omega_b\right|=\left|\omega_c\right|\}$$ and $$B=\{a^ib^jc^k\vert i,j,k\in\mathbb{N}\}$$ where $\left|\o...
An integer $q$ is called a quadratic residue modulo $N$ if it is congruent to a perfect square modulo $N$; i.e., if there exists an integer $x$ such that: $x^2≡q\ (mod\ n)$. Otherwise, $q$ is called a quadratic non-residue modulo $N$. Given that $N$ is a composite number (whose prime factorization is known beforehand) ...
Let's represent Subset Sum problem with binary arrays instead of numbers. Example: given two-dimensional array [1, 0, 0] (4) [1, 0, 1] (5) [0, 0, 1] (1) is there set of one-dimensional arrays, sum of which is equal to [1, 0, 0, 1] (9) In this problem sum of bits in each position can have carry-over. If carry-overs ar...
We know that typical operating systems and high level languages (especially those with garbage collection) cannot be used for real time operating systems. Java & jet engines don't mix, and consequently a lot of study has gone into researching and developing real time operating systems. Is there any research as to exac...
I'm a web developer and I struggle to visualize abstract concepts in my head. By abstract concept, it can be: - the backend model of a webapp (with several objects inter-connected to each other) - repeated actions on a data structure (a sort on a array for example) For example, I wanted to implement a bubble sort last...
In dependently-typed programming, there are two main ways of decomposing data and performing recursion: Dependent pattern matching: function definitions are given as multiple clauses. Unification ensures that all omitted cases are impossible, and an external solver ensures that recursion is well-founded. Eliminators: ...
It is known that the existential theory of the reals is decidable in PSPACE (via John Canny), but as far as I can tell no one has demonstrated that it is in NP. This confuses me because it seems like a short certificate for a given formula would be an example of values for the variables included in the formula that dem...
Consider a list of n integers. And assume we take each integer from this list sequentially and add it to a red-black tree. Then for the n! permutations of the list how many red-black tree arrangements are there in total? N.B: Some permutations result in the same arrangement.
Given a deterministic DPA, is it possible to tell whether it halts on all possible inputs? Is this problem decidable? The standard halting problem is "Given a DPDA and an input $x$, determine whether it halts on input $x$", and that problem is decidable. But what about the variant above?
The approaches I've seen to abstractly talking about the semantics of a programming language like Turing machines, various lambda calculi, and Hoare logic seem to be talking about the behavior of entire programs / entire expressions. Lambda calculus does regularly involve free variables, perhaps it isn't the best examp...
I am trying to come up with an algorithm that calculates the length of shortest rectangle movement in a given bitmap. For example, let's say we have a 24x24 bitmap where 1 is black pixel and 0 is a white pixel. {{0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,1,1,1,0,0,0,0,0,0}, {0,...
So i know that $L =$ { $ {w_1 w_2 : |w_1| =|w_2| , w_1 \neq w_2} $ } is a CFL, but i cannot make a PDA for it because it doesn't make any sense to me why this is CFL i even know the grammar for it but i cannot draw the PDA because : even if we determine the middle of the string, if we push every word of w1 to the stac...
$L = \{ a^n (a+b)^n | n>0\}$ A book I'm reading says it is, but considering we can't know where the second part gonna start, and it might start with a as well, then how can we accept this using a DPDA? Like after reading the first part ($a^n$) how can we be sure that it's the end of the first part or not considering...
Consider a problem such as weighted model counting for propositional logic. The problem of enumerating all models M of a logic formula f and summing their weights w(M) is #P. What happens if the weight is a function of the model and the task of computing the weight w(M) given M is in itself #P? Whats the complexity of ...
The following commentator writes: Having studied this extensively back when they were called Genetic Algorithms, I would like to offer a few insights. One of the biggest reasons they fell out of favor for more "mathematical" approaches was that no one could really explain why exactly they worked. It makes sense on the...
What i mean is that can we code each CFL ( the same way we code each turing machine in the Universal Turing Machine ) and build a Linear bounded Automata in such a way that for each input ( which is a code of a particular CFL) decides whether this is a context free language ( accept ) or not? I hope my question makes s...
Given a large rectangle and a set $S$ of small rectangles each with a value $v_i$. My problem is to find a collection of rectangles $T\subseteq S$ to put in the large rectangle so as to maximize the overall value $\sum_{i\in T}v_i$, subject to the constraint that the selected small rectangles cannot overlap with each o...
Given an undirected graph $G = (V, E)$ with $n$ vertices and $m$ edges, how many $k$-colorings of $G$ exist? A $k$-coloring is a function $c: V \to \{ 1, 2, \dots, k \}$ such that $c(u) \neq c(v)$ for all edges $\{ u, v \} \in E$. Let $f(G, k)$ denote the number of $k$-colorings of $G$. There is a well-known formula, s...
For a computer architecture, called ComputerA, a MIPS-like instruction set will be used. 64 instructions are reserved for R-type instructions and 64 more instructions are reserved for I-type and J-type instructions in total. Also, there are 128 registers in the system and the size of one register is 64 bits. According...
In the solution to problem 2 of this exercise sheet: The height of $n$-node Binomial Heap is always $O(\log{n})$. Show that this is not the case for Fibonacci Heaps by exhibiting, for any positive integer $n$ a sequence of Fibonacci-heap operations that creates a Fibonacci heap consisting of just one tree...
How to minimize the DFA given in the picture
I am working on a problem where I have a set of goal nodes of which some, all, or none of will appear in a search tree. Is there a search algorithm which returns the lowest cost path to one goal node, when there are potentially many different goal nodes present in a tree, or failure? This can obviously be solved by ite...
$L = \{a^n b^n c^n ... d^n | n>0 \}$ so for example $L = \{a^n b^n | n>0 \}$ , $L = \{a^n b^n c^n| n>0 \}$ and such can the turing machine accept these in O(n)? if yes then what about a better time complexity like O(logn) or O(1)? my take on this is: yes because we can use n number of tapes and we go through all of the...
What would be some implications of $NL$$=P$? Would it be possible to get recommendations on good sources/papers I can read to learn more about this? Thank you
Question: A binary Tree T is semi-balanced, if for every node m in T: $$ \frac{R(m)}{2} <= L(m) <= 2*R(m) $$ where, L(m) is the number of nodes in the left sub-tree of m and R(m) is the number of nodes in the right sub-tree of m. Write a recurrence relation to count the number of semi-balanced binary trees with N n...
So i remember reading somewhere that we can convert any turing machine into a turing machine with 2 states (or 3, i don't remember) but there was no proof for it and i couldn't find it either So my question is : For every turing machine, what is the minimum number of states that we can have after converting it to this ...
In the book, Operating System Concepts, 9th Edition, there is this paragraph that I don't quite wrap my head around. Swapping is constrained by other factors as well. If we want to swap a process, we must be sure that it is completely idle. Of particular concern is any pending I/O. A process may be waiting for an ...
For kosaraju's algorithm to traverse the graph in reverse order the naive solution is to reconstruct the original input graph in reverse order and dfs on it. Is there any way I can avoid creating copy of the graph in reverse order? how can I dfs on the same original graph going back across the edges?
An apology might be in due for asking another question about prerequisites, but I was confused about the starting points. I have come across various terms such as "Modal Logic", "Temporal logic", "First -order Logic", "Second order Logic" and "Higher order logic". What exactly does "Logic" mean in this context? How do...
Prove that the language $LM =\{\langle M,x\rangle\mid \ M \text{ accepts }x\text{ and rev}(x) \}$, where $\mathrm{rev}(x)$ is the reverse of the string $x$, is undecidable with a reduction from $A_{\mathrm{TM}}$. Note that the empty string belongs to $LM$.
I have extracted DenseSIFT from the query and database image and quantized by kmeans. The challenge is to find those SIFT features that quantized to the same visual words and be spatially consistent (have a similar position to object centers). I have tried few techniques: using FLANN() on the SIFT (normal SIFT) coordi...
Give context-free grammars that generate formulas in propositional calculus, taking into account: variables represented by single lowercase letter Operations are conjunction (∧), disjunction (∨), negation (¬),implication (→) and double implication (↔) Parse trees should reflect the following precedence order, 1: Form...
I know that Good-Turing smoothing helps us to trim a bit of probability from some more frequent events and give it to the events we've never seen. Thus it keeps our model from assigning zero probabilities to unobserved events. But while dealing with a dataset, I encountered an interesting result. Here is the data I obs...
I developed an image processing software and I need to do a numerical analysis of it, considering the error propagation associated to its operations and the uncertainty of float type variables caused by the inherent rounding up that happens with this type of variables. Considering the IEEE 754 standard the machine epsi...
While doing the multiplication 1.4*0.8 in a python program, I got the result as 1.1199999999999999. Why didn't I get 1.12 exactly? In C programming language, the same expression gives 1.1200.
i want to prove that $3^n$ has a greater growth than $n2^n$ or $3^n = O(n2^n)$. but how can i do it mathematically? by induction or contradiction or other ways of proof.
This was an interview question that I was told is supposed to be an open ended discussion of the trade-offs. You have a collection of comparable objects and want to be able to do the following: 1. Lookup, add, delete objects 2. Get and/or extract Min, max objects 3. Objects should be unique (no duplicates) A max-heap ...
If both $A$ and $B$ are NP-complete languages, would $A \times B$ be necessarily NP-hard? Here, $A \times B = \{\langle u,v \rangle \mid u\in A, v\in B\}$. So my colleague's answer was no, it's not necessarily NP-hard because you can verify in polynomial time that $u \in A$ and the same for $v \in B$, but you see this...
When using double hashing, the second hash function is defined as $$h_2(x)=A-x\mod A,$$ where $A$ is a prime number less than the capacity of the hash table. But why must $A$ be a prime number? (This differs from Why is it best to use a prime number as a mod in a hashing function? because the prime number in question i...
The biclique vertex-cover problem asks whether the vertex-set of the given graph can be covered with at most "k" bicliques (complete bipartite subgraphs). It has been shown that "Biclique Vertex-Cover" is not fixed-parameter tractable unless P = NP in Covering Graphs with Few Complete Bipartite Subgraphs. Most of the w...
I'm trying to solve this recurrence equation in this way: $$ T(0)=O(1)\\ T(n) = 2T(n - 1) + n \\ = 2[ 2T(n - 2) + (n - 1) ] + n \\ = 2[ 2[ 2T( n - 3 ) + ( n - 2 ) ] + ( n - 1 ) ] + n \\ = 2³T(n-3) + 2²(n-2) + 2(n-1) + n$$ And I get: $$ \sum_{i=0}^{n} 2^i(n-i) $$ That's right?
A computer system uses 32-bit memory addresses and it has a main memory consisting of 1Gbytes. It has a 4K-byte cache organized in the block-set-associative manner, with 4 blocks per set and 64 bytes per block. What are the number of bits in each of the Tag, Set, and Word fields of the memory address ? A block has 64 b...
I wonder if the knapsack problem with diminishing prices is already studied? The problem is similar to the regular knapsack problem, except the price of each item is a decreasing function of the total size of the already selected items. Given $n$ items each with size $s_i$ and price $v_i(s)$, where $s$ is the total siz...
When doing the "inexact" analysis of the Merge Sort, the literature that I have seen usually consider that the input is an array with a even quantity of numbers and the recurrence relation is: $T(n) = 2T(n/2) + \Theta(n)$ But how I can formally prove that even if I consider any input, the complexity stays the same? Whi...
I'm studying the master method to solving a recurrence. It describes three cases, the last one of which depends on what lower bound a function f(n) has. I usually find out the upper bound of a function from its highest term exponent. How would I figure out its lower bound Ω?
I'm reading through the first chapters of "Introduction to the analysis of algorithm" by Sedgewick. I wasn't familiar with the use of generating functions, and complex analysis in general to analyse algorithms. I do understand the use of the tool is in practice simple (at least it seems to me in that way from what I re...
In direct memory management, CPU references address of 15-bits. Main memory size is 512 * 8 and cache memory size is 128 * 8. What is the size of Tag and line in bits? Block size=8=2^3 I have found the number of bits in the word field as follows, Block size=8=2^3 Therefore, word bits=3 bits Now number of bits in line f...
For example, if we have a graph G = (V, E) and a subset of vertices $U \subset V$. We can set $w(e)$ where $e \in E$ to be a non-negative real number. We want to minimize the total edge weight, but make sure that for all $(u, v) \in U \times U$, $l(u, v) \geq c$, where $l(u, v)$ is the shortest path from u to v, and c ...
What is known about the succintness of NFAs, relative to regular expressions? In order to clarify the question, let me explain what I know. The regular languages can be characterized by any of the following: A language is regular iff it can be recognized by an NFA. A language is regular iff it can be recognized by a ...
Hi so this is my first week learning about automata and I have an exercise I'm going through. I'm supposed to draw a diagram for the DFA that accepts all strings of a and b where the third last symbol is a b. So it's like : $\{a,b\}^*b\{a,b\}^2$ right? And if I would draw it I would do this to check the end: I believ...
I am using a genetic algorithm to find the best way to pack circles inside a box without each touching the others and filling as much space as possible. My doubt is if an individual from a generation must be a circle or all the circles. Can anyone help me on how would I go from here? Thank you
Assume I have some non-convex function $f(x_1, x_2, ...)$ and I want to optimize it to find a global minimum. I feel like it is easy to show that this problem is in the class NP with the decision problem Is there a set of points such that f < C? Where C is some constant. However, I am not sure if these problems are in...
It can be easily seen that solving systems of polynomial (i.e. not necessarily linear) equations is NP-Hard via reduction from SAT. Furthermore, because the existential theory of the reals is decidable in PSPACE, solving systems of polynomial equations is as well. What else is known about the complexity of this problem...
The recurrence of selection sort is $$T(n) = T(n-1)+ O(n).$$ Can we apply the master theorem to this recurrence? I am confused because the master theorem can be applied to the following recurrence $$T(n) = aT(n/b) + f(n),$$ where $a \ge 1$ and $b > 1$. But for selection sort, $b=1$. I am trying to apply the master theo...
This question is in a sense the converse of Will quantum computers out-scale classical computers at P-problems?. We know that there are oracle problems (e.g. unstructured search) for which we can prove that quantum computers can only give a fixed polynomial speedup (in that case quadratic) for the number of oracle cons...
I am using a genetic algorithm to fit the max number of circles into a box. Right now my cromossomes are both coordinates of the each circle. I am not sure how to crossover and mutate the x and y coordenates in order not for the to converge but to keep a distance. Can someone please shed some light? Thank you This is w...
Given are some vertexes, arranged in a list (so there every vertex is connected with two others and there are no circles in the graph). Every Vertex contains one number. Now you can lower the Number in one vertex and higher the one in one of the Vertexes connected to it by 1 in one so called "step". How would an Algory...
Given a number system with only 3 and 4. Find the nth number in the number system. There is a solution given here but its very vague without explaining the mathematics/ concept behind it. Can someone please help me derive the logic for framing an algorithm for this question? One approach that crosses my mind is, we ca...
I'm looking for an algorithm to generate/enumerate all possibilities for partitioning a set of size $n$ to $k$ non-empty subsets, each with size at most $b$. More specifically, given a set $V$ where $|V|=n$, how to enumerate all possibilities to choose subsets $X_1, ..., X_k \subseteq V$ such that 1) $1 \leq |X_i| \leq...
Given the following algorithm, to find the maximum and minimum values of an array - don't mind the language: MaxMin(A[1..n]) max = A[1]; min = A[1]; for (i = 2; i<=n; i++) if (A[i] > max) max = A[i]; else if (A[i] < min) min = A[i]; print(max, min); I need to do ...
Could you explain to me the input size of the algorithm with these cases? I can't understand the cases with multiple input parameters. Thanks. algorithm_1( a[1,...,n], b[1,...,n] ) for i ← 1 to legth[a] step ​1 do for j ← 1 to legth[b] step ​1 do x++ return 0 - algorithm_2( a[1,...,n], b[1,...
This question was posted to me: What property of our relation $R$ between worlds must be true if we know that the following formula is valid? $\square \bot$ I am completely stumped and have no idea what to do. Will appreciate any help.
This is a question from a past-yr mid-term paper from my school(using Python language). Attached below is a diagram to show how a robot will move. Don't mind if the link seems dubious as I just used an online screenshot app to make the link, can't find an online link that describes the scenario well. From the same pape...
There already are many questions and answers about the importance of the regularity condition in case 3 of the Master Theorem. My question is about when can we safely assume the regularity condition is satisfied when f is only provided as a $\Theta(g(n))$, which is actually what happens most of the time when we don't w...
"more precisely 'inference rules'" is what wikipedia says twice. Other references I've looked at (the Alice book, Ullman lecture notes cited, Maier textbook) name them as Armstrong's Axioms, use them for inference. talk about axiomatisation and decidability, etc. Wikipedia's links to axiom vs inference rule isn't helpi...
Based on GeeksforGeeks and many other sites, the C/C++ compilers will create the same token for float/int etc. However if we have something like this: int A[10.5]; then will there be a parser error or semantic error? The book that I'm reading says the parser rather than the semantic routines will detect it, but after...
Is there any way that for specific dataset I can measure entropy and information gain for two or more attributes together? Let's say we have the following dataset: $\begin{array}{cccccc|c} x1 & x2 & x3 & x4 & x5 & x6 & y \\ \hline 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 1 & 1 & 1\\ 0 & 1 & 0 & 1 & 1 & 1 & 1\\ 0 & 1...