____  ___    _  _     _   _ _____     _______
 / ___|/ _ \  | || |   | | | |_ _\ \   / / ____|
| |  _| | | | | || |_  | |_| || | \ \ / /|  _|
| |_| | |_| | |__   _| |  _  || |  \ V / | |___
 \____|\___/     |_|   |_| |_|___|  \_/  |_____|

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

[Question] Mathematics × Programming Competition #8 [問題] 數學 × 程式編寫比賽 (第八回)

BY: @kenchung | CREATED: Oct. 13, 2017, 3 p.m. | VOTES: 122 | PAYOUT: $77.34 | [ VOTE ]

Good News!

Thanks to @steemstem , the sponsored prize has been doubled!

Please refer to the "Prizes" section for details.

好消息!

感謝 @steemstem 慷慨支持,贊助金額由是次比賽起增加一倍!

詳見下文"獎品"部分。

---

Mathematics × Programming Competition #8

https://steemitimages.com/0x0/https://steemitimages.com/DQmb33Qwu5vome8xQ2ZLcqFxZmFwV255hPGovzavXSUDtaX/math%26progLOGO-01-01.png

Designed by @nicolemoker

13/10/2017 UTC 15:00 - 20/10/2017 UTC 15:00

For Chinese version please scroll to the bottom. 中文版請見文末。

Question

Ken has a four-digit calculator which displays numbers using the seven-segment-display. For example the number 159 is displayed as

https://steemitimages.com/DQmdzSzwdBK2McUY7b1FvoFHWxBxNmshbv1AextGymCLMCq/image.png

Note that 159 is displayed as 0159

Suppose we want to use non-transparent cards to represent all the possible 4-digit numbers from 0000 to 9999. Each card will show one 4-digit number, where the numbers are written using seven-segment-display. However when some cards are rotated 180°, a new number can be formed. For example when the card 0159 is rotated 180°, it becomes 6510.
https://steemitimages.com/DQmeUxm44PWNVixdNomuYDXkEJmBvJCnqZ8oqxorumPUzne/a.png

Note that it is acceptable for the ‘1’ to be displayed on the left hand side

Considering the possibility of rotating a card 180°, what is the minimum number of non-transparent cards required to represent all the possible 4-digit numbers from 0000 to 9999?

Answer submission

Please submit your answer through this link.

Rules

Prizes

Name of prize Max no. of prizes SBD SP (sponsored by @steemstem ! ) First prize 1 SBD payout of this post / n 15 Second prize 1 SBD payout of this post / n 10 Third prize 1 SBD payout of this post / n 5 Consolation prize 5 SBD payout of this post / n 0

where n is the total number of winners in this competition. n = min (number of participants getting the correct answer, 8).

https://steemitimages.com/0x0/https://steemitimages.com/DQmY2jUCgfijKRkYnpsENa1jpv6VFwWe8Ts88cYKcQjiLcp/image.png

The steemSTEM project (@steemstem) is a community-supported project aiming to increase the quality and the visibility of STEM (STEM is the acronym for Science, Technology, Engineering and Mathematics) articles on Steemit. Please support steemSTEM by following @steemstem and joining the chat channel. You can also consider joining a private curation trail to further support steemSTEM by asking about it in the chat channel. In order to further promote the use of the chat channel, I will stop announcing the time of next competition via a post. Instead I will announce the time in advance in the chat channel!

---

數學 × 程式編寫比賽 (第八回)

https://steemitimages.com/0x0/https://steemitimages.com/DQmb33Qwu5vome8xQ2ZLcqFxZmFwV255hPGovzavXSUDtaX/math%26progLOGO-01-01.png

Designed by @nicolemoker

13/10/2017 UTC 15:00 - 20/10/2017 UTC 15:00

問題

Ken有一部只能顯示四位數的計算器,它使用七段顯示來顯示數字。例如,159顯示為

https://steemitimages.com/DQmdzSzwdBK2McUY7b1FvoFHWxBxNmshbv1AextGymCLMCq/image.png

注意159顯示為0159

假設我們要使用非透明卡紙來表示從0000到9999所有可能的4位數字。每張卡紙將顯示一個4位數字,而這些數字是使用七段顯示器所寫成的。留意當某些卡片旋轉180°時,可以形成新的數字。例如當卡片0159旋轉180°時,它將變成6510。
https://steemitimages.com/DQmeUxm44PWNVixdNomuYDXkEJmBvJCnqZ8oqxorumPUzne/a.png

注意'1'顯示在左側亦可接受

考慮到將卡紙旋轉180°的可能性,最少需要多少張卡紙才能表示從0000到9999所有可能的4位數字?

答案提交

請經此連結提交答案。

規則

獎品

獎項 獎項數目 SBD SP (由 @steemstem 贊助!) 一等獎 1 此帖文的 SBD 金額 / n 15 二等獎 1 此帖文的 SBD 金額 / n 10 三等獎 1 此帖文的 SBD 金額 / n 5 安慰獎 5 此帖文的 SBD 金額 / n 0

其中 n 是本比賽中得獎者的總數。n = min (答對人數, 8)。

https://steemitimages.com/0x0/https://steemitimages.com/DQmY2jUCgfijKRkYnpsENa1jpv6VFwWe8Ts88cYKcQjiLcp/image.png

steemSTEM(@steemstem)是一個由steemit社群支持的項目,旨在宣傳STEM(STEM是科學,技術,工程和數學的首字母縮略詞)。 請追蹤 @steemSTEM 以及加入聊天頻道來支持steemSTEM。你還可以透過加入自動點讚系統來在為了進一步支持steemSTEM,詳情請在聊天頻道內向負責人士查詢。為了推廣聊天頻道的使用,我將不再透過發文來宣布下一場比賽的時間,我會在聊天頻道中提前公佈比賽時間。

TAGS: [ #contest ] [ #steemstem ] [ #math ] [ #cn ] [ #cn-contest ]

Replies

@vincentyip | Oct. 13, 2017, 3:24 p.m. | Votes: 0 | [ VOTE ]

submitted my answer :)
luckily i saw your announcement 1 hour ago in the steemstem channel, so I can catch your post on time!

@kenchung | Oct. 13, 2017, 4:30 p.m. | Votes: 0 | [ VOTE ]

ye if you join the steemstem channel you would know the time of competition in advance!

@armandocat | Oct. 13, 2017, 3:28 p.m. | Votes: 1 | [ VOTE ]

Nice! I submitted my answer! 😼

@kenchung | Oct. 13, 2017, 4:28 p.m. | Votes: 0 | [ VOTE ]

great! :)

@johnbakare | Oct. 13, 2017, 3:36 p.m. | Votes: 0 | [ VOTE ]

I hate maths, I'm probably lost here. Let me come and be going 🏃🏃🏃🏃🚶🚶

@kenchung | Oct. 13, 2017, 4:32 p.m. | Votes: 0 | [ VOTE ]

sorry to hear that you hate maths, hopefully this question did not make you hate it more! haha

@justyy | Oct. 13, 2017, 3:37 p.m. | Votes: 1 | [ VOTE ]

submitted, voted and resteeeeeeeeeeeeeeem!

@kenchung | Oct. 13, 2017, 4:27 p.m. | Votes: 0 | [ VOTE ]

thanks for joining (again) ! ;)

@enzor | Oct. 13, 2017, 3:50 p.m. | Votes: 0 | [ VOTE ]

I'm not able to answer this question but I'll resteem this because it's a good question

@kenchung | Oct. 13, 2017, 4:32 p.m. | Votes: 0 | [ VOTE ]

thanks so much!

@firstamendment | Oct. 13, 2017, 6:42 p.m. | Votes: 0 | [ VOTE ]

sure you can. you can write them all down one at a time, and hope you can identify a pattern (or hope you don't make a counting error). Or, you can learn how to code. This is a simple one through coding.

@cifer | Oct. 13, 2017, 4:01 p.m. | Votes: 1 | [ VOTE ]

Am I late? submitted and resteemed~~

@kenchung | Oct. 13, 2017, 4:29 p.m. | Votes: 0 | [ VOTE ]

not quite late i guess, but even if the first 3 spots have been taken, you can still have the chance to get a random prize!

@heimindanger | Oct. 13, 2017, 4:15 p.m. | Votes: 0 | [ VOTE ]

Answered!

@kenchung | Oct. 13, 2017, 4:30 p.m. | Votes: 0 | [ VOTE ]

thanks for joining!

@breathewind | Oct. 13, 2017, 4:15 p.m. | Votes: 0 | [ VOTE ]

It seems it's not so late. I decide to reply first to get a nice position:)
Btw, I see there may be a mistake on competition period
"13/10/2017 UTC 15:00 - 20/11/2017 UTC 15:00"
I think it should be:
"13/10/2017 UTC 15:00 - 20/10/2017 UTC 15:00".

@kenchung | Oct. 13, 2017, 4:31 p.m. | Votes: 0 | [ VOTE ]

just to remind you that your final position depends on the time of your answer submission through the google form, not the timestamp of your comment here ;)

@breathewind | Oct. 14, 2017, 12:54 p.m. | Votes: 0 | [ VOTE ]

Thank you, already summited

@kenchung | Oct. 15, 2017, 9:05 a.m. | Votes: 0 | [ VOTE ]

thanks for spotting the mistake, I have just updated it :)

@speeding | Oct. 15, 2017, 12:06 a.m. | Votes: 0 | [ VOTE ]

他说你的日期写错了,13/10/2017 UTC 15:00 - 20/11/2017 UTC 15:00,截止日期应该是 20/10/2017 UTC 15:00 吧?

@kenchung | Oct. 15, 2017, 9:07 a.m. | Votes: 0 | [ VOTE ]

對,剛剛才注意到他的留言,已改正了,謝謝!

@firstamendment | Oct. 13, 2017, 6:39 p.m. | Votes: 0 | [ VOTE ]

commenting so I can resteem later, if I remember and am able to.

@kenchung | Oct. 15, 2017, 9:07 a.m. | Votes: 0 | [ VOTE ]

great :) thanks for joining

@firstamendment | Oct. 15, 2017, 3:27 p.m. | Votes: 0 | [ VOTE ]

It won't let me resteem. Timed out the other day. Oh well.

@leedslemon | Oct. 14, 2017, 5:23 p.m. | Votes: 0 | [ VOTE ]

submitted one day later. Hope my answer is correct and luckily get the prize=]
btw I've use some excel function to do it. Hope my logic is correct haha.

@kenchung | Oct. 15, 2017, 9:08 a.m. | Votes: 0 | [ VOTE ]

ye I think it is possible to use Excel to solve this question :) hope that you can win!

@speeding | Oct. 15, 2017, 12:03 a.m. | Votes: 0 | [ VOTE ]

这期看起来比较简单,还是用程序方便

@kenchung | Oct. 15, 2017, 9:09 a.m. | Votes: 0 | [ VOTE ]

沒錯,這次相對容易,總不能每次都設定得太困難,不然把大家都嚇走了,哈哈

@breathewind | Oct. 20, 2017, 12:26 p.m. | Votes: 0 | [ VOTE ]

May I use contents of this post in my blog for illustrating the solution?(in the future, not now). I will comment where I quote them from.

@kenchung | Oct. 20, 2017, 3:56 p.m. | Votes: 0 | [ VOTE ]

ye sure!

@justyy | Oct. 20, 2017, 5:46 p.m. | Votes: 1 | [ VOTE ]
@speeding | Oct. 22, 2017, 9:28 a.m. | Votes: 0 | [ VOTE ]

用一行python语句把这道题解了,我是不是疯了?
https://steemit.com/cn/@speeding/one-line-python-math-programming

print(int(sum(map(lambda d: 0.5 if d != ''.join(map(lambda i:'012xx59x86'[int(i)], d[::-1])) and ''.join(map(lambda i:'012xx59x86'[int(i)], d[::-1])) in ['%04d' % x for x in range(0, 10000)] else 1 , ['%04d' % x for x in range(0, 10000)]))))

@justyy | Oct. 22, 2017, 9:55 a.m. | Votes: 0 | [ VOTE ]

这个可以有,PYTHON一向以一行代码解题著称,不过写出来的代码没有维护性,很难改,用于快速刷题可以的。

@speeding | Oct. 22, 2017, 2:20 p.m. | Votes: 0 | [ VOTE ]

只是好玩

@challk | Oct. 21, 2017, 6:09 a.m. | Votes: 0 | [ VOTE ]

waiting to see the answer :) hopefully got it right

@vincentyip | Oct. 21, 2017, 9:17 a.m. | Votes: 0 | [ VOTE ]

my answer here: https://steemit.com/contest/@vincentyip/676hxw :)

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>