Tagged Questions

All mathematical questions about computer science, including theoretical computer science, formal methods, verification, and artificial intelligence. For questions about Turing computability, please use the (computability) tag instead. For numerical analysis, use the (numerical-methods) tag.

learn more… | top users | synonyms

0
votes
1answer
12 views

What is the complexity of halving the size of an $n$-bit number every time.

I was discussing this question with my fiend the other day and was hoping to get some confirmation from someone if the logic I used is correct. Suppose that we have a number $N$ in base 2 ie ...
0
votes
0answers
8 views

Check if an axis aligned bounding box intercepts with a triangle

As the questions says I am trying to check if an AABB intersect with a triangle. I've divided the problem in 3 parts: check if any of the triangle edges intersect any of the AABB faces check if the ...
1
vote
0answers
26 views

RAM program to calculate $n^n$

I am asked to write a RAM (Random Access Machine) program of uniform-cost time complexity $O(\log n)$ to compute $n^n$. Could you give me some hints how I could that??
2
votes
0answers
25 views

How to find an expression for a number via a given set of math operators and constants?

Consider one gives you $n$ digits of a (possibly irrational) number and a finite set of math operators and constants, like $\{\sin(x), \ln(x),+,\times, \pi,e,7\}$. Then he asks you to build a ...
1
vote
0answers
13 views

How to define percentage values in terms of scalar

Imagine a game in which you choose many cards with different A,B,C values. Such as : Card 1 A - 4 B - 5 C - 6 Card 2 A - 2 B - 7 C - 4 ... and so on.. To ...
2
votes
2answers
67 views

Is it possible to express the idea of a number bigger than any other number ($\infty$) in programming languanges? [on hold]

I'm studying graphs and algorithms, most of the algorithms we're using (such as Prim's algorithm), have the need of a table with a symbol $\infty$. Which in some contexts mean that it is the biggest ...
-1
votes
0answers
15 views

Time complexity [on hold]

A subset of the nodes of a graph G is a dominating set if every other node of G is adjacent to some node in the subset. Let DOMINATING-SET = {<G, k> | G has a dominating set with k nodes}. Show ...
0
votes
1answer
11 views

Nondeterministic finite automaton understanding problem

It is probably a silly question but I have problem understanding it. Let's say I have to design a nondeterministic finite automaton that accepts the language consisting of words containing a string of ...
1
vote
0answers
23 views

Algorithm working with exact real numbers [on hold]

Can an algorithm working with exact real numbers outperform (say exponentially) a regular algorithm (working with finite natural numbers)? (just like quantum algorithms may outperform regular ...
0
votes
1answer
25 views

Pushdown automaton design

I have to design a PDA that recognizes the language: $$L=\{w \mid \#(a,w) - 3\#(b,w) = 2\} $$ where $\#(a,w)$ means the number of letters $a$ in $w$ My idea is to count $a$'s and $b$'s. I have to ...
0
votes
1answer
21 views

Why are all singletons confluent?

A relation R of a set M is confluent, if $ \forall x \in M \forall w1,w2 \in M :((xRw1 \land xRw2 ) \to \exists z \in M (w1Rz \land w2Rz)) $ . 1. Someone told me that all singletons, no matter the ...
0
votes
1answer
40 views

What is confluence?

I got a worksheet at university last week, and the first task is: A relation R of a set M is confluent, if $ \forall x \in M \forall w1,w2 \in M :((xRw1 \land xRw2 ) \to \exists z \in M (w1Rz \land ...
0
votes
1answer
33 views

Deterministic finite automaton algorithm

I am having a little trouble understanding this question. For a DFA M = (Q, Σ, δ, q0, F), we say that a state q ∈ Q is reachable if there exists some string w ∈ Σ∗ such that q = δ∗(q0, w). Give an ...
0
votes
1answer
28 views

Evaluating math proofs by computer

Is there any way to evaluate (check) math proofs (entered in some convenient for computer form) by computer? Only thing that comes to my mind is functional programming, different logics, but I'm not ...
0
votes
2answers
44 views

How to prove Kleene star to be uncounably infinite?

Hi I have a language $L = \{a, b\}$. How can I prove that the Kleene star (set of all words over the language) of this language is uncountably infinite or countably infinite?
1
vote
2answers
22 views

Pumping Lemma proof

We have a language $$ L = \{\text{w element of } \{a,b\}^* \mid \#(a,w) = \#(b,w)^2 \} $$ where $ \#(a,w) $ means the number of letters $a$ in $w$ I would like to show that this language is not ...
0
votes
2answers
23 views

How to show if a language is infinite, then there is no upper bound on the length of words in L?

L is a language over a finite alphabet. How to show that if L is infinite, then there is no upper bound on the length of the words within L? Can someone help me prove this.
0
votes
0answers
29 views

Can you use chinese remainder theorum to convert hex to dec in your head?

At one time I was able to convert hex to decimal in my head, using a trick I learned in college. I have not used it in years, and forgot how. Does anyone remember how to use the Chinese remainder ...
0
votes
1answer
53 views
+50

How can I retrieve all the results in one go?

Please excuse me for posting this question here, but I'm just not sure where this question properly belongs; moreover, as I'm in search of a funded Masters or PhD in Mathematics abroad, perhaps this ...
1
vote
0answers
37 views

Algorithm to compute wether a stabbing line exists for a set of line segments

Let $S$ be a set of n segments in the plane. A line $L$ that intersects all segments of $S$ is called a traversal or stabber of $S$. Give an $\mathcal{O}(n^2)$ algorithm to decide if a stabber for $S$ ...
5
votes
1answer
42 views

FOL and Conjuctive Normal Form Conversion

I see the CNF from following firs order logic: $ \forall x [ \forall y [ \neg A(y) \vee B(x,y) \Rightarrow [ \neg \forall y B(y,x) ] ] $ is equivalent to : $ (A(f(x)) \vee \neg B(g(x),x)) \wedge ...
0
votes
1answer
21 views

How do I generate regular expression from this deterministic finite state automaton?

I want to create a regular expression from the following deterministic finite automaton: "abb" substring search How do I generate regexp from above dfa and what are the steps for doing so? ...
0
votes
1answer
20 views

The complexity of Depth First Search

Can anyone tell me what's the complexity of Depth First Search? I have no idea about what does mean by the complexity.
0
votes
4answers
57 views

Prove that $G$ has at least $q-p+c$ cycles.

I need your help with this question: Suppose that a graph $G$ has $p$ vertices, $q$ edges, and $c$ components. Prove that $G$ has at least $q-p+c$ cycles. I don't know how to prove that.
1
vote
1answer
28 views

Show that the language is not regular using Myhill-Nerode Theorem

I saw that similar questions have been answered on this site, but I've been unable to translate those answers to my problem. $$L=\{ww^R\mid w \in \{a,b\}^*\}$$ This is what I tried: BWOC, assume ...
0
votes
1answer
10 views

How to properly determine observations related to a Hidden Markov Model alike problem?

I got a an exercise problem which should be seen as a HMM scenario and argument some statements. However I'm quite confused about how to properly solve and argument my solutions. Problem tells: ...
5
votes
1answer
42 views

Graph DFS, BFS and some inference

Suppose G is a connected, undirected graph with at least 3 vertexes. we know the order or visiting the vertexes in DFS and ...
0
votes
1answer
29 views

Is master theorem applicable to the recurrence relation $T(n) = T(n/2)$?

Is master theorem applicable to the recurrence relation $T(n) = T(n/2)$? I do not think it applies because there no $n$ term and there is no $n^k$ for a $k$ which would equal $0$.
1
vote
1answer
24 views

Base conversion between base r^3 to r^2

The problem asks the following: If $(\alpha2)_{r^3} = (r3\beta)_{r^2},$ find $\alpha, \beta,$ and r. First off, I assume $r^2$ > 3 and $r^3 > 2$. I know that $(r3\beta)_{r^2}$ = (10 _ _ _ _ ...
0
votes
0answers
9 views

Find the point where the greater growth rate surpasses the lesser one without graphing

I have 2 lines: f(x) = 2010x^2 + 1388x and g(x) = x^3 What's the strategy for finding a x1 >= 0 where g(x) becomes greater than f(x) for all x >= x1? If one DNE, how would I know?
0
votes
1answer
29 views

Converting double precision IEEE 754 hex to base 10 with repeating decimals

The number is 0x4001 8CCC CCCC CCCC. So far I have the stored exponent as 1000000000 which equals ...
1
vote
1answer
35 views

Applying the master theorem

State the asymptotic runtime found by the master theorem. If the master theorem does not apply state why: 1) $T(n) = $T($n/3)$ 2) $T(n)= $ $5T$($2n/5$) + $n$ 3) $T(n) = 4T(n/2) +15n^3 + 4n^2 +n+4$ ...
0
votes
0answers
39 views

Rewriting a function to speed up computation

the purpose of this question is to find the fastest way to calculate a function on a (x,y,z) grid using a programming language. It is more related to maths however, as it concerns recasting a function ...
0
votes
0answers
23 views

yacas factorize polynoms

I want factorize polynoms with yacas but I can do it only with univarial. E.g. I want $x^2-y^2$ factorize to $(x-y)(x+y)$. How can I do it? Or if anybody has any suggestion to another simple, free ...
0
votes
0answers
22 views

An algorithm to find if two sentences are at edit distance $1$

Definition: Two sentences $S_{1}$ and $S_{2}$ they are at edit distance $1$ if $S_{1}$ can be transformed to $S_{2}$ by: adding, removing or substituting a single word. Examples: Consider each ...
3
votes
2answers
49 views

If $L$ is regular, must the language $L_1 = \{w : w^Rw \in L\}$ be regular, or may it be non-regular?

The reverse, $w^{R}$, of a string $w = w_1w_2...w_n$ is the string $w_n...w_2w_1$. Suppose that L is a regular language. Must the language $L_1 = \{w : w^Rw \in L\}$ be regular, or may it be ...
7
votes
2answers
100 views

Graph and in-Degree and Drawing

We have in and out degree of a directed graph G. if G does not includes loop (edge from one vertex to itself) and does not include multiple edge (from each vertex to another vertex at most one ...
5
votes
2answers
43 views

A nice recurrence sequence

I want to find general solution for recurrence: $a_n=7a_{n-1}-10a_{n-2}+4n$ with suppose $c_1, c_2, c_3$ is constant. I need some tutorial or solution on this challenging recurrence.
4
votes
1answer
62 views

How many integers could be in such a way that any digits is not bigger than the left digits?

How many 4-digits integers could be in such a way that any digits is not bigger than it's left digits? I Try it with simulation, i get 714. anyone could describe a formula for me? My try:
0
votes
1answer
37 views

How to calculate the angle between 2 vectors in 3D space given a preset function

In my application, I am attempting to connect 2 points in 3d space with a cylinder via a function taking in 2 vectors. I understand that I need the angle to apply to the cylinder. As I understand, I ...
1
vote
0answers
35 views

Representing $i$ with divergent series

Train of thought In computer science, for representing signed integers, we can use the two's complement representation, so that $11111111_{(2)} = -1$ over 8 bits with $x_{(2)}$ denoting binary ...
0
votes
2answers
56 views

Designing a deterministic finite automata

How would I go about designing a deterministic finite automata to recognize the language L = {λ, ab, abab, ababab, . . . } consisting of strings that start with ‘a’, end with ‘b’, and alternate in ...
-1
votes
1answer
28 views

Proving that CFG generates a language

I need to construct a CFG for the language consisting of even length palindromes with the same number of a's and b's and then prove that it generates that language. This is the CFG I got: S→ abba | ...
0
votes
1answer
16 views

Substitution method for solving recurrences piece wise function

I don't know how to use the substitution method for the following function: piece wise function: $T(n) = c$, if $n=0$ $T(n) = d$, if $n=1$ $T(n)=2T(n-1)-T(n-2)+1$, if $n > 1$
0
votes
1answer
25 views

Triangles incident on a vertex (Graphs)

I have a project that I am doing. The specification requires specific methods on a graph class. Two of the methods requires this: 1.numberOfTrianglesIncidentToVertex, calculates and returns the ...
1
vote
2answers
34 views

Literature and web sources for Computer Aided Geometric Design (CAGD)

Through the Numerical Analysis lecture I came across Bèzier curves, B-Splines and Spline Interpolation and found it very interesting. The title of the chapter was Computer Aided Geometric Design and I ...
2
votes
1answer
32 views

Getting the nth bit of a decimal number

I have a formula for decoding a 3-bit data object: $$T = 68 + 2 \sum_{i=0}^22^iTempA_i$$ where $TempA$ is the 3-bit object and $TempA_i$ is the $i$'th bit from the right. I am trying to rewrite this ...
4
votes
1answer
20 views

Bipartite Graph and Matches of Graph

We know that one match from $G=(V,E)$ be a subset of edges $M \subset_= E $ in such a way non two edges of M hasn't a common vertex. Matches M is Maximal if M not a proper subset of any other matches ...
0
votes
3answers
83 views

Prove that the set of palindromes are not regular languages using the pumping lemma.

Firstly I pick a language $xyz$ where $x = \epsilon$, $y = (abb)^{k}$, $z = (bba)^{k}$ where $|y| \ge$ the number of states in the automaton representing my language. Then $xyz = (abb)^k(bba)^k$ is a ...
0
votes
2answers
53 views

Suppose f : A ---> B and g : B ---> A are functions for which g o f = 1A…

If I were to suppose that $f : A \to B$ and $g : B \to A$ are functions for which $g \circ f = 1_A$, is $f$ always surjective and is $g$ always injective? How would I either prove this or counter it? ...