Assignment 1
研究生英语翻译 Assignment 1

Moreover, much of the new wealth turned out to be pure illusion, paper wealth that could vanish as magically as it had appeared.
而且,很多新财富现在看来纯粹是一场镜 花水月.纸面财富来得快,去得也快.
The fantasy that everyone can become rich in the information economy has soured in today’s reality, and many now wonder whether they will keep their job or be able to meet their rent and pay off their credit cards. 网络经济时代人人都可暴富的神话,被今 天的现实击得粉碎.现在许多人都不知道 能否保得住工作,能否付得起房租,能否付 得清信用卡的透支款.
Assignment 1
But the collapse of the dot-com economy and thd the prospects of a serious economic slowdown at this writing in 2001, have put the fabled new economy in a different light. 但是,2000年网络经济崩溃,高新技术板块 的纳斯达克指数大跌, 2001年本文写作时 经济面临严重衰退.这一切都使得虚幻的 新经济成为明日黄花.
We are learning that the boom never really did reach millions of Americans, since the bulk of the new wealth created in the 1990s was pocketed mainly by the very rich. 我们开始明白,千百万美国人根本没有从 这次经济繁荣中受益,因为20世纪90年代 所创造的大量新财富主要都被富人纳入 囊中.
Assignment 1

数据结构与算法分析(2017年秋季学期),Assignment #1截止日期:2017年9月21日星期四姓名:________________ 学号:___________________ 班级:_______________在答题之前,请仔细阅读以下注意事项:(1)请独立完成作业。
(2)本作业包含五个大题,请用英语简单明确作答。
(3)请于截止日期前将作业纸质版本交给本班学习委员,学习委员在9月21日星期四上课开始前将作业集中交给我。
(4)请务必按时提交作业,从9月21日10点40分开始计时,迟交24小时内作业总分扣30%,迟交24小时之后,该次作业计0分。
1.Define an ADT for a set of integers (remember that a set may not contain duplicates). Your ADTshould contain the following seven operations:a)Insert: insert an integer into a set;b)Delete: remove an integer from a set;c)Size: return the size of a set currently;d)Empty: return if a set is empty;e)Union: return the union of two sets;f)Intersection: return the intersection of two sets;g)SetDifference: return the difference of two sets.Each operation should be clearly defined in terms of its input and output.2.State whether each of the following relations is a partial ordering, and explain why or why not.a)“isFatherOf” on the set of people.b)“isOlderThan” on the set of people.c)“noLessThan” on the set of integers.d){(a,b),(a,a),(b,a)} on the set of {a,b}.e){(2,1),(1,3),(2,3)} on the set of {1,2,3}.3.Answer the following two questions.a)Prove that x log a y = y log a x for any a > 0, x > 0, and y > 0.b)Derive the closed form of the recurrence relation: f(n) = 2 f(n/2) + 2n, with f(1) = 1.To simplify the problem, you may assume that n is a power of 2. That is, the relation holds for n = 2t for some non-negative integer t.4.For each pair of the following functions, determine whether f(n) is in O(g(n)), f(n)is in Ω(g(n)),or f(n) = Θ(g(n)).a)f(n) = log(n2); g(n) = log n + 7b)f(n) = log(n2); g(n) = √nc)f(n) = log n; g(n) = n log n + nd)f(n) = n; g(n) = (log n)25.Let P be an array storing integers.a)Write in pseudocode an algorithm to find a sub-array of P with the largest sum. That is, youralgorithm takes as input an array P, its size n, and returns two array indexes i and j with i≤j, such that the sum: P[i]+P[i+1]+...+P[j−1]+P[j] is as large as possible.For example, if P={−1,5,−3,7,−2}, your algorithm should return 1 and 3.b)Analyze the time complexity of your algorithm in the worst case.。
Assignment 1.doc``

Assignment 1:Please translate the following ten sentences. You can put your translation right below the sentence.1.You are welcome to send for our free catalogue.欢迎您索函我们的免费目录2.The set of equipment is quite late arrivals for doctors to use.这一系列供医生使用的装备来得是相当的晚。
3.I questioned the wisdom of her going there with Tim.我怀疑她和蒂姆一起来这是否是明智的。
4.She is being polite.她故意装出一副有礼貌的样子。
5.He had a sound feeling that idioms were the backbone of language andhe was all for the racy phrases.他认为谚语是语言中的支柱,并主张使用这些生动的语言,他的看法是有道理的。
6.The black people were fighting against the segregation of thegovernment.黑人曾经和政府的种族隔离相对抗。
7.I had the muscle, and they made money out of it.我有力量,并且他们应该利用我的力量赚钱。
8.I drank some ice tea, but it made me more thirsty.我刚才喝了冰茶,但是它让我觉得更口渴了。
9.He is a wicked tennis player.他是一个没有道德素养的网球运动员。
10.M y work, my family, my friends were more than enough to fill mytime.干工作,做家务,与朋友相处这些已经足够占据了我的大部分时间。
assignment-1

assignment-1 Find a database system in you lifeDiscover a database system in your life, submit a report which discusses the application background , the functions it provides and what data/information need to be stored in such a system with the functions you proposed above生活中的数据库近年来,随着计算机网络技术的飞速发展,数据库在我们生活中的应用越来越广泛,例如学校的学生管理系统、图书馆的图书管理系统、各大网站的后台数据库、各个企业的财务管理系统等等。
这些系统和网站都依靠着数据库的支持,才能正常运行。
最近阿里巴巴的上市引起了许多人的关注,而阿里巴巴集团旗下的淘宝网也已经成为了人们日常生活中必不可少的东西。
而淘宝网能够正常运行,少不了数据库的支持。
我们要想在淘宝网上买东西,首先必须要有一个淘宝账户,所以,我们需要进行注册,输入自己的用户名、密码等相应资料,而我们的账户信息就存储在淘宝网的后台数据库中,因为有了数据库的支持,我们可以看到自己的交易记录、收藏的商品、物流的信息等等。
商家需要将自己的商品信息进行存储,商品的价格、库存、颜色、尺寸等等信息都会存储到数据库里,因为数据库,我们才能浏览到商品,获知商品的各种信息。
还有商家的信息,如网店的创建时间、网店的评分、客服人员等等也会存储到数据库里。
如果我们选择网上付款,那各大银行的网银系统也需要有自己的数据库来存储客户的信息。
我简单的将数据库中存储的数据罗列下来:12345。
assignment 1_译析

第一讲练习试将下列句子译成汉语:1.The many colors of a rainbow range from red on the outside to violet on the inside.彩虹有多种颜色,外圈红,内圈紫。
2. He had a disconcerting habit of expressing contradictory ideas in rapid succession.他有一种令人难堪的习惯:一会儿一个看法,自相矛盾,变化无常。
3.This was an intelligently organized and fervent meeting in a packed Town Hall, with Mr. Strong in the chair.这是一次精心组织起来的会议。
市政厅里济济一堂,热情洋溢,主持会议的是斯特朗先生。
4.Power can be transmitted over a great distance withpractically negligible loss if it is carried by an electric current.电流可以把动力传送到很远的地方,其消耗几乎可以忽略不计。
5.The present onslaught of vehicles poses a serious threat to urban life and pedestrian peace of mind.当前,车辆横冲直闯,严重地威胁着城市生活,路上行人无不提心吊胆。
6.Change of information, if any, concerning the contents of this section will be found in the appendix at the end of this book.本节内容如有更改,均见本书末附录。
7.She said, with perfect truth, that “it must be delightful to have a brother,”and easily got the pity of tender-hearted Amelia, for being alone in the world, an orphan without friends or kindred.她说道,“有个哥哥该多好啊,”这话说得入情入理。
北航计算机研究生课程_算法设计与分析__Assignment_1

一、解:设第k月的需求量为Nk(k=1,2,3,4)状态变量Xk:第k月初的库存量,X1=X5=0,0≤Xk≤Nk+…+N4决策变量Uk:第k月的生产量,max{0,Nk-Xk}≤Uk≤min{6,Nk+…+N4 - Xk}状态转移方程:X k+1 = Uk + Xk – Nk第k月的成本Vk = 0.5*(Xk - Nk) Uk=03 + Uk + 0.5*(Uk + Xk - Nk) Uk≠0设F k(Xk)是由第k月初的库存量Xk开始到第4月份结束这段时间的最优成本则F k(Xk) = min{Vk + F k+1(X k+1)} 1≤k≤4= min{ 3 + Uk + 0.5*(Uk + Xk - Nk) + F k+1(Uk + Xk - Nk) } Uk≠0min{ 0.5*(Xk - Nk) + F k+1(Xk - Nk) } Uk=0 F5(X5)=0四个月内的最优成本为F1(X1)=F1(0)详细计算步骤如下:(1)k=4时4(2)k=3时(3)k=2时(4)k=1时由以上计算可得,4个月的总最优成本为F1(0) = 20.5(千元)二、解:1、变量设定阶段k:已遍历过k个结点,k=1,2…6,7。
K=1表示刚从V1出发,k=7表示已回到起点V1状态变量Xk=(i,Sk):已遍历k个结点,当前位于i结点,还未遍历的结点集合为Sk。
则X1=(1,{2,3,4,5,6}),X6=(i,Φ),X7=(1,Φ)决策变量Uk=(i,j):已遍历k个结点,当前位于i结点,下一个结点选择j。
状态转移方程:X k+1 = T(Xk,Uk) = (j,Sk-{j})第k阶段的指标函数Vk = D[i,j]。
最优指标函数Fk(Xk) = Fk(i,Sk):已遍历k个结点,当前从i结点出发,访问Sk中的结点一次且仅一次,最后返回起点V1的最短距离。
则Fk(i,Sk) = min{ D[i,j] + F k+1(j,Sk-{j}) } 1≤k≤6F7(X7) = F7(1,Φ) = 02、分析:(1)k=6时,F6(i,Φ) = min{D[i,1] + F7(X7)} = D[i,1] i=2,3,4,5,63、伪代码和时间复杂度为方便计算,结点编号改为0到5.(1)用一张二维表格F[][]表示F(i,Sk),行数是n,列数是2n-1。
Assignment1
(1)
i=1
Consider the following small data set:
xy 13 -1 -2 24
• Solve for the value of θ1 that minimizes the cost function by substituting the values from the training set into the cost function, setting the derivative equal to zero, and solving for θ1. Show your work.
3
some θ0, θ1 such that J(θ0, θ1) = 0. Which of the statements below must then be true? (Check all that apply.)
A: This is not possible: By the definition of J(θ0, θ1), it is not possible for there to exist θ0 and θ1 so that J(θu,
v
)
2.
∂ ∂v
f
(u,
v)
3.
∂ ∂u
h(u,
v)
4.
∂ ∂v
h(u,
v
)
Partial Derivative Intuition Consider the contour plot of a function f (u, v) in Figure 1. For each of the following partial derivatives, state whether it is positive, negative, or equal to zero. Briefly explain. These questions can be answered from the contour plot without knowing the formula for the function.
Assignmen1(广告文本的翻译)
Assignment: (做成PPT周三下午5点前发到老师邮箱,4人一组)1.上海无线电二厂上海无线电二厂是全国著名企业之一,专门生产收音机、收录机、通讯机、无线扩音机和音响设备。
冠以“红灯”、“飞乐”著名商标,享誉国内海外。
该产品款式新颖、音质优美、质量可靠、功能齐备。
它将赢得您的喜爱,并给您的家庭带来欢乐。
地址:中国上海市宜昌路九十六号电话:583500Shanghai No.2 Radio FactoryAs with you know, our Shanghai No.2 Radio Factory is one of the most famous enterprises in China. We specialized in the productions of radio sets, radio recorders, communication equipments, radio amplifiers and some other audio systems. Equipped with a complete range of functions and attractions of novel design, these famous brands of audio systems named “Red Lantern “and “Feile”, will certainly bring you the stunning sound. Moreover, the brands now are popular both home and abroad. And I’m sure that it will be the best choice for you and your family to have happiness.Address: No.96, Yi Chang Rode, Shanghai, ChinaTel: 5835002.西苑饭店西苑饭店是一座具有国际四星级水准的大型涉外饭店,位于北京三里河路,与进出口谈判大楼、北京图书馆、首都体育馆等相毗邻,环境优美,交通便利。
assignment 1
I. Translate the following sentences. Before translating, please rewrite them into modern Chinese.(TAP)For example:子曰:“巧言令色,鲜矣仁!”现代汉语:孔子说:“花言巧语,伪善的面貌,这种人,‘仁德’是不会多的。
”译文:The Master said, “It is rare, indeed, for a man with cunning words and an ingratiating countenance to be benevolent.”ingratiating:奉承的,讨好的countenance:面容,表情benevolent:仁慈,善行1.子曰:“温故而知新,可以为师矣。
”2.子曰:“君子不器。
”3.子贡问君子。
子曰:“先行其言则后从之。
”4.子曰:“君子周而不比,小人比而不周。
”5.子曰:“学而不思则罔,思而不学则殆。
”II. Translate the following passage into Chinese.When the boy came back the old man was asleep in the chair and the sun was down. The boy took the old army blanket off the bed and spread it over the back of the chair and over the old man’s shoulders. They were strange shoulders, still powerful although very old, and the neck was still strong too and the creases did not show so much when the old man was asleep and his head fallen forward. His shirt had been patched so many times that it was like the sail and the patches were faded to many different shades by the sun. The old man’s head was very old though and with his eyes closed there was no life in his face. The newspaper lay across his knees and the weight of his arm held it there in the evening breeze. He was barefooted.。
assignment1
CSC415/CI6226 2011 P rogramming A ssignment 1 (100 p oints) Objectives: I n t his a ssignment, y ou w ill•Build a s pelling c orrection e ngine•Build a t ext s earch e ngine w ith L ucene, a nd•Integrate y our s pelling c orrector i nto t he t ext s earch e ngineDue: M arch 10, 2011 (Thursday) 11:59pm. L ate s ubmissions a re a llowed b ut w ill b e p enalized a t a r ate of 10% p er d ay.Teams: Y ou a re a llowed (but n ot r equired) t o w ork i n p airs f or t his a ssignment. T eams o f t wo s hould only s ubmit o ne c opy o f t heir w ork. Y ou m ay (and a re e ncouraged t o) d iscuss w ith o ther t eams, b ut should N OT t ake a ny d etailed n otes f rom t he d iscussions t hat w ill a ppear v erbatim i n y our s ource c odes and r eports.Implementation: W e s trongly r ecommend t hat y ou w rite y our p rogram i n J ava, t hough y ou m ay u se other p rogramming l anguages (e.g. C, C++, P ython) w ithout o fficial s upport (e.g. L ucene). Delivery: Y ou s hould s ubmit t he f ollowings v ia e mail t o j ungjae.kim@.sg:•A z ip f ile t hat c ontains t he c odes y ou w rote (Do N OT i nclude d ata f iles a nd c ompiled l ibraries) •A t ext f ile w ith p rogram o utput•A d ocument i n r eadable E nglish s entences w ith f igures o r t ables a s n eeded. T he d ocument should N OT h ave m ore t han 4 p ages (excluding f igures a nd t ables). I t s hould c ontain o The n ames o f t eam m emberso Descriptions o f w hat y ou h ave d one f or e ach p art, r epresentative o utput f rom y our program, a ny n otable d esign d ecisions m ade o r t rade-‐offs c onsidered (withjustifications), a nd a n e rror a nalysis o f w hen y our s ystem f ailso Detailed i nstructions o n h ow t o c ompile a nd r un t he c odes f or e ach p art, i ncluding where t o p lace d ata f iles a nd l ibraries u sed. I f y ou u se a ny o ther r esource f iles e xceptthose p rovided b y u s, p lease p lace t hem i n a W eb s ite (e.g. N TU M ySite) a nd d escribehow t o d ownload t hem s o t hat w e c an d ownload a nd t est t hem. P lease m ake s ure t heinstructions w ork o n o ther m achines e xcept y ours b efore s ubmission. Y ou w ill l osepoints i f y our c odes f ail t o c ompile o r r un o n t he e valuator’s m achine.If y our e mail s ubmission i s r eturned b ack t o y ou a s a s pam d ue t o t he c odes b y t he N TU e mail s ystem, you s hould s ubmit t he p rogram o utput a nd t he d ocument b y e mail b y t he d eadline a forementioned a nd bring a U SB m emory d evice w ith t he c odes t o t he o ffice (N4-‐02c-‐111) d uring o ffice h ours o n M arch 11. Honor c ode: Y ou s hould n ot l ook f or p roblem a nswers e lsewhere. B ut, i f m aterial i s t aken f rom elsewhere, t hen y ou s hould a cknowledge i t. Y ou a re n ot p ermitted t o g et p rogramming h elp f rom people o ther t han y our p artner. I n g eneral, w e w ill e xpect y ou t o a ct o n y our h onor.Part 1: S pelling C orrection (40 p oints)In t his p art y ou w ill b uild a n n-‐gram b ased s pelling c orrector. I n l ecture 3 (tolerant r etrieval), w e s aw that o ne w ay t o o ffer s pelling s uggestions w as t o c ount t he p roportion o f c haracter n-‐grams t hat o verlap between t he q uery w ord a nd k nown w ords f rom a c orpus. D oing s o w ill r equire a n i nverted i ndex t hat maps n-‐grams t o d ictionary w ords a nd a s coring f unction t hat c ounts n-‐gram o verlaps b etween candidate w ords. Y ou a re o n y our o wn f or b uilding t he i nverted i ndex -‐ y ou s hould n ot u se a ny e xisting libraries o r c ode s nippets t o d o t his f or y ou. Y ou s hould i mplement t he J accard s core o f n-‐gram o verlap as d escribed i n c lass a s t he s coring f unction f or c andidate r eplacements.Take a l ook a t t he s .ntu.ir.spell.SpellingCorrector i nterface:package .ntu.ir.spell;import java.util.List;/*** Basic interface for the spelling corrector.** @author dramage (revised by kim)*/public interface SpellingCorrector {/*** Returns a list of top-scoring spelling corrections for a given* (possibly misspelled) word. The list is expected to include* the best corrected spelling. The maximum length of the* returned list will be specified, while the actual length of* the list may be smaller than it.** @param word A single word whose spelling is to be checked.* @param max The maximum number of corrections in the* returned list. Should be greater than 0.* @return A list of top-scoring corrections, with better corrections* ordered first.*/public List<String> corrections(String word, int max);}Your n-‐gram b ased s pelling c orrector w ill i mplement t his i nterface t o r eturn a l ist o f m ost l ikely candidate s pelling c orrections f or a g iven (possibly m isspelled) w ord.Your s pelling c orrector s hould r ead a ll t he w ords f rom a l arge f ile o f E nglish t ext. Y ou m ay u se t he t ext file (‘big.txt’) t hat c omes f rom P eter N orvig's p age o n H ow t o W rite a S pelling C orrector, w hich t akes a n alternative a pproach t o b uilding a s pell c hecker. [From N orvig's s ite: "The f ile i s a c oncatenation o f several p ublic d omain b ooks f rom P roject G utenberg a nd l ists o f m ost f requent w ords f rom W iktionary and t he B ritish N ational C orpus."]You m ust c omplete t he f ollowing s ub-‐problems:1.1. I mplement a n n-‐gram s pelling c orrector (named s .ntu.ir.spell.NGramSpellingCorrector) b asedon t he w ords i n t he f ile b ig.txt. B riefly d escribe y our i mplementation a nd p rovide s ome e xample mis-‐spelled w ords a long w ith t he p ossible c orrections y our a lgorithm p rovides. W hat i s t he o utput of s .ntu.ir.spell.SpellingScorer c lass (see b elow) w hen r un w ith a rguments s hown b elow (a-‐d)?What a re t he s ources o f e rrors?.ntu.ir.spell.NGramSpellingCorrector 1 ‘path t o s pelltest1.txt’.ntu.ir.spell.NGramSpellingCorrector 1 ‘path t o s pelltest2.txt’.ntu.ir.spell.NGramSpellingCorrector 10 ‘path t o s pelltest1.txt’.ntu.ir.spell.NGramSpellingCorrector 10 ‘path t o s pelltest2.txt’1.2. I n c lass, i t i s m entioned t hat a n n-‐gram b ased c orrector c ould b e u sed i n c oncert w ith a n e ditdistance f unction. W rite a n i mplementation o f L evenshtein e dit d istance a nd a n ew i mplementation of S pellingCorrector, c alled N GramWithEditDistanceSpellingCorrector, t hat w raps t he u nderlying spelling c orrector a nd r e-‐scores i ts o utput u sing t he w eighted e dit d istance f unction. I n p articular, use y our n-‐gram s pelling c orrector t o g et s ome n umber o f c losest c andidates i n t he d ictionary, score e ach w ith t he E dit d istance f unction a nd t hen s uggest t he c orrections w ith l owest e ditdistance. P rovide o utput, e xamples, a nd e rror a nalysis a s y ou d id f or s ub-‐problem 1.1, w hilereplacing ‘NGramSpellingCorrector' w ith ‘NGramWithEditDistanceSpellingCorrector' i n t hearguments.1.3. W rite a w eighted e dit d istance f unction a nd u se i t f or a n ew i mplementation o f S pellingCorrector,called N GramWithWeightedEditDistanceSpellingCorrector. Y ou s hould d efine y our o wn w eighting scheme, f or e xample, a llowing d ifferent w eights f or d ifferent k inds o f e dit o perations a nd d ifferent weights f or d ifferent c haracter r eplacements. H ow d id y ou f ind t he w eighting s cheme a nd w hy?What i s t he i mpact o f a ny c hanges o n t he s cheme? P rovide o utput, e xamples, a nd e rror a nalysis a s you d id f or s ub-‐problem 1.1, w hile r eplacing ‘NGramSpellingCorrector' w ith‘NGramWithWeightedEditDistanceSpellingCorrector' i n t he a rguments.Using S pellingScorer a nd A utomatic Q uantitative G radingThe i ncluded c lass s .ntu.ir.spell.SpellingScorer p rovides a w ay t o t est t he r esults o f y our SpellingCorrector i mplementations a cross a c ollection o f s pelling e rrors (see t he N orvig's s ite). T o r un the S pellingScorer, y ou s hould p rovide t he f ollowing t hree a rguments:1.Java c lass o f t he s pelling c orrector t o b e t ested2.The m aximum n umber o f c orrections f or e ach m is-‐spelling t o b e t ested.3.Path t o t he d ata f ile t o b e t ested (e.g. s pelltest1.txt, s pelltest2.txt).(You m ay r evise t he r eleased v ersion o f S pellingScorer f or y our p rogram i f n ecessary. F or e xample, i t does n ot a llow w hite s paces i n t he f ile p ath, a nd y ou c an r evise t o f ix t he p roblem.)For e xample, y ou m ay r un i t a s f ollows:$ j ava -‐cp b in/ s .ntu.ir.spell.SpellingScorer s .ntu.ir.spell.NGramSpellingCorrector 1data/spelltest1.txtThe S pellingScorer c hecks, f or e ach m is-‐spelling i n t he d ata f ile, i f t he l ist o f c orrections r eturned b y t he given S pellingCorrector i ncludes t he e xpected c orrected s pelling. S pellingScorer w ill r eport t he performance o f t he S pellingCorrector b ased o n t he d ata f ile.You m ust i nclude t he o utput o f t his p rogram i n y our s ubmission. W e a lso m ay u se t he S pellingScorer o n a d ifferent s et o f w ords t o e valuate t he q uality o f y our i mplementation.Part 2: L ucene (50 p oints)In t his p art y ou b uild u p a s earch e ngine f or t he c ollection o f 30,000+ T DT3 n ews a rticles (i.e. ‘tdt3.zip’) by u sing L ucene, a t ext s earch e ngine l ibrary w ritten i n J ava. T he c ollection c onsists o f t ext f iles, w here each f ile c ontains a n ews a rticle. A n e xample f ile i s s hown b elow.File: tdt3/19981001/CNN19981001_1600_1059.txt<DOC><DOCNO> CNN19981001.1600.1059 </DOCNO><DOCTYPE> NEWS </DOCTYPE><TXTTYPE> CAPTION </TXTTYPE><TEXT>General Motors is taking another step in its effort to lure customersback after strikes shut down most of its plants this summer. G.M.says it will install a safety and security system on many of its trucksand cars for free. The system is worth about $1,300. G.M. saw itsmarket share shrink from 31% in June to less than 21% in July as thestrike was taking place.</TEXT></DOC>Your t ask i s t o c reate a L ucene i ndex f or t he c ollection, w rite a p rogram t hat t akes i n a q uery f rom t he user (i.e. S ystem.in) a nd r eturns a l ist o f t op 20 d ocuments, a nd i ntegrate s pelling c orrectors w ith t he program. T he i ndex s hould h ave t he f ollowing t hree f ields: d ocno (called I Ds), d ate (inferrable f rom t he sub-‐directory n ames, e.g., 19981001), a nd t ext.2.1 I mplement s ome q ueries i n t he p rogram t o f ind t he I Ds (e.g. C NN19981001.1600.1059) o f t he documents t hat m eet t he f ollowing c onditions:a)Documents t hat c ontain b oth “New Y ork” a nd “San F rancisco”b)Documents w here t he w ords ‘helicopter’ a nd ‘hurricane’ a ppear w ithin 5 w ords o f e ach o therc)Documents w hich c ontain t he n ame “Dan R onan” a nd w as p ublished i n N ovember 19982.2 A ssume t hat w e a re i nterested i n n ews a rticles a bout s tock m arket m ore t han o thers. W rite a program t o a utomatically c ollect t erms r elated t o s tock m arket (e.g. s tock, s hare, f und), f or e xample, from t he W ikipedia p age o n s tock m arket (/wiki/Stock_market). C ount t heir frequencies i n t he T DT3 a rticles a nd a ssign q uery-‐independent w eights b etween 0 a nd 1 t o t he a rticles (cf. S ection 7.1.4 o f t he t extbook). R evise t he p rogram f rom 2.1 t o r erank t he r esults f rom t he L ucene index b y u sing t he q uery-‐independent w eights: F or e xample, c onsidering a q uery q, o ne o f i ts r esultant articles d, a nd t he o riginal s core o f d g iven b y L ucene, s core(q,d), y ou m ay a dd t he q uery-‐independent weight o f d, g(d), t o s core(d) t o o btain t he n ew s core o f d, s core’(q,d), a s f ollows:score’(q,d) = s core(q,d) + g(d)Find e xample q ueries w hose t op 20 d ocuments a re a ffected b y t he r eranking a nd t hose n ot a ffected. Discuss i f t he r eranking h elps u s a chieve t he g oal o f f ocusing o n s tock m arket a nd h ow t o i mprove i t.2.3 W rite a p rogram t hat t akes i n a m isspelled q uery, r uns t he b est s pell c orrector y ou w rote i n p art 1 o n this q uery t o s uggest a lternative s pellings, a nd q ueries t he L ucene i ndex u sing t he s uggested s pellings, printing o ut t he I Ds o f t op 20 d ocuments. S how o utput o f y our s ystem w here t he s pell c orrection d oes well a nd w here i t d oes p oorly. L ucene a lso h as a s pell c hecker. W rite a nother p rogram t hat u ses t he Lucene S pellChecker. C ompare t he r esults w ith t hose o f t he b est s pell c orrector f rom p art 1. W hich i s better a nd w hy? H ow c an y our e ngine b e i mproved?Credit f or a dvanced (10 p oints):Implement s ome o f y our s uggestions f or i mprovement f rom 2.2 a nd 2.3. T he q uality o f y our i dea, implementation, a nd w riteup w ill a ll b e c onsidered.References:•Lucene: h ttp:///java/docs/index.html•Information R etrieval a nd W eb S earch c ourse a t S tanford U niversity (source o f t his a ssignment): /class/cs276/•Topic D etection a nd T racking (TDT) P hase 3 (source o f t he T DT3 c orpus):/TDT3/Resource f iles p rovided a t t he c ourse s ite:•SpellingCorrector.java, S pellingScorer.java: A s m entioned a bove•big.txt: A c ollection o f d ocuments f rom w hich y ou m ay c ollect d ictionary w ords•spelltest1.txt, s pelltest2.txto Test d ata f iles f or s pelling c orrection, w here e ach l ine f ollows t he f ormat “a d ictionary word : a l ist o f i ncorrectly s pelled w ords”•tdt3.zip: A n ews a rticle c ollection。