What is the maximum space for Deterministic Turning Machine?
What will be the maximum space for a deterministic Turing machine if its language is decidable in f(n) steps?
See also questions close to this topic

Ruby regular expression to get users names after @ symbol
How can I get the username without the @ symbol? That's everything between @ and any nonword character.
message = <<MESSAGE From @victor with love, To @andrea, and CC goes to @ghost MESSAGE
Using a Ruby regular expression, I tried
username_pattern = /@\w+/
I will like to get the following output
message.scan(username_pattern) #=> ["victor", "andrea", "ghost"]

Regex validate only part even with \w
I am looking at someone else code and am missing some detail as why it is not working.
Xrm.Page.context.getClientUrl().match(/http:\/\/\w+/) + ":5556/" + Xrm.Page.context.getOrgUniqueName() + "/REST/";
It only delivers part of the IPaddress the rest work.
http//:789.789.789.123
becomes
http//:123:5556/UniqueName/REST/
\w+
should take everything after http://. Those validations I have looked at use /http:// 
Ruby regex: union 2K values in one regex,
I code a process to process bunch of text files and capture its name if any of 2000 literals exists in it (1 or many). So I'm thinking to combine that many values into one regex, do you think it's doable, I did test for 100 and looks like it's OK. Tx all Code below depics my flow and sample code, just without looping.
# 1. read regex value list as file [alpha,fox, delta] # 2000 values # 2. read file into s #5000 files # 3. find if any of #1 values exists in each #2 file. *with regex tweaks to match format dbname.dob.table s = '1 dbName.dbo.ALPHA 2 DBNAME.bcd.ALPHA 3 dbName..ALPHA 4 ALPHA 5x dbName.alphA 6x alpha.XX 7x ###dbName.###a.alpha alpha dbName..FOX dbName.dbo.DELTA clarity.aba..fox ' value1 = '(?<=^\s)(?:dbName\.[az]*\.)?(?:alpha)(?=\s$)' value2 = '(?<=^\s)(?:dbName\.[az]*\.)?(?:fox)(?=\s$)' ##... value2000 = '(?<=^\s)(?:dbName\.[az]*\.)?(?:delta)(?=\s$)' regex = /#{value1}#{value2}#{value2000}/i ## can I union 2000 regex's ??? puts 'reg1: ' + regex.to_s puts 'result: ' + s.scan(regex).to_s if s.scan(regex) then puts '...Match!!!d' end

Decimal Concatenation with binary check
Hello I'm programming some function and at some point I need to concatenate latitude and longitude values after they go into some calculation but I'm having heavy discussions with my supervisor.. For example above, E represents eastern and N represents North, so the latitude and longitude values are multiplied by 10.000 and divided by some coefficients then the integer part of the floating result is stored. So my problem is , I want to concatenate these two numbers here such as 4044865 and 927678. The problem is if we concatenate them we get 4044865927768 at the end.However, this could also be concatenation of 4044 and 865927678. Therefore sign bit is added in order to prevent this digit differences.so above scheme shows that we turn them into binary forms. However, he says that we dont need to convert these integer numbers to binary forms to do such concatenation. Basically he says that we could shift 2 by as many digit as one of these integers has and we can sum this number with the integer itself. Hence, we dont deal with this binary representations. But, the thing i dont get is, this case only works when the location sign is set to 1( in the case of west and north) if the location sign is 0 , then basically different combinations of these concatenation would yield the same result. How can we prevent this?

C++ Array with Do While Loop
Help on C++ array coding! So this program is suppose to take in names (up to 20) and quiz scores (up to 10). After typing the name of a student it asks to enter the number of scores based on how many quizzes there were (ex. 5 quiz score input if 5 quizzes were taken) after that it displays a table that list the student name and then their average score (one name and one score per line). Then at the bottom it's suppose to display the highest average and the lowest average.
So far I have the following: I figured it out until it asks for average of each user and the max/min value. What do I need to do from here? I tried solving for max/min but I am doing something wrong. Thank you
The image attached is what it suppose to look like. Its not my program.
#include <iostream> #include <iomanip> #include <string> using namespace std; int main() { const int Max_Students = 20; const int Max_Quizzes = 10; double Students[Max_Students], Quizzes[Max_Quizzes]; int numStudents = 0, numQuizzes = 0; string StudentName; double score = 0, sum = 0, average = 0; double max = 200, min = 200; cout << "Enter the number of students (120): "; cin >> numStudents; cout << "Enter the number of quizzes (110): "; cin >> numQuizzes; do { for (int j = 0; j < numStudents; j++) { cout << "\nWhat is the name of the student? "; cin >> StudentName; cin.ignore(); getline(cin, StudentName); for (int i = 1; i <= numQuizzes; i++) { cout << "Enter score " << i << ": "; cin >> score; sum += score; } for (int i = 1; i < numQuizzes; i++) { if (score > max) { max = score; } } for (int i = 1; i < numQuizzes; i++) { if (score < min) { min = score; } } } average = sum / numQuizzes; } while (numStudents < 0  numStudents > 20); system("pause"); return 0; }

Hailstat or Hailstone sequence
I am trying to figure out how to make a program that will use the hailstone sequence. This is the instructions from my professor at USC.
" The name "hailstone" refers to how the numbers get bigger and smaller in each sequence, like a hailstone. A very fundamental question is: will we always reach 1, no matter what is the starting value? It was originally posed by Lothar Collatz in 1937, but nobody has been able to solve it yet. The famous 20thcentury mathematician Paul ErdÅ‘s said of the question,
Mathematics may not be ready for such problems.
However, it is a perfect problem for computational investigation, since the process is algorithmic in nature.
Remember that the "length" of a number is the number of steps it takes to reach 1. To understand the behavior of hailstone sequences better, we'd like you to write a program called hailstats.cpp that searches through a range of numbers that the user specifies, and reports the shortest and longest lengths in that range. Here's an example run. Again, $ is the commandline prompt, and the highlighted text is the input.
$ ./hailstats Enter the range you want to search: 10 100 Minimum length: 4 Achieved by: 16 Maximum length: 118 Achieved by: 97 So what this means is that, out of all the numbers from 10 to 100, the one with the minimum length was 16 (its length was 4) and the one with the maximum length is 97 (its length was 118). If you like, you can run ./hailstone to doublecheck.
Your program is responsible for adhering to the following requirements.
If more than one number achieves the minimum or maximum, report only the smallest such number. For example, though both 52 and 53 have a length of 11, the range from 50 to 60 should have the following output, reporting only 52: $ ./hailstats Enter the range you want to search: 50 60 Minimum length: 11 Achieved by: 52 Maximum length: 112 Achieved by: 54 The range is inclusive. So in the above case, it checked all numbers 50, 51, 52, ..., 59, 60. If the user inputs an invalid range, where the start of the range is bigger than the finish, then your program should print an error message without looking for the min and max. E.g., $ ./hailstats Enter the range you want to search: 20 10 Invalid range "
I need help and this is in C++! thank you all!

How to construct a PDA for n(a) is less than or equal to 2n(b)
So here is where I am stuck, I have to construct a PDA that would accept words from {a,b}* with the condition n(a) is less than or equal to 2n(b)

Can any tell me the regular expression for the given language?
all strings which contains even number of 0s or even number of 1s. Here I am asking about 'or' not 'and'.
I have come up with this: (1*01*0)*(0*10*1)* so far...but this seems wrong to me cause when you draw DFA for the above language you can even accept 111 or 000 too.

what is the correct language recognized by the following state diagram?
state diagram:
I think language about state diagram of the link at the top is {w  w contains the substring '1100'}.
I searched the answer, but i couldn't find it. please check if my answer is correct