国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代做ECM2418、代寫 java,Python 程序設計

時間:2023-12-10  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



ECM2418 Computer Languages and Representations Continuous Assessment
Functional and Logic Programming
Dr David Wakeling
Handed out Handed in
Thursday 26th October 2023 (T1:05) Thursday 14th December 2023 (T1:12)
This Continuous Assessment is worth 40% of the module mark.
Question 1: Light Show
Every week, The Sunday Times newspaper publishes a Teaser. Teaser 3172, of Sunday 9th July 2023, was as follows.
My bedside clock displays the time and date using eight digits; for example, at 9.43am on 28th June, the display would be
Each digit in the electronic display lights up some (or all) of seven light seg- ments, the above display lighting up a total of 45 segments.
On one occasion recently, the displayed digits were all different and the total number of lit segments was prime. The same was true exactly one day later. Then, just one minute after the second occasion, the number of lit segments was the average of the numbers of lit segments on those two previous occasions.
What was that third display?
    1

Question 1.1
Show a Haskell function generator1 that returns a list of tuples (HR,MN,DY,MT) that may be solutions to the Teaser. That is, for which, HR, MN, DY and MT are valid hours, minutes, days (assume a non-leap year) and months.
This function will be assessed by the number of tests that it passes, as counted by the function x_generator1 below. The expected answer is 10.
 x_generator1 :: Int x_generator1 =
length [t | t <- ts, t ‘elem‘ g] where
 g = ts =
generator1
[ ( 2,15,14,11)
, ( 4,31,27, 9)
, ( 6,**,10, 8)
 , ( 9, 3,23, 6) , (11,19, 6, 5) , (13,35,19, 3) , (15,51, 2, 2) , (18, 6,16,12)
 , (20 ,22 ,29 ,10) , (22,38,11, 9) ]
Question 1.2
Show a Haskell function tester1 that returns true for tuples (HR,MN,DY,MT) that are solutions to the Teaser. That is, for which the tuple is “magic”, a second tuple exactly one day later is also “magic”, and just one minute on from this second tuple the number of lit segments on the display is the average of the number of lit segments of these two tuples. A tuple (HR,MN,DY,MT) is “magic” if the displayed digits of HR, MN, DY and MT are all be different, and the total number of lit segments in the display is prime.
This function will be assessed by the number of tests that it passes, as counted by the func- tion x_tester1 below. Note that these test cases were NOT produced by generator1. The expected answer is 10.
 x_tester1 :: Int x_tester1 =
length [t | t <- ts, tester1 t] where
 ts =
[ ( 6,59,17,24)
2

 , ( 6,59,17,34)
 , ( 6,59,27,14) , ( 6,59,27,41) , ( 8,59,12,46) , (16,59, 7,24) , (16,59, 7,42)
 , (16,59, 7,43) , (16 ,59 ,27 ,40) , (18,59, 2,46) ]
Question 1.3
On blue18.ex.ac.uk, my program
computes [(16,59,27,4)], from which one can deduce the answer to Teaser 3172 is
in 0.004 seconds. Tune your program so that on the same machine, it computes this answer within 1.000 seconds.
(5 marks)
Question 2: Digital Trio
Teaser 3158, of Sunday 5th May 2023, was as follows.
“I have a couple of subtraction problems for you”, George told Martha. Look: N**N2=N3andN3-N4=N5. CanyousolvethemifItellyouthatN1, N3 and N5 are all three-digit whole numbers whose sum is less than 2000, the same three non-zero digits appearing in all three numbers but no digit being repeated within any of those numbers? N2 and N4 are both two-digit whole numbers using two of the three digits mentioned above, and the first digit of N1 is not equal to the first digit of N2.
What is N1?
 main :: IO () main =
 print (filter tester1 generator1)
 3

Question 2.1
Show a Haskell function generator2 that returns a list of tuples (N1,N2,N3,N4,N5) that may be solutions to the Teaser. That is, for which, N1, N3 and N5 are three-digit numbers, and N2 and N4 are two-digit numbers. The same three digits appear in N1, N3 and N5, two of these digits appear in N2, and two of them appear in N4. In each number, no digit is zero and none is repeated. The first digit of N1 is not equal to the first digit on N2.
This function will be assessed by the number of tests that it passes, as counted by the function x_generator2 below. The expected answer is 10.
 x_generator2 :: Int x_generator2 =
 length [t | t <- ts, t ‘elem‘ g] where
g = generator2
ts =
[ ("123","21","123","12","123")
 , ("**","26","261","12","621") , ("219","19","912","21","291") , ("**9","92","9**","**","239") , ("439","94","394","43","394") , ("549","95","945","95","945")
 , ("568","68","586","56","586")
, ("769","67","679","97","796")
, ("879","79","897","98","789")
, ("987","79","789","79","789") ]
(10 marks)
Question 2.2
Show a Haskell function tester2 that returns true for tuples (N1 , N2 , N3 , N4 , N5 ) that are solutions to the Teaser. That is, for which N1 − N2 = N3, N3 − N4 = N5 and N1 + N3 + N5 < 2000.
This function will be assessed by the number of tests that it passes, as counted by the function x_tester2 below. The expected answer is 10.
 x_tester2 :: Int x_tester2 =
length [t | t <- ts, tester2 t] where
 ts =
[ ("138","01","137","50","87")
4

 , ("143","01","142","52","**")
 , ("171","02","169","79","**") , ("152","03","149","54","95") , ("159","04","155","61","94") , ("161","05","156","63","93") , ("182","06","176","80","96")
 , ("151","07","144","57","87") , ("165","08","157","64","93") , ("174","09","165","71","94") ]
(10 marks)
Question 2.3
On blue18.ex.ac.uk, my program
computes [("594","45","549","54","495")] in 0.003 seconds. Tune your program so that on the same machine, it computes this answer within 1.000 seconds.
(5 marks)
Question 3: Easier to Ask the Audience
Teaser 3145, of Sunday 1st January 2023, was as follows.
“I have forgotten the phone number!” complained Martha, about to phone a friend. “So have I!” replied George, “but I have some vague memories of it. It is a perfect square with all the digits different, and the last digit is equal to the number of digits to be dialled. The last-but-one digit is odd and one of the digits is zero. Also the second and third and last-but-one digits are all exact multiples of the first digit. Maybe you can work it out.”
Martha proceeded to dial the number correctly.
What number did she dial?
 main :: IO () main =
 print (filter tester2 generator2)
5

Question 3.1
Show a Prolog predicate generator3 that yields successive numbers N between 1,000 to 1,000,000 (inclusive) that may be solutions to the Teaser. That is, integers N that are perfect squares.
This predicate will be assessed by the number of tests that it passes, as counted by the predicate x_generator3 below. The expected answer is 10.
 x_generator3( N ) :- x_generator3_loop(
[ 1024 , 9409 , 23716 , 51529 , 123**4 , 185761 , 868624 , 962361
 , 982081, 1000000 ], 0, N ).
x_generator3_loop( [], C, C ). x_generator3_loop( [T|TS], C, N ) :-
generator3( T ),
 C1 is C + 1,
x_generator3_loop( TS, C1, N ). x_generator3_loop( [_|TS], C, N ) :-
x_generator3_loop( TS, C, N ).
(10 marks)
Question 3.2
Show a Prolog predicate tester3 that is true for phone numbers N that are solutions to the Teaser. That is, for integers N where all of the digits are different, the last digit is equal to the number of digits, the last-but-one digit is odd and one of the digits is zero. In addition, the second and third and last-but-one digits are all exact multiples of the first digit.
This predicate will be assessed by the number of tests that it passes, as counted by a predicate x_tester3 below. The expected answer is 10.
 x_tester3( N ) :- x_tester3_loop(
[ 123056 , 128036 , 13**76 , 142076 , 148056 , 15**76 , 1**096 , 18**36
 , 193056, 198076 ], 0, N ).
x_tester3_loop( [], C, C ). x_tester3_loop( [T|TS], C, N ) :-
tester3( T ),
 C1 is C + 1,
x_tester3_loop( TS, C1, N ).
6

 x_tester3_loop( [_|TS], C, N ) :-
 x_tester3_loop( TS, C, N ).
(10 marks)
Question 3.3
On Swish Prolog, my program
computes 1**056 in 0.40 seconds. Tune your program so that on the same system, it computes this answer within 2.00 seconds.
(5 marks)
Question 4: Cube Route
Teaser 3149, of Sunday 29th January 2023, was as follows.
I have a set of ten cards, each of which has a different digit written on it. All the cards have been used to make a set of prime numbers. After discarding the smallest prime, and without changing the order of any cards, I have placed the remaining primes in order of decreasing size to give a large number. It is possible, without changing the order of any cards, to break this number into a set composed entirely of cubes. Neither set contains a number with more than four digits.
List, in order of decreasing size, my set of prime numbers.
Question 4.1
Show a Prolog predicate generator4 that yields arrangements of the digits 0 to 9 divided into runs of one, two, three or four digits that form prime numbers. Importantly (and somewhat surprisingly) leading zero digits do not count, so “251” is considered to be prime, but “0251” is not.
This predicate will be assessed by the number of tests that it passes, as counted by a predicate x_generator4 below. The expected answer is 10.
 main :-
generator3( N ), tester3( N ), write( N ).
7

 x_generator4( N ) :-
 x_generator4_loop(
[ [[9 ,6 ,7] ,[4 ,0 ,1] ,[2 ,8 ,3] ,[5]]
, [[9 ,8 ,3] ,[6 ,0 ,1] ,[5] ,[4 ,7] ,[2]]
, [[9 ,8 ,3] ,[6 ,7] ,[4 ,2 ,0 ,1] ,[5]]
, [[9 ,8 ,5 ,1] ,[2] ,[4 ,3] ,[6 ,0 ,7]]
 , [[9 ,8 ,5 ,1] ,[2] ,[3] ,[6 ,0 ,4 ,7]]
, [[9 ,8 ,5 ,1] ,[2] ,[7] ,[4 ,6 ,0 ,3]]
, [[8 ,9] ,[7] ,[6 ,0 ,1] ,[2 ,5 ,4 ,3]]
, [[8 ,9] ,[7] ,[5 ,6 ,3] ,[4 ,0 ,2 ,1]]
, [[8 ,9] ,[5] ,[4 ,7] ,[6 ,0 ,1] ,[3] ,[2]]
 , [[3],[5],[6,0,7],[2],[4,1],[8,9]] ], 0, N ).
x_generator4_loop( [], C, C ). x_generator4_loop( [T|TS], C, N ) :-
generator4( T ),
 C1 is C + 1,
x_generator4_loop( TS, C1, N ). x_generator4_loop( [_|TS], C, N ) :-
x_generator4_loop( TS, C, N ).
(10 marks)
Question 4.2
Show a Prolog predicate tester4 that is true for lists of lists of digits that form prime numbers and may be solutions to the Teaser. That is, for collections of prime numbers that after discarding the smallest prime, may be arranged in order of decreasing size to give a large number that may be divided into runs of one, two three or four digits that form cubes.
This predicate will be assessed by the number of tests that it passes, as counted by the predicate x_tester4 below. The expected answer is 10.
 x_tester4( N ) :- x_tester4_loop(
[ [[8 ,2 ,7] ,[6 ,1] ,[5 ,3] ,[4 ,0 ,9]] , [[8 ,2 ,7] ,[6 ,1] ,[4 ,0 ,9] ,[5 ,3]]
 , [[8 ,2 ,7] ,[5 ,3] ,[6 ,1] ,[4 ,0 ,9]]
, [[8 ,2 ,7] ,[4 ,0 ,9] ,[6 ,1] ,[5 ,3]]
, [[6 ,1] ,[8 ,2 ,7] ,[4 ,0 ,9] ,[5 ,3]]
, [[6 ,1] ,[4 ,0 ,9] ,[5 ,3] ,[8 ,2 ,7]]
, [[5 ,3] ,[6 ,1] ,[4 ,0 ,9] ,[8 ,2 ,7]]
 , [[5 ,3] ,[4 ,0 ,9] ,[6 ,1] ,[8 ,2 ,7]]
, [[4 ,0 ,9] ,[5 ,3] ,[8 ,2 ,7] ,[6 ,1]]
, [[4,0,9],[8,2,7],[6,1],[5,3]] ], 0, N ).
8

  x_tester4_loop( [], C, C ). x_tester4_loop( [T|TS], C, N ) :-
tester4( T ),
C1 is C + 1,
x_tester4_loop( TS, C1, N ).
 x_tester4_loop( [_|TS], C, N ) :- x_tester4_loop( TS, C, N ).
(10 marks)
Question 4.3
On Swish Prolog, my program
computes a first result in in 33.0 seconds, from which one can deduce the answer to the Teaser is 827, 409, 61, 53. Tune your program so that on the same system, it computes this answer within 120.0 seconds.
(5 marks)
Submission
You should submit a single “.zip” file to the ELE system. Other compression formats, such as “.rar”, “.7z”, “.gz” and “.bz2” are unacceptable, and will receive a mark of zero. The “.zip” file should contain four completed text files “Light.hs” (containing the answer to Question 1), “Trio.hs” (containing the answer to Question 2), “Audience.pl” (con- taining the answer to Question 3) and “Cube.pl” (containing the answer to Question 4).
If there is any question as to whether your functional programs compute the correct result, these questions will be answered on the implementation at
   https://www.tutorialspoint.com/compile_haskell_online.php
If there is any question as to whether your logic programs compute the correct result, these questions will be answered on the implementation at
   https://swish.swi-prolog
 main :-
generator4( XS ), tester4( XS ), write( XS ).
9

All students are reminded of the University regulations on academic honesty and plagiarism.
In particular, functions an predicates clearly intended ONLY to pass the given tests will be treated as malpractice (“an attempt to deceive the examiners”).
請加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機打開當前頁
  • 上一篇:CSC8204 代寫、Secure Software程序
  • 下一篇:INT305 代做、代寫 Python 語言編程
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網頁版入口 破天一劍 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    久久久久久久久久码影片| 精品国偷自产在线视频99| 秋霞无码一区二区| 一区二区三区四区欧美| 欧美成人亚洲成人日韩成人| 另类色图亚洲色图| 一区二区三区四区免费视频| 久久资源免费视频| 一区二区三区精品国产| 亚洲综合av影视| 午夜精品在线视频| 色999五月色| 日本不卡一区| 欧美性大战久久久久| 欧美日韩精品综合| 精品日本一区二区三区在线观看| 欧美黄色免费影院| 国产视频精品网| 国产美女精品视频免费观看| www国产黄色| 久久人人九九| 久久久www成人免费精品| 国产精品久久精品视| 久久久久国产精品免费网站| 亚洲区成人777777精品| 天天夜碰日日摸日日澡性色av| 日韩av大全| 黄色免费视频大全| 97久久精品在线| 久久久久久久久久久av| 国产精品入口免费视频一| 精品视频9999| 欧美一区二区三区综合| 日韩激情视频一区二区| 欧美成人第一区| 精品少妇人妻av免费久久洗澡| 99视频免费观看蜜桃视频| 国产精欧美一区二区三区| 精品久久国产精品| 一区二区三区三区在线| 日韩和欧美的一区二区| 国产亚洲黄色片| 久久免费福利视频| 国产精品高潮呻吟久久av野狼| 亚洲一区美女视频在线观看免费| 日本一区二区三区视频在线观看 | 国产精品久久久久久亚洲影视| 九九久久综合网站| 亚洲在线欧美| 欧美日韩另类综合| 国产精品99久久久久久大便| 国产精品免费看一区二区三区 | 亚洲综合中文字幕在线| 激情伊人五月天| 国产精品99久久99久久久二8| 国产精品免费一区二区三区观看| 亚洲91精品在线观看| 狠狠爱一区二区三区| 久久久久久www| 欧美激情免费在线| 欧洲国产精品| 69av视频在线播放| 欧美激情第6页| 激情视频综合网| 国产不卡精品视男人的天堂| 一区二区三区四区视频在线观看| 欧美精品自拍视频| 久久香蕉视频网站| 亚洲中文字幕无码一区二区三区| 激情网站五月天| xxav国产精品美女主播| 少妇人妻互换不带套| 国产青春久久久国产毛片| 国产成人精品一区二区三区福利| 色一情一乱一乱一区91| www.com毛片| 欧美激情a∨在线视频播放| 精品欧美一区二区三区久久久| 久久国产欧美精品| 视频一区免费观看| 99久久激情视频| 中文字幕一区二区三区四区五区| 国产私拍一区| 久久成人人人人精品欧| 红桃av在线播放| 色妞在线综合亚洲欧美| 日韩国产精品毛片| 91蜜桃网站免费观看| 亚洲午夜精品一区二区| 国产精品一区二区三区在线观| 国产精品久久久久久搜索| 欧美中文字幕在线观看| 久久福利电影| 日韩精品成人一区二区在线观看| 91九色单男在线观看| 五月天在线免费视频| 91精品国产综合久久香蕉最新版| 亚洲一区二区不卡视频| 阿v天堂2017| 亚洲欧美久久234| 91精品久久久久久久久| 无码播放一区二区三区| 国产精品av在线播放| 国产精品久久久久福利| 毛片一区二区三区四区| 欧美成年人视频| 国产欧美日韩精品在线观看| 欧美激情在线观看视频| 99色这里只有精品| 肉大捧一出免费观看网站在线播放| 久久免费国产视频| 欧美性猛交久久久乱大交小说| 国产精品女视频| 国产片侵犯亲女视频播放| 亚洲精品一区二区毛豆| 久久久久久久久久久免费| 精品欧美一区二区三区久久久 | 97国产精品人人爽人人做| 亚洲乱码一区二区三区 | 亚洲一区二区免费在线| 久久精品国产精品青草色艺| 欧美做暖暖视频| 精品免费日产一区一区三区免费| 不卡中文字幕在线| 热re99久久精品国产66热| 国产精品久久久久久久久久三级| 国产日韩在线播放| 性色av一区二区三区在线观看| xxx一区二区| 国产精品永久免费在线| 日本精品久久电影| 久久国产天堂福利天堂| 久久国产手机看片| 福利视频一区二区三区四区| 日韩av片免费在线观看| 欧美成年人在线观看| 91精品国产91久久久久久不卡| 欧美亚洲另类视频| 亚洲伊人第一页| 久久久精品2019中文字幕神马| 国产伦精品一区二区三区视频黑人 | 欧美主播一区二区三区美女 久久精品人 | 91国产精品电影| 国产在线xxxx| 日本一区二区在线视频| 欧美日韩xxxxx| 色av中文字幕一区| 99久久免费观看| 国产综合久久久久久| 春日野结衣av| 欧美日韩成人在线播放| www.午夜精品| 7777在线视频| 国产欧美日韩伦理| 欧美精品自拍视频| 日韩av电影在线免费播放| 一区二区视频在线观看| 国产精品动漫网站| 国产成人午夜视频网址| 91国内在线视频| 国产精品自拍偷拍视频| 免费在线观看日韩视频| 日韩av免费网站| 亚洲一区二区在线免费观看| 国产精品免费区二区三区观看| 久久久久免费看黄a片app| 91精品免费| 不卡中文字幕在线| 国产精品午夜国产小视频| 麻豆精品视频| 激情视频综合网| 欧美视频免费看欧美视频| 日韩高清av| 视频在线99| 天天干天天色天天爽| 亚洲欧美日韩在线综合| 亚洲一区二区中文| 九九热精品在线| 精品国产乱码一区二区三区四区| 国产精品网红福利| www.日韩欧美| 久久精品国产亚洲一区二区| 久久久久久中文| 久久久久久亚洲精品中文字幕| 国产高清一区二区三区| 国产成人在线精品| 久久99精品久久久久久久久久| 国产成人在线亚洲欧美| 久久久久久久有限公司| 日韩有码在线播放| 日韩视频在线一区| 国产成人精品自拍| 国产精品日韩精品| 国产精品久久久久久久一区探花| 久久精品国产亚洲精品2020| 精品国偷自产在线| 国产精品福利小视频| 欧美激情伊人电影| 午夜老司机精品| 日韩欧美视频一区二区三区四区|