Project 3: Verification of palindromes
RECURSION:
is when a function calls itself (recursion).
FOR SERVING:
is to calculate an easier problem, because when a module calls itself on each call to the module decreases the difficulty until it is not necessary and the problem is resolved.
DO NOT USE WHEN ...
When your program is needed resources to functions that are already in use, I mean when you do not have to go back (when there is like a circle, with one output).
EXAMPLE ...
The calculation of factorials. The factorial of 0 is defined specifically as 1. The factorial of n, an integer greater than 0, is the product of all integers in the range between 1 and n.
TEAMWORK ...
We split the job in half, since we are 4 people, two of iterativity we play it, and the rest of recursion.
For lack of time we get together physically, but we were in touch through the internet,
each team made a program, even though we had differences, everything was afloat.
STRENGTHS:
I understood that to mean the group or team, most of the time things are shared, and the truth is not a team, if not a shared tranajo.
But that is in some respects good, because there people who work better alone than with people around, speaking in the area of \u200b\u200bconcentration.
AREAS OF OPPORTUNITY:
not understood this point well, I see opportunity
teamwork to minimize the delivery time of work, distributed among the peers, and in the end if there inner doubts, among all solve.
CONTRIBUTION TO WORK:
As my contribution to the work I think it was the division of labor.
regard to the project, because in conjunction with Daniela, we propose the sketch of our program, you for then modify it under the major requirements of Dr.
COMPARISON OF MY WORK WITH THE OTHER:
Actually I do not like the comparisons, I think when seeing the work and ask people they did, with the answers is the contribution and the interest that everyone puts, and so is the best way to qualify or to realize who really do things, who understands you and who you copy.
IMPROVE THE FUTURE:
Referring to a team in the future, it would improve choosing instead to my colleagues, that the qualification that will give us, I imagine it will be a group, and always I work there will be more than others, so it is necessary to take into account the schedules of others, to seek a better union as a team.
BLOGS OF MY PARTNERS:
Daniela Aguilar
Hector Tinajero
Salomon Karr
http://www.slideshare.net/danielaaguilar/palindromos
Friday, March 12, 2010
Friday, March 5, 2010
Reliable Brand Washer
**.... ** Project 2 Bin packing "Container Packing"
DESCRIPTION:
The container packing problem , the objects must be packed in a finite number of bins of capacity, while minimizing the use of containers.
There many variations of this problem, as in 2D packaging, packaging line, weight, packaging, packing by cost, and so on, it
try to comprehend and make according to the area of \u200b\u200bcontainer declared by me, by calculating the maximum number of items that can be stored safely.
so that
OPTIMA SOLUTION IF YOU HAVE B-minimum, B-value, to denote an optimal solution OPT.
examples of instances, optimal solutions:
The processing algorithm is in random order, for each object, attempts to place the object in the first bin that can hold the object. If not found bin, open a new folder and puts the object at the beginning again. Get
approximation factor of 2.
DECISION PROBLEM: is impossible for 2 containers of being in the majority of the half. The reason is that if at any time was a hub at most half which means having at least one field of V / 2, the algorithm does not open a new folder for any item whose size is at most V / 2. Only after the tray is filled with more than V / 2 or if an item with a size greater than V / 2 arrives, the algorithm can open a new folder.
You have to check if the object I need to save, rate less than the amount of container space.
OB \u0026lt;= MDE
OB = object, while MDE is defined as half the space of the container.
DECISION ALGORITHM:
estimated if the total dimension of the items is less than or equal to the total dimension of a container.
asking the user the actual amounts, and making transactions with the appropriate functions
Explain the asymptotic complexity :
The asymptotic upper bound is of great importance in computational complexity theory when defining classes complexity.
The tight asymptotic bound (Θ notation) is related to the asymptotic upper and lower bounds (notation Ω):
f (x) = Θ (g (x)) if and only if f (x) = O (g (x)) f (x) = Ω (x)
This means that you can save the maximum amount of items not exceeding the space to use the container.
desicion The problem belongs to P and NP, since
recuersos algorithms, it can do iterative, with a more optimal solution, however, the iterative, recursive can not be made, and involved more aspectors , and instead of making them easier to understand, become more complex, decreasing the simplicity is being sought.
If, NP-complete is the subset of decision problems in NP such that any problem in NP can be reduced in each of the NP-complete problems. You could say that the NP-complete problems are NP hard problems and very likely not part of the complexity class P.
Reason is that to be a polynomial solution for NP-complete problem, all NP problems would also have a solution in polynomial time (and therefore, it is shown that for an NP-complete problem there is no solution in polynomial time, none of the NP problems have a solution).
desicion There are several answers, but what is most effective, is to link the capacity of containers, the space equivalent of items in order not to saturate the container, and use the lowest possible, ie :
That if there is a total sum of items for a minimum number of containers, items can be placed evenly distributed, at the very minimum number of containers?
argue if NP-hard.
is NP-Hard, because there are several ways to find a good solution, but in some cases this is not the best, the optimal solution, using a fitting algorithm, first given the quick fix, but not optimal, putting each item in the container, and if they do not fit elsewhere.
recommend using a heuristic algorithm for this type of problem, because in this way, items are sorted according to volume, and relate to the container space, defining that all containers have the same capacity.
ALGORITHM FOR THE OPTIMIZATION PROBLEM:
Define the dimension of the containers, taking into account that everyone has the same capacity and dimension.
dimension is requested for each item, if it is more than one type of item it
And the number of items to keep,
According to the primary amount of items to keep (by multiplying by the overall dimensions, with a same type), this result is subtracted from the total dimension of a container, if you subtract the space to the container, and there are more items on hold, choose, to fill the entire container, not triple the weight of all items , the weight of the container.
Explain asymptotic complexity of this algorithm as well. Usually Landu notation used to refer to the superiorly bounded functions, which depend on other variables to be true which is defined as:
contenedoresf
A (x) belongs to items (g (x)) when there is a positive constant c such that from a number of articles x0, f (x) does not exceed a container (x). Means that the function f is less aga from a given value except for a constant factor.
DESCRIPTION:
The container packing problem , the objects must be packed in a finite number of bins of capacity, while minimizing the use of containers.
There many variations of this problem, as in 2D packaging, packaging line, weight, packaging, packing by cost, and so on, it
try to comprehend and make according to the area of \u200b\u200bcontainer declared by me, by calculating the maximum number of items that can be stored safely.
mathematical definition:
V Given the size bin, and a list ... @ n @ 1, sizes of items to pack, find an integer partition AA of
so that
OPTIMA SOLUTION IF YOU HAVE B-minimum, B-value, to denote an optimal solution OPT.
examples of instances, optimal solutions:
The processing algorithm is in random order, for each object, attempts to place the object in the first bin that can hold the object. If not found bin, open a new folder and puts the object at the beginning again. Get
approximation factor of 2.
DECISION PROBLEM: is impossible for 2 containers of being in the majority of the half. The reason is that if at any time was a hub at most half which means having at least one field of V / 2, the algorithm does not open a new folder for any item whose size is at most V / 2. Only after the tray is filled with more than V / 2 or if an item with a size greater than V / 2 arrives, the algorithm can open a new folder.
You have to check if the object I need to save, rate less than the amount of container space.
OB \u0026lt;= MDE
OB = object, while MDE is defined as half the space of the container.
DECISION ALGORITHM:
estimated if the total dimension of the items is less than or equal to the total dimension of a container.
asking the user the actual amounts, and making transactions with the appropriate functions
Explain the asymptotic complexity :
The asymptotic upper bound is of great importance in computational complexity theory when defining classes complexity.
f (x) = O (g (x)) Although containers (g (x)) is defined as a group, it is customary to write f (x) = O (g (x)) instead of f (x) ∈ O (g (x)). Also often speak of a function by naming only its expression, such as x ² instead of h (x) = x ², provided it is clear which is the parameter of the function within the expression. This graph gives a schematic example of how it behaves cg (x) with respect to f (x) when x tends to infinity.
The tight asymptotic bound (Θ notation) is related to the asymptotic upper and lower bounds (notation Ω):
f (x) = Θ (g (x)) if and only if f (x) = O (g (x)) f (x) = Ω (x)
This means that you can save the maximum amount of items not exceeding the space to use the container.
desicion The problem belongs to P and NP, since
recuersos algorithms, it can do iterative, with a more optimal solution, however, the iterative, recursive can not be made, and involved more aspectors , and instead of making them easier to understand, become more complex, decreasing the simplicity is being sought.
If, NP-complete is the subset of decision problems in NP such that any problem in NP can be reduced in each of the NP-complete problems. You could say that the NP-complete problems are NP hard problems and very likely not part of the complexity class P.
Reason is that to be a polynomial solution for NP-complete problem, all NP problems would also have a solution in polynomial time (and therefore, it is shown that for an NP-complete problem there is no solution in polynomial time, none of the NP problems have a solution).
desicion There are several answers, but what is most effective, is to link the capacity of containers, the space equivalent of items in order not to saturate the container, and use the lowest possible, ie :
That if there is a total sum of items for a minimum number of containers, items can be placed evenly distributed, at the very minimum number of containers?
argue if NP-hard.
is NP-Hard, because there are several ways to find a good solution, but in some cases this is not the best, the optimal solution, using a fitting algorithm, first given the quick fix, but not optimal, putting each item in the container, and if they do not fit elsewhere.
recommend using a heuristic algorithm for this type of problem, because in this way, items are sorted according to volume, and relate to the container space, defining that all containers have the same capacity.
ALGORITHM FOR THE OPTIMIZATION PROBLEM:
Define the dimension of the containers, taking into account that everyone has the same capacity and dimension.
dimension is requested for each item, if it is more than one type of item it
And the number of items to keep,
According to the primary amount of items to keep (by multiplying by the overall dimensions, with a same type), this result is subtracted from the total dimension of a container, if you subtract the space to the container, and there are more items on hold, choose, to fill the entire container, not triple the weight of all items , the weight of the container.
Explain asymptotic complexity of this algorithm as well. Usually Landu notation used to refer to the superiorly bounded functions, which depend on other variables to be true which is defined as:
contenedoresf
A (x) belongs to items (g (x)) when there is a positive constant c such that from a number of articles x0, f (x) does not exceed a container (x). Means that the function f is less aga from a given value except for a constant factor.
Saturday, February 20, 2010
Best Ways To Masterbate For Males
PROJECT 1, PROJECT 1
we chose to do 3 diagrams, but only finished two, the directory, which is what this acontinuación, assuming that the person who will find the number, knows the alphabet.
Our diagram starts asking the user if it is directory, because as look for a number in a directory, if not a directory. We complicate it a bit at the beginning, we did not know if the algorithm had to throw you a result to the user, but Dr. Elisa, told us they were just as instructions, or good but rather that he understood.
already with some clear ideas, we begin to do the job and ended up in the following.
DIAGRAM
# include
int dir;
main () {
do {do {
printf ("You have a directory? \\ n1." If \\ n2. "No \\ n");
scanf ("% d", & dir);
if (dir == 2)
printf ("Get a directory \\ n");
} while (dir == 2);
printf ("Find the section of the first letter the name \\ n ");
getch ();
printf (" Get the name you are looking identical to \\ n ");
getch ();
printf (" I find it? \\ n1 .- If \\ n2. "No \\ n");
scanf ("% d", & dir);
if (dir == 1)
{printf ("\\ nExiste more than a name like \\ n1. "If \\ n2." No \\ n ");
scanf ("% d ", & dir);
if (dir == 1
dir = = 2)
{printf ("\\ NCOMP full name \\ n");
getch ();
printf ("Dig \\ n1." If \\ n2. "No \\ n");
scanf ("% d", & dir);
if (dir == 1)
printf ("\\ nFelicidades SBEs and use a \\ n");
else printf ("\\ n \\ nThe person is not registered in this directory \\ n" );}
} else {
printf ("\\ nThe person is not registered in this directory \\ n");}
getch ();
clrscr ();
printf ("\\ want to make another appointment? \\ N1." If \\ n2. "No \\ n");
scanf ("% d", & dir);
} while (dir == 1);}
EXAMPLE 1
Start asking if the user directory, as in this case, if available, it usually starts giving instructions to the user to search the phone number you need, by the holder of that line.
When not find the name of the person, informs the user that this itself is not registered in the directory that you are looking for.
are asked if you want to another query, Notec, which is inactive when
given the instruction not want to see another number.
EXAMPLE 2
In this case the user has no board, so the machine is cycled, telling the user to get a directory, and asking if you already have, giving the necessary instructions until the user holds a directory in order to follow the instructions.
Here the user wants to make another query so that you repeat the instructions to find the next number of the person you are looking for.
The program does not end until the person says no need to make another query.
USER-MACHINE INTERACTION IS GIVEN, PRESS ENTER OR ANY ONE POINT AFTER EACH TRAINING AND GIVING NUMBERS ACCORDING TO THE CHOICES ARE GIVEN A CHOICE.
GERMAN GARCIA GABRIELA 1410319
VILLARREAL JUAN MANUEL CASANOVA
1453829 GROUP OF TUESDAY.
we chose to do 3 diagrams, but only finished two, the directory, which is what this acontinuación, assuming that the person who will find the number, knows the alphabet.
Our diagram starts asking the user if it is directory, because as look for a number in a directory, if not a directory. We complicate it a bit at the beginning, we did not know if the algorithm had to throw you a result to the user, but Dr. Elisa, told us they were just as instructions, or good but rather that he understood.
already with some clear ideas, we begin to do the job and ended up in the following.
DIAGRAM
the pseudocode:
# include
# include
int dir;
main () {
do {do {
printf ("You have a directory? \\ n1." If \\ n2. "No \\ n");
scanf ("% d", & dir);
if (dir == 2)
printf ("Get a directory \\ n");
} while (dir == 2);
printf ("Find the section of the first letter the name \\ n ");
getch ();
printf (" Get the name you are looking identical to \\ n ");
getch ();
printf (" I find it? \\ n1 .- If \\ n2. "No \\ n");
scanf ("% d", & dir);
if (dir == 1)
{printf ("\\ nExiste more than a name like \\ n1. "If \\ n2." No \\ n ");
scanf ("% d ", & dir);
if (dir == 1
dir = = 2)
{printf ("\\ NCOMP full name \\ n");
getch ();
printf ("Dig \\ n1." If \\ n2. "No \\ n");
scanf ("% d", & dir);
if (dir == 1)
printf ("\\ nFelicidades SBEs and use a \\ n");
else printf ("\\ n \\ nThe person is not registered in this directory \\ n" );}
} else {
printf ("\\ nThe person is not registered in this directory \\ n");}
getch ();
clrscr ();
printf ("\\ want to make another appointment? \\ N1." If \\ n2. "No \\ n");
scanf ("% d", & dir);
} while (dir == 1);}
EXAMPLE 1
Start asking if the user directory, as in this case, if available, it usually starts giving instructions to the user to search the phone number you need, by the holder of that line.
When not find the name of the person, informs the user that this itself is not registered in the directory that you are looking for.
are asked if you want to another query, Notec, which is inactive when
given the instruction not want to see another number.
EXAMPLE 2
In this case the user has no board, so the machine is cycled, telling the user to get a directory, and asking if you already have, giving the necessary instructions until the user holds a directory in order to follow the instructions.
Here the user wants to make another query so that you repeat the instructions to find the next number of the person you are looking for.
The program does not end until the person says no need to make another query.
USER-MACHINE INTERACTION IS GIVEN, PRESS ENTER OR ANY ONE POINT AFTER EACH TRAINING AND GIVING NUMBERS ACCORDING TO THE CHOICES ARE GIVEN A CHOICE.
GERMAN GARCIA GABRIELA 1410319
VILLARREAL JUAN MANUEL CASANOVA
1453829 GROUP OF TUESDAY.
Friday, February 19, 2010
How High Does The Flames In A Propane Heater
first algorithm, the second algorithm
THIS IS ANOTHER ALGORITHM WE DID, is the bookseller at first I thought it had to plot, or graphically view the books on the shelf.
This program gives us choose 3 ways of arranging the books by title, author, and EDITORIAL. We
# include
# include
int option;
int main ()
{printf ("About the books they want to accommodate the bookseller \\ n ");
do {printf (" \\ nYou books on the shelf? \\ n1. "If \\ n2." No \\ n ");
scanf ("% d ", & , option);
} while (opcion! = 1 & & Option! = 2) do {
do {printf ("\\ nWhat you order, pick and choose? \\ N1.-title \\ n2.-Author \\ n3.-Editorial \\ n ");
scanf ("% d ", & option);
} while (choice \u0026lt;1
option> 3);
clrscr ();
do {
switch (option) {
Case 1:
{printf ("\\ nFor TITLE \\ n");
getch ();
printf ("Take a book \\ n" )
getch ();
printf ("Initial Search title \\ n");
getch ();
printf ("At the bookstore where you are looking for that initial \\ n") ;
getch ();
printf ("If there are many books there, looking every point \\ nof title of the book to find a place \\ n");
getch ();
option = 0 ;
break;}
case 2: {
printf ("\\ nFor AUTHOR \\ n");
getch ();
printf ("Take a book search the author's name \\ n ");
getch ();
printf (" In the bookstore looking for the place where you the author ");
getch ();
printf (" \\ n \\ nIf there are many books there, find some number or name of the title \\ n ");
getch ();
printf (" Get the right place according to the initial number or title, in alphabetical order \\ n ");
getch ();
option = 0;
break;}
case 3: {
printf (" \\ nFor EDITORIAL \\ n ");
getch ();
printf ("\\ symptoms a book, find the name inicial publisher \\ n");
getch ();
printf ("\\ nIn the bookstore looking for the place where this editorial will \\ n ");
getch ();
printf (" \\ nA one or more books \\ n1. "If \\ n2." No \\ n ");
scanf ("% d ", & option);
if (option == 2) {
option = 0;
break;}
else {printf (" Arrange them by author ");
getch ();
option = 2;
break;}
}} while (option == 2);
printf ("\\ nColocala there \\ n");
getch ();
clrscr ();
printf ("\\ nYou more books to accommodate \\ n1." If \\ n2. "No \\ n");
scanf ("% d", & , option);
} while (option == 1);
printf ("\\ nClick Done \\ n");}
PROGRAM EXECUTED IN PICTURES, first
example
The program begins by telling the user to close the books at the bookstore, he asks if you have books on the shelf and the user says no, the next question is the one with the switch,
that with which we are displaying the 3 different options gives the user choice.
then remind the user the order said they have their books, gives instructions, asks that if you have more books to accommodate, and in this case the end user and to accommodate the books, the other option we will see in following example.
The user chooses to order the books by author, which was what we had asked Dr. but we did a little different.
The program reminds the user the option you chose.
Gives instructions
He asks that if you have more books to accommodate, in this case, the user
says if that still does not end.
The question that continues is the same as the beginning, we used the 3 cases, but if the user does not remember as you are ordering your bookstore, terrible mistake will occur, when looking for a book.
Le repeats the instructions, asks again if you have more books to accommodate the user says no.
and there ends the user to accommodate his books, and the program give instructions.
NOTE: The program does not end until the user tells you books no longer accommodate.
This program gives us choose 3 ways of arranging the books by title, author, and EDITORIAL. We
a little complicated, because we did not know how complicated
was, but when analyzing the problem, we conclude the following.
was, but when analyzing the problem, we conclude the following.
the pseudocode.
In the pseudocode, we managed switch, with if, to give the user the choice of how to accommodate their books in the lbrero. and move and accommodate the other, until it ends.
# include
# include
int option;
int main ()
{printf ("About the books they want to accommodate the bookseller \\ n ");
do {printf (" \\ nYou books on the shelf? \\ n1. "If \\ n2." No \\ n ");
scanf ("% d ", & , option);
} while (opcion! = 1 & & Option! = 2) do {
do {printf ("\\ nWhat you order, pick and choose? \\ N1.-title \\ n2.-Author \\ n3.-Editorial \\ n ");
scanf ("% d ", & option);
} while (choice \u0026lt;1
option> 3);
clrscr ();
do {
switch (option) {
Case 1:
{printf ("\\ nFor TITLE \\ n");
getch ();
printf ("Take a book \\ n" )
getch ();
printf ("Initial Search title \\ n");
getch ();
printf ("At the bookstore where you are looking for that initial \\ n") ;
getch ();
printf ("If there are many books there, looking every point \\ nof title of the book to find a place \\ n");
getch ();
option = 0 ;
break;}
case 2: {
printf ("\\ nFor AUTHOR \\ n");
getch ();
printf ("Take a book search the author's name \\ n ");
getch ();
printf (" In the bookstore looking for the place where you the author ");
getch ();
printf (" \\ n \\ nIf there are many books there, find some number or name of the title \\ n ");
getch ();
printf (" Get the right place according to the initial number or title, in alphabetical order \\ n ");
getch ();
option = 0;
break;}
case 3: {
printf (" \\ nFor EDITORIAL \\ n ");
getch ();
printf ("\\ symptoms a book, find the name inicial publisher \\ n");
getch ();
printf ("\\ nIn the bookstore looking for the place where this editorial will \\ n ");
getch ();
printf (" \\ nA one or more books \\ n1. "If \\ n2." No \\ n ");
scanf ("% d ", & option);
if (option == 2) {
option = 0;
break;}
else {printf (" Arrange them by author ");
getch ();
option = 2;
break;}
}} while (option == 2);
printf ("\\ nColocala there \\ n");
getch ();
clrscr ();
printf ("\\ nYou more books to accommodate \\ n1." If \\ n2. "No \\ n");
scanf ("% d", & , option);
} while (option == 1);
printf ("\\ nClick Done \\ n");}
PROGRAM EXECUTED IN PICTURES, first
example
The program begins by telling the user to close the books at the bookstore, he asks if you have books on the shelf and the user says no, the next question is the one with the switch,
that with which we are displaying the 3 different options gives the user choice.
then remind the user the order said they have their books, gives instructions, asks that if you have more books to accommodate, and in this case the end user and to accommodate the books, the other option we will see in following example.
USER-MACHINE INTERACTION, IS GIVEN OR PRESS ENTER Letters, then an instruction, and after it appears the TEXT, AND CHOOSING A NUEMRO depending on which options are given.
SECOND EXAMPLE:
In this case, the user tells us that no books on the shelf.
The user chooses to order the books by author, which was what we had asked Dr. but we did a little different.
The program reminds the user the option you chose.
Gives instructions
He asks that if you have more books to accommodate, in this case, the user
says if that still does not end.
The question that continues is the same as the beginning, we used the 3 cases, but if the user does not remember as you are ordering your bookstore, terrible mistake will occur, when looking for a book.
Le repeats the instructions, asks again if you have more books to accommodate the user says no.
and there ends the user to accommodate his books, and the program give instructions.
NOTE: The program does not end until the user tells you books no longer accommodate.
GERMAN GARCIA GABRIELA 1410319
VILLARREAL JUAN MANUEL CASANOVA 1453829
Subscribe to:
Posts (Atom)