create account

[Question] Mathematics × Programming Competition #3 [問題] 數學 × 程式編寫比賽 (第三回) by kenchung

View this thread on: hive.blogpeakd.comecency.com
· @kenchung · (edited)
$4.22
[Question] Mathematics × Programming Competition #3 [問題] 數學 × 程式編寫比賽 (第三回)
<h2><center>Welcome to the Mathematics × Programming Competition #3 </center></h2>

<center><h6>*For Chinese version please scroll to the bottom. 中文版請見文末。*</h6></center>

----

<center><h2>Question</h2></center>

**Ghost Leg** (aka Amidakuji) is a  tiny game which is used to create random pairings between two arrays. This is commonly used in lucky draws. 

A ghost leg consists of vertical lines and horizontal lines. If there are *N* elements in an array, there would be *N* vertical lines and any number of horizontal lines. Horizontal lines should be touching two adjacent vertical lines. The rule of matching is by picking a vertical line at the top, and go downwards until you hit a horizontal line. Whenever you hit a horizontal line, travel along that horizontal line. Then continue to go downwards and repeat this process until you reach the other end. 

<div class="pull-left">https://steemitimages.com/DQmZ66uFYP1nvMHkjX91YbmrPaHqchhcbupPFyo2qZ5N6Tr/Untitled.png</div>

<br>Consider this example on the left. <br><br>Obviously when there are no horizontal lines at all, the matched pairs would be {A,1}, {B,2} and {C,3}. <br><br>With the horizontal lines added, the matched pairs become {A,3}, {B,2} and {C,1}.<br><br>Make sure you understand this example before proceeding to the main question :)<br><br>

Here comes the question. Consider the case *N* = 10. Given that when there are no horizontal lines, the matching pairs are {A,1}, {B,2}, {C,3}, {D,4}, {E,5}, {F,6}, {G,7}, {H,8}, {I,9}, {J,10}.  What is the minimum number of horizontal lines to be added such that the final outcome would be {A,7}, {B,4}, {C,3}, {D,9}, {E,2}, {F,8}, {G,1}, {H,6}, {I,10}, {J,5}?

---
<h2><center>Answer submission</center></h2>

Please submit your answer through this <a href="https://goo.gl/forms/OXj1Bafe4QOU2c3p2">link</a>.

---
<h2><center>Rules</center></h2>

- This competition will last for 24 hours. After that no more submission would be accepted.
- Participants who submit the answer as a comment below this post will be **disqualified**.
- Participants can submit for unlimited number of times, however only the latest answer will be considered.
- You have to upvote this post AND <a href="https://steemit.com/contest/@kenchung/get-ready-mathematics-programming-competition-round-3">the announcement post</a> in order to be eligible for the competition.

---
<h2><center>Prizes</center></h2>

- The final SBD payout of  <a href="https://steemit.com/contest/@kenchung/get-ready-mathematics-programming-competition-round-3">the announcement post</a> would be the prize pool.
- The first and second participant who gave the correct numerical answer will get 30% and 20% of the prize pool respectively. 5 other participants who provided the correct answer will be randomly drawn regardless of their submission time and each of them will get 10% of the prize pool.
- Those who resteemed this post or <a href="https://steemit.com/contest/@kenchung/get-ready-mathematics-programming-competition-round-3">the announcement post</a>  will have 400% higher chance to win in the lucky draw!
- If not all prizes are given out, they will be accumulated for the next competition.
- @kenchung reserve all the rights to disqualify any suspected cheating players and decide the distribution of prize among the winner(s).

----
----
<h2><center>歡迎參加數學 × 程式編寫比賽 (第三回) </center></h2>

---

<center><h2>問題</h2></center>

**畫鬼腳** 是一個用以將兩個序列配對的小遊戲。畫鬼腳被經常應用在抽獎之中。

鬼腳圖由直線及橫線組成。若一序列有*N*個項目,該鬼腳圖則共有*N*條直線及任何數量的橫線,且橫線必須連著相鄰的直線。配對規則為選取其中一個頂點,然後向下移動,直至遇到橫線。遇到橫線的時候需要跟著橫線行走,然後繼續向下移動,並重覆以上步驟,直至到達另一端。

<div class="pull-left">https://steemitimages.com/DQmZ66uFYP1nvMHkjX91YbmrPaHqchhcbupPFyo2qZ5N6Tr/Untitled.png</div>

<br><br><br>試參考左側例子。<br><br>當圖中完全沒有橫線,明顯地配對結果為 {A,1}、{B,2}及{C,3}。<br><br>加上橫線後,配對結果便變成 {A,3}、{B,2}及{C,1}。<br><br>繼續閱讀問題前請確保你已完全明白這個例子 :)<br><br><br>

現在終於來到問題部分了。考慮*N* = 10。已知當鬼腳圖中完全沒有橫線,配對結果為 {A,1}, {B,2}, {C,3}, {D,4}, {E,5}, {F,6}, {G,7}, {H,8}, {I,9}, {J,10}。求最少需要加上的橫線數目使得配對結果為 {A,7}, {B,4}, {C,3}, {D,9}, {E,2}, {F,8}, {G,1}, {H,6}, {I,10}, {J,5}。

---
<h2><center>答案提交</center></h2>

請經<a href="https://goo.gl/forms/OXj1Bafe4QOU2c3p2">此連結</a>提交答案。

---
<h2><center>規則</center></h2>

- 此比賽將進行24小時,其後將不會再接受新答案。
- 嚴禁在回覆公開答案,否則將被取消資格。
- 參加者可以重覆提交答案,但比賽終結時只會考慮最後提交的答案。
- 你必須upvote此帖以及 <a href="https://steemit.com/contest/@kenchung/get-ready-mathematics-programming-competition-round-3">預告帖</a>方能參加比賽。

---
<h2><center>獎品</center></h2>

- <a href="https://steemit.com/contest/@kenchung/get-ready-mathematics-programming-competition-round-3">預告帖</a>所獲的SBD獎勵將會用作是次比賽的獎池。
- 第一及第二名最快給出正確數字答案的參賽者將分別獲得獎池的30%及20%。其他提交了正確數字答案的參與者之中將隨機抽出5名,他們每人可獲10%的獎池。
- Resteem此帖文或 <a href="https://steemit.com/contest/@kenchung/get-ready-mathematics-programming-competition-round-3">預告帖</a>者將有額外400%的得獎機會!
- 若有獎金未被發放,將累積至下一次比賽的獎池。
本人保留一切最終權利,包括但不限於取消任何疑似作弊者的資格並決定獲獎者的獎勵分配。
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 27 others
properties (23)
authorkenchung
permlinkquestion-mathematics-programming-competition-3
categorycontest
json_metadata{"tags":["contest","math","programming","cn","cn-contest"],"users":["kenchung"],"image":["https://steemitimages.com/DQmZ66uFYP1nvMHkjX91YbmrPaHqchhcbupPFyo2qZ5N6Tr/Untitled.png"],"links":["https://goo.gl/forms/OXj1Bafe4QOU2c3p2","https://steemit.com/contest/@kenchung/get-ready-mathematics-programming-competition-round-3"],"app":"steemit/0.1","format":"markdown"}
created2017-07-15 04:00:00
last_update2017-07-17 14:58:06
depth0
children9
last_payout2017-07-22 04:00:00
cashout_time1969-12-31 23:59:59
total_payout_value3.439 HBD
curator_payout_value0.784 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,853
author_reputation41,181,348,504,685
root_title"[Question] Mathematics × Programming Competition #3 [問題] 數學 × 程式編寫比賽 (第三回)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id8,529,327
net_rshares957,574,072,963
author_curate_reward""
vote details (91)
@guyverckw ·
submit again
properties (22)
authorguyverckw
permlinkre-kenchung-question-mathematics-programming-competition-3-20170715t060125993z
categorycontest
json_metadata{"tags":["contest"],"app":"steemit/0.1"}
created2017-07-15 06:01:24
last_update2017-07-15 06:01:24
depth1
children0
last_payout2017-07-22 06:01:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length12
author_reputation121,609,723,418,181
root_title"[Question] Mathematics × Programming Competition #3 [問題] 數學 × 程式編寫比賽 (第三回)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id8,536,991
net_rshares0
@math-trail ·
Very good. Have fun with this!


!-=o0o=-!

To follow curated math content follow @math-trail.
If you wish @math-trail to follow *you* then [read this article](https://steemit.com/mathematics/@math-trail/call-to-content-creators-with-mathematical-topics-math-trail-wants-to-follow-you-v-2).
Click here for [Mathematics forum on chainBB](https://beta.chainbb.com/forum/math)
properties (22)
authormath-trail
permlinkre-kenchung-question-mathematics-programming-competition-3-20170715t045309215z
categorycontest
json_metadata{"tags":["contest"],"users":["math-trail"],"links":["https://steemit.com/mathematics/@math-trail/call-to-content-creators-with-mathematical-topics-math-trail-wants-to-follow-you-v-2","https://beta.chainbb.com/forum/math"],"app":"steemit/0.1"}
created2017-07-15 04:53:42
last_update2017-07-15 04:53:42
depth1
children0
last_payout2017-07-22 04:53:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length373
author_reputation6,215,667,826,830
root_title"[Question] Mathematics × Programming Competition #3 [問題] 數學 × 程式編寫比賽 (第三回)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id8,532,514
net_rshares0
@minnowsupport ·
<p>Congratulations!  This post has been upvoted from the communal account, @minnowsupport, by kenchung from the Minnow Support Project.  It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, and someguy123.  The goal is to help Steemit grow by supporting Minnows and creating a social network.  Please find us in the <a href="https://discord.gg/HYj4yvw">Peace, Abundance, and Liberty Network (PALnet) Discord Channel</a>.  It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.</p>

<p>If you like what we're doing please upvote this comment so we can continue to build the community account that's supporting all members.</p>
properties (22)
authorminnowsupport
permlinkre-kenchung-question-mathematics-programming-competition-3-20170715t050421875z
categorycontest
json_metadata{"tags":["contest"],"app":"cosgrove/0.0.1rc3"}
created2017-07-15 05:04:21
last_update2017-07-15 05:04:21
depth1
children0
last_payout2017-07-22 05:04:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length709
author_reputation148,902,805,319,183
root_title"[Question] Mathematics × Programming Competition #3 [問題] 數學 × 程式編寫比賽 (第三回)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id8,533,173
net_rshares0
@pizzachain ·
So the competition ended, but when will the results be published?
properties (22)
authorpizzachain
permlinkre-kenchung-question-mathematics-programming-competition-3-20170716t101025722z
categorycontest
json_metadata{"tags":["contest"],"app":"steemit/0.1"}
created2017-07-16 10:10:24
last_update2017-07-16 10:10:24
depth1
children5
last_payout2017-07-23 10:10:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length65
author_reputation6,751,100,842,809
root_title"[Question] Mathematics × Programming Competition #3 [問題] 數學 × 程式編寫比賽 (第三回)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id8,655,189
net_rshares0
@kenchung ·
I will do the prize presentation and announce the solution in one single post coz I dun want to create too many posts haha
So probably you have to wait for 7 days for the payout of my post, and then I will know how much is the prize pool for prize presentation
properties (22)
authorkenchung
permlinkre-pizzachain-re-kenchung-question-mathematics-programming-competition-3-20170716t104311573z
categorycontest
json_metadata{"tags":["contest"],"app":"steemit/0.1"}
created2017-07-16 10:43:12
last_update2017-07-16 10:43:12
depth2
children4
last_payout2017-07-23 10:43:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length260
author_reputation41,181,348,504,685
root_title"[Question] Mathematics × Programming Competition #3 [問題] 數學 × 程式編寫比賽 (第三回)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id8,657,408
net_rshares0
@pizzachain ·
7 days? :(
properties (22)
authorpizzachain
permlinkre-kenchung-re-pizzachain-re-kenchung-question-mathematics-programming-competition-3-20170716t110137966z
categorycontest
json_metadata{"tags":["contest"],"app":"steemit/0.1"}
created2017-07-16 11:01:36
last_update2017-07-16 11:01:36
depth3
children3
last_payout2017-07-23 11:01:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length10
author_reputation6,751,100,842,809
root_title"[Question] Mathematics × Programming Competition #3 [問題] 數學 × 程式編寫比賽 (第三回)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id8,658,522
net_rshares0