Whilst doing exam revision I am having trouble answering the following question from the book, "An Introduction to the Theory of Computation" by Sipser. Unfortunately there's no solution to this question in the book.
Explain why the following is not a legitimate Turing machine.
M = {
The input is a polynomial p over variables x1, ...,...
There are three tables in my database: apples, refrigerators, and houses. Each apple belongs to a refrigerator (it has a column that references the refrigerator that it's in), and each refrigerator belongs to a house. The problem is, each apple ALSO belongs to a house. I guess this isn't "normalized" or whatever, but it's the way it is.
...
What is their purpose? What problems do they solve?
Thanks.
...
I am writing a program that reads the input from a file and then prints it to the screen. When I run it without taking the input from the file, it works perfectly fine. However, every time I try to run it from the file it gives me an "Exception in thread "main" java.util.NoSuchElementException: No line found at" error that occurs every p...
here's my code:
select yr,count(*) from movie
join casting on casting.movieid=movie.id
join actor on casting.actorid = actor.id
where actor.name = 'John Travolta'
group by yr
here's the question
Which were the busiest years for 'John Travolta'. Show the number of movies he made for each year.
here's the table structure
mov...
We are working on a lab assignment for my CS&E class and I think I can ask this question without going into detail of the entire lab requirements, but is it possible for an array to be inside of an array? For example, would this work:
int [] arrayOne = new int[3];
arrayOne[0] = Start of an array
If this is possible how do you go about...
I need someone to debug the lines of c++ code I wrote below so it can run. It is intended to spell check the word "and" using state to state transition.
#include<iostream>
#include<string>
using namespace std;
string in_str;
int n;
void spell_check()
{
int i;
FILE *in_file;
while (!EOF(in_file))
{
fsca...
Hi, for a project I need to implement a binary search. This binary search allows duplicates. I have to get all the index values that match my target. I've thought about doing it this way if a duplicate is found to be in the middle:
Target = G
Say there is this following sorted array:
B, D, E, F, G, G, G, G, G, G, Q, R S, S, Z
I get th...
Hello there, I have a string which looks like this "a 3e,6s,1d,3g,22r,7c 3g,5r,9c 19.3", how do I go through it and extract the integers and assign them to its corresponding letter variable?. (i have integer variables d,r,e,g,s and c). The first letter in the string represents a function, "3e,6s,1d,3g,22r,7c" and "3g,5r,9c" are two separ...
Hey there, this is part of a question i got in class, im at the final stretch but this has become a major problem. In it im given a certain value which is called the "gold value" and it is 40.5, this value changes in input.
and i have these constants
const int RUBIES_PER_DIAMOND = 5; // relative values. *
const int EMERALDS_PER_RUBY ...
Hello
I want to do reverse each word of the String in Java
example if input String is "Hello World" then the output should be "olleH dlroW".
...
Hello (and thanks in advance)
I'm in a bit of a quandry, I cant seem to figure out why I'm seg faulting.
A couple of notes:
It's for a course -- and sadly I am
required to use use C-strings
instead of std::string.
Please dont fix my code (I wont learn that way and I will keep bugging you).
please just point out the flaws in my ...
Hi
The question seems pretty well formulated
I have a virtual machine which implements only AND, XOR, SHL and SHR, yet I have to do a "OR 0x01" operation.
...
Hi,
I have a homework task to prove whether or not a particular variation on the dining philosophers problem suffers from deadlock or starvation. I suspect that the situation does not suffer at all from either but I'm finding this tricky to prove and I don't really know where to start. Is there a general strategy for attacking this so...
I want to define a method that take an integer as input and creates dynamically a list of all descending integer numbers to zero. I find trouble into calling method for the n-1 element
...
I am using strdup here to copy the value of the parameter name into nm in the constructor... is there an alternative of achieving the same result without using strdup and without using the C++ STL library and using the keyword new instead?
Book::Book(const char *name, int thickness, int weight):nm(NULL), thck(thickness), wght(weight){
...
This code is supposed to be able to sort the items in self.array based upon the order of the characters in self.order. The method sort runs properly until the third iteration, unil for some reason the for loop seems to repeat indefinitely. What is going on here?
Edit: I'm making my own sort function because it is a bonus part of a pytho...
I am stuck on this problem in my homework. I've made it this far and am sure the problem is in my three for loops. The question directly says to use 3 for loops so I know this is probably just a logic error.
#include<stdio.h>
void matMult(int A[][5],int B[][5],int C[][5]);
int printMat_5x5(int A[5][5]);
int main() {
int A[5][5] = {{...
I have this JUnit test that I need help developing a Interface and Class for, here is the test:
Box b1 = new DefaultBox( "abc" ); Box b2 = new DefaultBox( "def" );
Box b3 = new DefaultBox( "" );
assertEquals("abc", b1.contents());
assertEquals("[abc]", b1.toString());
assertTrue(b1.equals(b1)); assertFalse(b1.equals(b2));
assertFa...
I've written a simple calculator program using C# and WinForms. But it doesn't really do anything useful. How should I be handling the calculator buttons?
My code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Win...