Automa that can recognize any given DNA sequence - automation

I'm new here, I'm on my first year of college for computer science, and I have my final exam for logic in 3 days. One of the question that the teacher could ask me is to design an Automa that can recognize any given sequence of DNA, so all the different permutations of the set {a,c,g,t}. And honestly Idk where to start. I'm not using any programming language so it's all about theory, if anyone could explain to me the logic behind an automa that can recognize permutations of a set, that would be great. Thanks in advance

Related

Analyzing click rate between 2 variables

I am a bit new to this and I have what I believe is a basic question. For one year I have been sending the same email every two weeks. The variable I want to analyse is the language( English and French). I would like to know how important is the difference of click rate between English and French. I already have all the data, I am just not sure what is the best test to use for this. Any help?
Thanks,
Daniel
A t-test sounds like it would be the most appropriate method to ascertain whether there is a statistically significant difference between the mean click rate for English language emails in comparison to French language emails. Depending on how your data is organised and collected a paired-sample t-test or an independent sample t-test could be used. If the data does not meet parametric assumptions (ie is not normally distributed) you could use the Mann-Whitney U Test in place of an independent sample t-test or the Wilcoxon signed-rank test for a paired samples t-test. All four of these tests can be found under the Analyze menu in SPSS, with the t-test under Compare Means and the non-parametric equivalents under Nonparametric tests. This link gives some advice on t-tests in SPSS and how to interpret them. If you comment giving a link to your data I can help further if necessary.

Data Warehouse schema : Star or Snowflake (case included)

I need a hand with a specific case for creating Data Warehouse schema for University.
I've tried to create a
[schema] http://i.imgur.com/EJPaVgq.jpg but it looks like im going in wrong direction
Case:
University currently has 5 courses – Foundation, Business Computing,
Business, Economics, and Law. It provides education on 5 levels. Each
academic year consist of 2 semesters. We have a number of modules that
belong to courses and some of them are core modules and some are
optional. Some modules are semester long and some are a year-long.
Each module has assessment components that have weights contributed to
the overall mark on the module. Assessments are of different types
like in-class test, coursework, final exam, etc. Students register on
courses starting from Foundation. Students might change the course
over time (e.g. transfer from Business to Business Computing).
University would like to know about: • students registration on
courses and modules and tracking changes to them over time.
• academic progress and performance of students and faculty in
different courses and modules including assessment components
(coursework, in-class test, final exam, etc.).
If possible, please attach schema as a screenshot or whatever. Im newbie to Data Warehouse stuff, so i dont know much about it and have no expirience in creating them.
I will be very grateful for any help that will somehow closer to solving the problem.
Sorry for my english.
Thank you, and have a nice day.
I am sure it would be hybrid snowflake as you have two fact tables here and will have other several dimension tables connected around
Some quick ref on the advantages of both types of schemas.
http://www.diffen.com/difference/Snowflake_Schema_vs_Star_Schema

Shouldn't FROM come before SELECT in Sql?

This is something that has always bothered me. Wouldnt it make more sense to have the FROM clause come before the SELECT? Whenever Im writing sql, especially with joins, I always figure out the FROM clause first and then write the SELECT.
Plus, putting the FROM first would allow for better intellisense inside the editor.
Does anyone know what the reasoning was to have SELECT come first? Am I only one who is bothered by this?
Yes it is strange and counterintuitive. Hugh Darwen theorises about how this state of affairs came about:
Do you take SELECT-FROM-WHERE for
granted, or do you, like me, find it
rather curious that the System R team
should have spurned the normal way of
writing expressions of arbitrary
complexity in favour of something
utterly idiosyncratic and, one might
say, rather dictatorial...?
The fact is that in the 1960s various
scripting languages (as we tend to
call such things these days) had come
about for the purposes of report
generation, especially ad hoc report
generation. We had one such language
in the prerelational DBMS called
Terminal Business System (TBS) that I
worked on for IBM from 1969-77. Our
language required the user to specify
the required report in a series of
steps that had to be given in the
prescribed order...
A somewhat similar but much more
sophisticated report generator was
later developed by IBM in the US, as
part of a product called (prosaically,
as was IBM's style in those days)
Generalized Information System
(GIS)... when I first looked at SQL,
my immediate reaction was "Oh no!
Son of GIS? Please not that!" I
might have been quite wrong about
this. The similarity I perceived
might have been illusory and even if
it was not, I have no firm evidence
that anybody in the System R team was
familiar with GIS. The fact remains
that the general style of a fixed
order of actions was the order of the
day at the time. I postulate that
SQL's SELECT-FROM-WHERE arose out of
this fashion.
From HAVING a Blunderful Time
The syntax was to resemble English.

How do I structure my database so that two tables that constitute the same "element" link to another?

I read up on database structuring and normalization and decided to remodel the database behind my learning thingie to reduce redundancy.
I have different types of entries that can be learned. Gap texts/cloze tests (one text, many gaps) and simple known-unknown (one question, one answer) types.
Now I'm in a bit of a pickle:
gaps need exactly the same columns in the user table as question-answer types
but they need less columns than question-answer types (all that info is in the clozetests table)
I'm wishing for a "magic" foreign key that can point both to the gap and the terms table. Of course their ids would overlap though. I don't like having both a term_id and gap_id in the user_terms, that seems unelegant (but is the most elegant I can come up with after googling for a while, not knowing what name this pickle goes by).
I don't want a user_gaps analogue to user_terms, because then I'd be in the same pickle when it comes to the table user_terms_answers.
I put up this cardboard cutout collage of my schema. I didn't remove the stuff that isn't relevant for this question, but I can do that if anyone's confusion can be remedied like that. I think it looks super tidy already. Tidier than my mental concept of this at least.
Did I say any help would be greatly appreciated? Answerers might find themselves adulated for their wisdom.
Background story if you care, it's not really relevant to the question.
Before remodeling I had them all in one table (because I added the gap texts in a hurry), so that the gap texts were "normal" items without answers, while the gaps where items without questions. The application linked them together.
Edit
I added an answer after SO coughed up some helpful posts. I'm not yet 100% satisfied. I try to write views for common queries to this set up now and again I feel like I'll have to pull application logic for something that is database turf.
As mentioned in the comment, it is hard to answer without knowing the whole story. So, here is a story and a model to match. See if you can adapt this to you example.
School of (foreign) languages offers exams for several levels of language proficiency. The school maintains many pre-made tests for each level of each language (LangLevelTestNo).
Each test contains several (many) questions. Each question can be simple or of the close-text-type. Correct answers are stored for each simple question. Correct terms are stored for each gap of each close-text question.
Student can take an exam for a language level and is presented with one of the pre-made tests. For each student exam, the exam form is maintained which stores students answers for each question of the exam. Like a question, an answer may be of a simple of of a close-text-type.
After editing my question some Stackoverflow started relating the right questions to me.
I knew this was a common problem, but I really couldn't find it, just couldn't come up with the right search terms, I guess.
The following threads address similar problems and I'll try to apply that logic to my own design. They all propose adding a higher-level description for (in my case terms and gaps) like items. That makes sense and reflects the logic behind my application.
Relation Database Design
Foreign Key on multiple columns in one of several tables
Foreign Key refering to primary key across multiple tables
And this good person illustrates how to retrieve the data once it's broken up across tables. He also clues me to the keyword class table inheritance, so now I know what to google.
I'll post back with my edited schema once I've applied this. It does seem more elegant like this.
Edited schema

Math needed for Sql Server

I've been working in Sql server jobs since 2 years now. Although I like it, sometimes I get the feeling that at certain times, I stall too much on some tasks, and I seem to be discouraged easily from things that involve relatively simple logic. It's like, at some point I must repeat a logical condition inside my head more than 2 or 3 times in order to understand it completely.
I have the feeling that this might be of my lack of math knowledge. Can anyone please let me know what area of mathematics I can study, that would improve my Sql server coding skills?
Thank you.
The field of maths most likely to be useful to you is Boolean logic
Set Theory is good for second place however it will often go into more detail that you are likely to need/use in understanding most sql queries.
A quick cheat that you may find useful is if you feed a boolean expression into wolfram alpha it will spit out a truth table for you which some find a much easier way of visualising the expression.
http://www.wolframalpha.com/input/?i=a+or+not+b
I recommend you study symbolic logic.
I'd suggest reading up on Set based Math.
See this link: http://weblogs.sqlteam.com/jeffs/archive/2007/04/30/thinking-set-based-or-not.aspx
Set theory helped me somewhat. Studied it in college years before I got into SQL, but being able to think of a bunch of numbers as a semi-amorphous blob of data and not as an ordered list of items really helps.
Get a copy of this book. It should prove to be most useful: The Art of SQL, by Stephane Faroult.