assignment_2(附答案)
Assignment2

Reading Report ⅠSource of the reading material InternetTitle The Road to Success Author Andrew CarnegieSummary:In this article , the author tells us a prime condition and great secret for achieving success during our future career life . That is , concentrating our energy , thought , and capital exclusively upon the business in which we are engaged . It is well that young men should begin at the beginning and occupy the most subordinate positions . Once we have begun in one line , we should resolve to fight it out on that line , lead in it , adopt every improvement , have the best machinery , and know the most about it .Reflection or Response:During our future life , we should act as what the author told us , that is aiming for the highest , concentrating , expenditure always within revenue and being patient . If we keep the belief that ―My place is at the top‖ in mind , we will be successful someday . A s Emerson says,―no one can cheat you out of ultimate success but yourselves.‖Vocabulary explanation list:1.subordinate adj. 次要的,从属的2.threshold n. 开始,开端,极限3.janitor n. 守卫,门警,管理人4.extensive adj. 广阔的,广泛的5.exclusively adv. 排外地,专有地6.scatter v. 分散,散开,撒开7.tumble v. 翻倒,摔倒,倒塌8.speculate v. 推测,思索9.expenditure n. 支出,花费10.at the threshold of 在…的开始11.salutary adj. 有益的,有用的,有益健康的12.put all one's eggs in one basket 孤注一掷1.But if by chance the professional sweeper is absent any morning, the boy who has the genius of the future partner in him will not hesitate to try his hand at the broom.【结构解析】“by chance”的意思是“碰巧”,“who has the genius of the future partner in him”是定语从句修饰“the boy”。
Assignment 2,有车一族翻译

Assignment 225 years ago, what China’s consumer most wanted was a color TV set, besides, “buy wheels” means buy a bicycle. Today, China has made a great change. After more than 30 years’ economic reform, Chinese people becomes richer and richer. With the development of national car Industry, car price have been ratcheting down, which means ordinary people can afford a car.Zhangming, an employee in a foreign company, bought a car last year, when it comes to the reason why he bought the car, he said that buying a car is always his dream. When he was a child, he saw people driving freely for shopping and traveling in the foreign movies. He really admired this kind of life. Now, given that his income was pretty good and the car price was acceptable, he decided to buy one, which later led him to a more convenient and colorful life. He can drive to work comfortably while listening the music instead of taking the bus. Besides, he can drive the car to travel with friends to suburban areas on weekends. comparing to the days that having not yet bought this car, he had to stay at home or strolling within the downtown. The car owner like Zhangming, they have experienced both happiness and annoyance from their cars. The first is traffic jam. As the number of private cars increases, cities’ traffic problem has been increasingly severe. Therefore, Zhangming has to leave home at 7:00 a.m. everyday for work to make sure staying ahead of 8:00 a.m. working time, in spite of the close proximity to his company. Secondly, the oilprice is increasing everyday, which pushed up the running costs of the car. As for many car owners, they may be able to afford a car, but unable to run it.“If the traffic keeps worsening and gasoline price continues to rise,” he added, “I’m going to take subway to work, which only takes 20 minutes. The ticket price is quite lower than the cost of driving.”Zhang’s idea is typical for general car owners. With the development of public transportation in China becomes more and more convenient and comfortable, an increasing number of car owners would prefer public transportation. The Chinese people, like many in other foreign metropolises, would certainly undergo a circle in transportation that they begin with private cars but end up with public transportation service.。
Assignment2(1)

DS 310Assignment 2Please submit your solution to Canvas by 11:59pm,February 24th.Problem 1-Logistic Regression (10pts)Let g (z )=11+e −z be the logistic function.Please •(5pts)Show that d dz g (z )=g (z )(1−g (z ))•(5pts)Show that 1−g (z )=g (−z )•(Optional)Consider the cross entropy loss function for logistic regression simplified so there is only one training example:J (θ)=−y log h θ(x )−(1−y )log(1−h θ(x )),h θ(x )=g (θT x )=11+e −θT x (1)Show that the partial derivative with respect to θj is:∂∂θj J (θ)=(h θ(x )−y )x j (2)Problem 2-Multi-class Logistic Regression (10pts)For multi-class classification using binary logistic regression,one way is to use the One-vs-All (One-vs-Rest)as we discussed in the class.Another way is to extend the binary logistic regression to multi-class logistic regression using softmax function.Assume there are K classes,for a data sample x ∈R n ×1,the predicted probability that x belongs to class k is given as (for simplicity,we don’t add intercept)P (y =k |x ;W )=exp(w T k x ) K i =1exp(w T i x )(3)where w k ∈R n ×1is the parameters to be learned.•(3pts)Please simplify Eq.(3)for K=2.Does the simplified one have the same formatas binary logistic regression?Hint:exp(w T 2x )exp(w T 1x )=exp((w 2−w 1)T x )•(5pts)Assume that K=3,x =[1,2,2],w 1=[1,0,1],w 2=[0,1,1]and w 3=[1,1,0],please calculate P (y =1|x ;W ),P (y =2|x ;W ),and P (y =3|x ;W ).•(2pts)For the above example,i.e.,x =[1,2,2].Based on the calculation,which class should we classify x =[1,2,2]and why?•(Optional)For simplicity of notation,let’s denote y k =P (y =k |x ;W ),with P (y =k |x ;W )=exp(w T k x ) K i =1exp(w T i x )as defined in Eq.(3),please derive the partial derivative ∂y k ∂w j ,j =kProblem 3(5pts)You run gradient descent for 15iterations with α=0.3and compute J (θ)after each iteration.You find that the value of J (θ)decreases quickly then levels off.Based on this,which of the following conclusions seems most plausible?A:Rather than use the current value of α,it would be more promising to try a larger value of α(say α=1.0).B:α=0.3is an effective choice of learning rate.C:Rather than use the current value of α,it would be more promising to try a smaller value of α(say α=0.1).Problem 4(5pts)Suppose you have the following training set,and fit a logistic regression classifier h θ(x )=g (θ0+θ1x 1+θ2x 2).Which of the following are true?Check all that apply.A:J (θ)will be a convex function,so gradient descent should converge to the global minimum.B:Adding polynomial features (e.g.,instead using h θ(x )=g (θ0+θ1x 1+θ2x 2+θ3x 21+θ4x 1x 2+θ5x 22)could increase how well we can fit the training data.C:The positive and negative examples cannot be separated using a straight line.So,gradient descent will fail to converge.D:Because the positive and negative examples cannot be separated using a straight line, linear regression will perform as well as logistic regression on this data.Problem5(5pts)Suppose you train a logistic classifier hθ(x)=g(θ0+θ1x1+θ2x2).You obtainθ0=−6,θ1=1andθ2=0.Which of the followingfigures represents the decision boundary found by your classifier?(a)A(b)B(c)C(d)DProblem6Feature Scaling(10pts)For the data samples shown below,please perform normalization and standardization.x1x2y1.52.00.3-1.0 2.0-0.2-2.0-1.00.12.0-2.50.4Problem7Use Sklearn Logistic Regression(10pts)We will use the implementation of Sklearn for Logistic Regression.Please download the notebookfile“Assignment2Q5”from Canvas.You can either upload the notebookfile to Google Colab tofinish this question or run locally.Following the instructions in the notebook andfill in the key code.After that, in the browser,click on“File”,Select“Print”,and choose“Save as PDF”.Submit the pdf along with your solution to other problems to Canvas.。
assignment-2

assignment-2 Questions of module01Read the chapter01-chapter03 of textbook, answer the following questions:1.Discuss the meaning of each of the following terms:(a) dataData is the physical symbols that represent different kinds of information.(b) databaseA Shared collection of logically related data (and a description of this data), designed to meet the information needs of an organization.(c) database management systemDatabase management system is a software system that enables users to define, create, and maintain the database and that provides controlled access to this database.(d) data independenceThis is essentially the separation of underlying file structures from the programs that operate on them,also called program-data independence.(e) views.A virtual table that does not necessarily exist in the database but is generated by the DBMS from the underlying base tables whenever it’s accessed.2.What is the difference between conceptual and logical data models? Giveexamples of each.Conceptual data models: Used to describe data independently of any system;Purpose is to represent the concepts of the real world;Used in early stages of database design;Example: entity-relationship (E-R) modelLogical data models:Used in DBMSs for the organization of data at a level that abstracts from physical structuresExample:the relational data modelthe network data modelthe hierarchical data model3.Define the terms relation, schema, instance and attribute. Give examples.Relations is a table with columns and rows.Example:Courses(course,tutor,room)The schema represents the structure of the data .Example:Schema of Courses is (Course, Tutor, Room)The instance represents the actual values.Example:The instances of Courses are the contents of the tables4.What is the purpose of the three levels (i.e. physical, logical and external) fora DBMS?Separate each user’s view of the database from the way the database is physically represented.5.What is the difference between the DML and DDL parts of SQL? What partwould you use to (i) create a table to hold information about employees, (ii) add information about a new employee to the table, and (iii) find out thesalary of one of the employees?The database administrator often interacts with the database via a “Data Definition Language” or DDL.Database users interact with the database via a “Data Manipulation Language” or DML.DDL DML DML6.Describe the five components of the DBMS environment and discuss howthey relate to each other.Hardware:The computer system(s) that the DBMS and the application programs run on. This can range from a single PC, to a single mainframe(主机), to anetwork of computers.Software:The DBMS software and the application programs, together with theoperating system, including network software if the DBMS is being used over a network.Data:Used by the organization.The data acts as a bridge between the hardware and software components and the human components.Procedures:Instructions and rules(操作说明和规则)that should be applied to the design and use of the database and DBMS.People:Includes DBMS designers and implementers(实现者), database designers, database administrators ( DBAs), application programmers, and end-users.7.What is logical data independence?Logical data independence refers to the immunity of the external schema to the changes in the conceptual schema.8.what is physical data independence?Physical data independence refers to the immunity of the conceptual schema to the changes in the internal schema.。
ASSIGNMENT 2 Solutions

E(x2 )
2 2 x f ( x)dx x 2 xdx 0
1
1 41 1 x 0 2 2
ASSIGNMENT 2
1. Three balls are drawn in succession without replacement from an urn containing 2 red balls and 3 black balls. Let W be a random variable giving the number of black balls minus the number of red balls drawn. List the elements of the sample space S for the three draws and to each sample point assign a value w of W. Key: S ●●● ●●● ●●● ●●● ●●● ●●● ●●● W -1 -1 -1 1 1 1 3
3. Consider the density function
2x ke , x 0 f ( x) 0, elsewhere
(a) Find the value of k (b) Find F(x) and use it to calculate P(-0.5<x<-0.2 ). Key:
3 0.1 0.133 0.167
0 X 1 2
(a) (b) (c) (d)
0 0.033 0.067
0.033 0.067 0.1
0.067 0.1 0.133
P( X P( X P( X P( X
1, Y 2) 0.067 0.1 0.167 ; 1, Y 1) 0.033 0.067 0.1 0.067 0.1 0.133 0.5 ; Y ) 0 0.033 0.067 0.1 0.067 0.1 0.133 0.133 0.167 0.8 ; Y 3) 0.1 0.1 0.1 0.3 ;
高级写作 Assignment2 (2)

WangKang0901010303Class 3Review of “The Decline and Fall of the British University”IntroductionUniversities are probably the most common institutions in the modern society. Almost every young man gets the opportunity to be exposed to one university. However, in the past, the universities are places that not everybody has a chance to get into. The gate of the universities was open only to a few people who could read and write and wanted to learn. The universities are places that people in there can achieve and disseminate knowledge. So Dr. Mark Tarver who used to be a lecturer in a university thought that the British university is in a decline and fall in his article “The Decline and Fall of the British University”.SummaryIn the article, Dr. Mark Tarver said that the education in university had changed over these years. In his years as a lecturer, he experienced the expansion of the university system happened in the post-war Britain. The universities had to peg their incomes and reduce the funding for students. So the universities were forced to face the choice of less money and redundancies or reduce their demands. And because of this kind of expansion, the educational quality of the university had fallen. If the universities want more money, they have to keep the students as more as possible. So it is getting harder for the lecturers to fail their students, and the lecturers have to simplify their assignments. And so did the lecturers’ quality. Tarver said that today’slecturers believe that the more papers they write, the better a lecturer they will be. So the lecturers began to concentrate on working with paper after paper. Tarver believed that such a kind of life of a lecturer was a lie so he quitted and this new kind of educational system would bring the students less knowledge and more debts. Arguments and EvaluationIn his article, Dr. Mark Tarver pointed out three problems as his arguments to convince his thesis. In his opinion, the British universities were in a decline and fall. He believed that today’s educational system is getting worse and worse. However, there are some important points that Dr. Mark Tarver should have considered carefully when he makes his viewpoint. Tarver thought the expansion of the university system has bad influence for modern universities. Actually, the expansion can help to disseminate the modern knowledge to some degree. It would improve the level of education. It would be much easier for normal people to get higher education. And the educational quality is not really falling. Because there are more and more people get into the university, the lecturers’ assignments should adapt to the overall standard of students’knowledge. So the lecturers should not fail so many students. Dr. Mark Tarver pointed out some potential risks in today’s Britain universities. For example, the lecturers’ paper works may really have some disadvantages to the lecturers’ quality. Yet most of his evidence was based on his own experience as a lecturer in a computer school, which was too unbalanced to judge the whole situation of Britain universities. Actually in some other universities, the situation was not like what Tarver had said. So it was not right to believe what Dr. Mark Tarver said just because of his personalexperience.ConclusionAs a former lecturer of a university, Dr. Mark Tarver awakens people of the potential dangers of the modern educational system of the universities. He pointed out the shortage of the modern system of university education. However, his view of this current situation is somehow too rash and his understanding of it is obviously limited. So we should recognize the reality clearly and try to find out the advantage of today’s educational system.(611words)。
assignment 2

Marking Symbols and Grades∙Agr (Agreement)∙Amb (Ambiguity)∙Awk (Awkward)∙Colloq (Colloquial)∙Constr (Construction)∙CS (Comma Splice)∙Dgl (Dangling Modifier)∙Frag (Fragment)∙Id (Idiom)∙Para(Paragraph)∙ll (Parallelism)∙P (Pronoun Reference)∙Ref (Punctuation)∙Red (Redundant)∙Rep (Repitition)∙R-O (Run On)∙Sp (Spelling)∙T (Tense)∙Trans (Transition)∙Wdy (Wordiness)∙WW (Wrong Word)∙Grades Or Why Did I Get That B-Agreement (Agr)Subject and verb do not match, or pronoun and antecedent. The easiest way to make this error is simply to forget an "s":"The quick brown fox jump over the lazy dog."More complicated agreement problems arise with multiple subjects, intervening phrases and pronouns. See the section on agreement in the grammar section for further information.Ambiguous (Amb)Whether the error is one of grammar or diction, the comment ambiguous means that what you have written is confusing. An example of grammatical ambiguity is the following pair of sentences:Biff is presented to us as an All-American boy. As he grows up all Willy can do is criticize his son.This construction implies that it is Willy who is doing the growing-up, rather than Biff. (The sentences need to be reworked:"Biff is presented to us as an All-American boy. As he grows up, he receives nothing but criticism from Willy."Ambiguity can also be produced by a mistake in vocabulary (many examples are dealt with in the Dictionary of Usage (45Kb)--see, for example, the entries on allusion/illusion and continual/continuous or word order (is a "big boys' school" a big school for boys or a school for big boys?).Awkward (Awk)This term can cover a variety of errors, but in general applies to anything unwieldy in your essay.Sentences become awkward through a combination of structural flaws, wordiness and incorrect usage.For King Lear, because of the one fault he makes, he pays for it dearly.This sentence is awkward because it contains an extra phrase that does not fit grammatically ("For King Lear") and because the student uses "fault" unidiomatically (a better word would be "error").A subordinate clause or phrase placed incorrectly can cause confusion or awkwardness:Besides that of her parents, it is not until Jane arrives at Lowood that she experiences love.The opening clause should be at the end:It is not until Jane arrives at Lowood that she experiences love other than that of her parents.The construction of the sentence can also lead to awkwardness:Cocteau seems to almost ridicule, in the process, the Greek belief in nobility.The phrase "in the process" interrupts the flow of the sentence; it should come at the beginning or the end. In addition, the modifier "almost" is placed awkwardly: it splits an infinitive, and should be closer to the verb it modifies. A more effective way to structure the sentence would be this:In the process, Cocteau almost seems to ridicule the Greek belief in nobility.Awkward indicates that a variety of problems are making your sentences unreadable.Colloquial (Colloq)The word or phrase you have used is inappropriate in a formal essay, because it is too slangy:The very idea of Titania falling in love with Bottom seems a tad preposterous.Or the grammar may be too loose, too conversational:Another thing is, every sentence ends with a question mark.Construction (Const)The construction of your sentence has made it awkward or confusing. Often the problems are the result of starting the sentence with the wrong clause or phrase. When a sentence doesn't work, start it from a different part. Pick it up and shake it. See the pages on sentences for problems to avoid in construction.Comma splice (CS)You have joined two sentences together with a comma:Lear was a majestic ruler when he was young, however, as he became older, his temptations clouded his thought.See the full discussion on comma splices in the pages about sentences.Dangling or Misplaced Modifier (Dgl)A dangling modifier has been placed in a sentence where it has nothing to modify:Flying into Victoria, the trees looked lovely.This sentence suggests that the trees are flying. The sentence must be reworked so that the person doing the flying is mentioned.A misplaced modifier has been placed next to the wrong word:He attacked the dragon with a sword.The sentence suggests that it's the the dragon that has the sword. While the meaning is often clear in context, the sentence would benefit from rewritingHe drew his sword and attacked the dragon.For more, see the discussion on dangling modifiers in the section on sentences.Fragment (Frag)A sentence fragment is a sentence without a verb. Usually the student is appending a phrases to a sentence, but does not understand the function of semi-colons or parentheses:There are a few events in the play which are important both in themselves and symbolically. The first one being the plucking of Gloucester's eyes.Every sentence must have a subject and a verb (in this case, there is no verb, only a participle ).For more, see the page on sentence fragments in the section on sentences.Idiom (id)An idiom is an accepted combination of words whose meaning is greater than the sum of its grammatical parts. Some idioms, such as "such as" or "have lunch", are established components of written language; others, like "Let's do lunch" or "What's up?" are informal or slang. The comment "idiom" may mean that you have used an informal idiom inappropriately, or that you have deviated from standard idiomatic usage.For example, while it would be logical and grammatical to say "get into the bus," English idiom requires that we say "get onto the bus." See the page on awkwardness for another example.ParagraphIf this symbol occurs in the middle of a paragraph, it means that you should have started a new paragraph at that point. This line joining paragraphs indicates that the two paragraphs should have been one. This Guide includes extensive information on paragraphing.ParallelismFaulty parallel sentences occur endlessly in student essays. A parallel sentence must have the same grammatical structure in each of its clauses (hence the term "parallel"). See the section on sentences for fuller instructions on parallelism.Pronoun Reference (P)This comment may mean that you have used the wrong pronoun (e.g. "He which hesitates is lost") or that it is unclear what the pronoun refers to.Confusion is particularly prevelant when you are writing about two people of the same sex, in which case you often end up with sentences like this one:She told her that her face was dirty, and she told her to take a bath.Another pronoun problem is the indeterminate "this":Because of this, I can't go to the moon.The reader will ask, "This what?" When you use a pronoun, make sure that its meaning is absolutely clear.For more information, see the pages about subject/verb agreement,pronoun agreement, and the general discussion on agreement.Punctuation (Ref)You have used the wrong punctuation symbol (e.g. a period instead of a comma). Usually sheer carelessness is the reason, but students often misuse more complicated punctuation marks like the colon and the dash.For a general discussion, see the pages on punctuation and the comma splice.Redundant (Red)You have qualified a word that needs no qualification.For example, a student wrote of Lear and Cordelia that their bond is "mutual." A bond between two people can only be mutual. Another example is the description "He wore a hat on his head." There is no need to mention that the hat is on his head; one can assume that he would wear it there. Be aware of the implications of words to avoid redundant observations.Another common redundancy is the use of synonyms. Students feel that they need to produce lists instead of single words, and thus write sentences like "If you own or possess something of value." "Own" and "possess" are virtually the same word, so using both is redundant.Repetition (Rep)You have repeated a word or phrase unnecessarily.For example, in this sentence a pronoun should have been used:The desire people have to nurture their dogs arises from human tendency to identify with their dogs.The second half of the sentence should read: "...from the common tendency to identify with them."Repetition may also refer to ideas that you have used more than once or to sentences that are rewrites of previous ones. Make sure your essays move forward with each sentence and do not belabor your points.Run-On Sentence (R-O)Similar to a comma splice,but without the comma. A run-on sentence simply welds two sentences together with no break:I like to study I like to surf.Again, be certain that you understand what a main clause is.Spelling (Sp)You have made a spelling error. If it is a typo, be sure to proofread your next paper; if it is a genuine spelling error, learn and remember the correct spelling. See the spelling pages for more rules and advice.Tense (T)A common problem in literary essays is switching tense when discussing plot.It is standard practice to talk about events in a narrative in the present tense:When Kit and Port arrive in El Ga'a, Port becomes ill.Only use the past tense if you are discussing one event and wish to make reference to something that happens earlier in the book:Port discovers that his passport is missing, and realizes that Eric must have stolen it when they were togetherTransition (Trans)A faulty connection has been made between two ideas.One possibility is that you have not joined them effectively enough; for example, a linking word such as because might be needed. Another possibility is that you have used a transition incorrectly; perhaps you have linked two ideas that should not really be related. See the page on paragraph transitions for more details.Wordy (Wdy)Like awkward, a sign that your essay does not flow well. There are numerous suggestions on how to avoid wordiness throughout this Guide. Wrong WordYou have used one word where another would be more accurate (e.g. using "continual" instead of "continuous"). This mistake can be disastrous, as when Dan Quayle proudly stated that "Republicans understand the meaning of bondage between a mother and child." See the Usage dictionary (12 k) for a list of words commonly confused or misused.Grades—Or, Why Did I Get That B-?What A Grade MeansThe University of Victoria uses a nine point grading system divided into first class (A+, A, A-), second class (B+, B, B-), pass (C+, C, D) and fail (E, F). The Department of English offers these guidelines to its instructors on the meaning of the grades that are assigned:First Class ("A" range)Given for excellence in style and content, with evidence of perceptiveness and originality;ideas are formulated clearly and understood fully by the writer; the first class paper demonstrates a superior performance in most areas of expression and content.Second Class ("B" range)Given for good work, which may be flawed by omissions or by minor weaknesses of style or organization; often the paper tends toward vagueness or formlessness, as if the ideas are not quite clear in the writer's mind; often, too, it may contain a limited number or range of ideas, as if the writer has some general knowledge of the subject, but has not thought the material through; although papers in the upper range may suggest superior work, the second class essay remains a good, solid, but not spectacular performance. Pass ("C" range and "D")Given for satisfactory writing which contains errors in content, style, and organization;ideas are pedestrian and suggest no firm grasp of the material; sentences and ideas are dull and repetitive; "C" papers (C+ and C; there is no C- grade) are in no danger of failing, but have little hint of anything more than an average performance. "D" papers are on the borderline; they suggest incompetence in content and style; organization and substantiation are probably deficient, and the writing shows difficulty in dealing with written language; there may be some redeeming factors, but the result suggests failure rather than a passing grade.Fail ("E" and "F")Given for unsatisfactory performance; mechanical errors seriously inhibit understanding;any points made tend to be superficial; there is no sense of audience, of paragraphing, of making an argument, or of understanding the material. An "E" paper may suggest possibilities for improvement (and may qualify for a supplemental examination), but both failing papers clearly demonstrate incompetence.Here is another comment, specifically on the kind of paper that earns a respectable but unspectacular grade, a B-:The common B- paper will have nothing really bad, nothing really good. There will be a thesis, but it will probably be obvious, almost a truism; there will be paragraphs, but they will be short, and there will be only a few details of support for generalizations; there will be a conscious attempt at organization, but it will again be obvious (this is my introductory passage. . . here comes the conclusion. . .); sentences will be accurate but short, and will tend to be monotonous;there will be a few comma errors (one where there should be two) but probably no run-on sentences; vocabulary will be unadventurous.Then there is the less common, more frustrating B-. There will be ideas, and signs of an active intelligence, but there will be more serious problems of expression: syntax in particular will be unbalanced or contorted, with awkward parallel constructions, problems of agreement,and dangling modifiers; there may be more spelling errors, often of less common words (though this is the kind of paper where you get the its/it's confusion).Grading is more complicated than summaries such as this can show; if you do not understand why you were given a particular grade, you should first of all read over the essay carefully, deciphering the instructor's comments. Then, if the reason is still not clear, you should consult the instructor directly.There are many reasons why you may not be performing as well as you expect. Statistics show that students coming to university from high school will on the whole earn grades almost one grade point lower than they are used to; those transferring from colleges may expect to perform about half a grade lower. Essays at the university level inevitably require more intellectual effort, and the result of dealing with more complex ideas is that sometimes the sentences and paragraphs you are used to using are no longer adequate.< p> The purpose of this manual is to give you the tools to improve your performance, not only in English courses, but in all courses that require thinking, organizing, and writing. There are not many at the University that do not.。
数学建模Assignment-2

600*A1+300*A2+500*B1+200*B2<=1000S.t= A1+A2>=1;B1+B2<=1;-A1+B1<=0;-A2+B2<=0;A1,A2,B1,B2=0 or 1;TASK 4: 图可达性,如输入两个顶点,判断图中一个顶点到另一个顶点是否存在至少一条路径?(3 points)要求写出思路和伪代码即可。
思路:输入两个顶点,从第一个顶点开始遍历,如果在遍历过程中出现第二个顶点,则说明这两个顶点至少存在一条路径,否则不存在任何路径。
使用的语言:C++存储结构:邻接表伪代码:邻接表的存储结构:struct lindnode//邻接表中顶点的关系{ int vex;bool sh; // 0表明顶点还没被访问,1表明已被访问,防止重复访问linknode*next; }struct node //邻接表中的所有节点{ char data;linknode*head;node adj[ms];//创建一个数组,保存所有顶点输入图的数据函数的创建void createlink(){输入n; //n总顶点数量for(1 to n){adj[i].head=0;输入adj[i].data; //adj[i].data是图中顶点的名称输入m; //m是与当前输入点直接相连的点的数量}输入p->vex; //输入与此顶点直接相连的其他顶点}遍历(采用深度遍历):viod DFS(int v,char tag){p=new linknodep=adj[v].head;adj[v].sh=1;//标志此顶点已经被访问,防止重复访问if(adj[v].data等于tag)//如果遍历到的顶点与目标顶点相等{输出<<"在在至少一条路径";return;//结束这个函数}while(p!=0){ DFS(p->vex)p=p->next; }}main() //函数入口{createlink();cin>>A,B;for(i to n){ if( adj[i]=A)vv=i;break; }DFS(int vv,B)}BONUS(Optional):下载资源里的testcsv.zip文件,实际是代表一个大图的数据,要求用JAVA实现任意输入两个点,能返回是否有路径的结果及运算时间,所实现程序运行时间最短的同学有特殊奖品:)。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Passage 1 (TAP, Translation Journal)
Winners do not dedicate their lives to a concept of what they imagine they should be; rather, they are themselves and as such do not use their energy putting on a performance, maintaining pretence, and manipulating others. They are aware that there is a difference between being loving and acting loving, between being stupid and acting stupid, between being knowledgeable and acting knowledgeable. Winners do not need to hide behind a mask. Winners are not afraid to do their own thinking and to use their own knowledge. They can separate facts from opinions and don’t pretend to have all the answers. They listen to others, evaluate what they say, but come to their own conclusions. Although winners can adore and respect other people, they are not totally defined, demolished, bound, or awed by them.
Winners do not play “helpless”, nor do they play the blaming game. Instead, they assume responsibility for their own lives.
成功者不会穷其毕生之精力,执着于自我之臆想。
相反,他们会保持自己的本色。
正因如此,他们不装腔作势,不自命不凡,不对别人指手画脚。
他们知道,真爱不同于装爱,真傻有异于装傻、博学有别于卖弄。
成功者无需面具来伪装。
成功者无畏于独立思考,无畏于独立判断、独当一面。
他们能够在事实与传闻之间明辨是非,不会假称自己无所不晓。
他们倾听别人意见,择善从之,最终得出自己的结论。
成功者敬仰尊重别人,但他不会受制于人、不会被他们所摧垮、不被他们所束缚、不会被他们所吓倒。
成功者不故意“示弱”,也从不怨天尤人。
他们会毅然肩负起人生的责任。
Passage 2
The first snow came. How beautiful it was, falling so silently all day long, all night long, on the mountains, on the meadows, on the roofs of the living, on the graves of the dead! All white save the river, that marked its course by a winding black line across the landscape; and the leafless trees, that against the leaden sky now revealed more fully the wonderful beauty and intricacies of their branches. What silence, too, came with the snow, and what seclusion! Every sound was muffled; every noise changed to something soft and musical. No more tramping hoofs, no more rattling wheels! Only the chiming of sleighbells, beating as swift and merrily as the hearts of children.
Henry Wadsworth Longfellow The First Snow
初雪飘临,多么美啊!它整日整夜地飘落着,落在山岭上,落在草地上,落在生者的屋顶上,落在逝者的墓地上!在一片洁白之中,只有河流在美丽的画面上划出一道弯弯曲曲的黑线;还有那叶儿落净的树木,映衬着铅灰色的天空,此刻更显得枝丫交错,姿态万千。
初雪飘落时,是何等的宁谧,何等的幽静!一切声响都趋沉寂,一切噪音都化作柔和的音乐。
再也听不见马蹄得得,再也听不见车轮粼粼!惟有雪橇的叮咚的铃铛,奏出和谐的乐声,那明快欢乐的节拍犹如孩子们心房的搏动。