2026年8月1日 星期六

教師留言給佳恩的作業指派-7月31日

  2026/7/31(五) 19:00-20:30

  1. 今日教學進度:
    • 教師帶領佳恩討論 Khan Academy: Intro to computer science - Python/Unit 5: Automating tasks with lists/Lesson 1: List indices Bonus
      1. 研究 list 的四個 methods 以及 random.choices (含權重機率的隨機抽取)
        1. mylist = [0, 1, 2, 3, 4, 5, 6, 7] # construction
        2. mylist.append(8) #  [0, 1, 2, 3, 4, 5, 6, 7, 8]
        3. mylist.index(6) # 5 
        4. mylist.pop(7) # [0, 1, 2, 3, 4, 5, 6,  8]
        5. random.choices(mylist, weights=[3,2,1,1,1,1,2,3], k=1)[0]
      2. 完成 Challenge: DNA mutation Bonus
        1. main.py

        2. import dna
        3. import random
        4. # 已知原來的 DNA 序列如下:
        5. DNA_bases = ["Gua", "Cyt", "Thy", "Gua", "Ade", "Ade" , "Cyt", "Gua"]

        6. '''
        7. 因為已知的 DNA 序列中,鹼基代號有重複,
        8. 故設定指標串列來識別,以利後續處理時不會被同名鹼基混淆
        9. '''
        10. DNA_base_indices = [0, 1, 2, 3, 4, 5, 6, 7]

        11. '''
        12. 根據 Yui 的解釋:DNA 序列兩端鹼基更容易發生突變。
        13. 可假定這八個鹼基突變的相對機率權重如下:
        14.     3,2,1,1,1,1,2,3
        15. 依此設定 DNA 序列鹼基的權重串列
        16. '''
        17. DNA_base_weights = [3,2,1,1,1,1,2,3]

        18. ''' 
        19. 隨機決定 DNA 序列中的鹼基發生突變的數量,
        20. 限定範圍 2-4 個 
        21. '''
        22. num_mutations = random.randint(2, 4)
        23. print("num_mutations = " + str(num_mutations))

        24. # Randomly mutate num_mutaions of bases in the DNA sequence.
        25. # 突變串列開始為空串列,在完成 for 迴圈後,應有 num_mutations 個元素
        26. mutations_indices = []

        27. for mutation in range(num_mutations):
        28.     # 每一次迴圈,按權重隨機取一個 DNA 突變鹼基的指標,

        29.     mutating_index = \
        30.     random.choices(DNA_base_indices, weights=DNA_base_weights, k=1)[0]
        31.     print("mutating_index = " + str(mutating_index))
        32.     
        33.     # 將取出的一個突變鹼基附加到突變鹼基串列
        34.     mutations_indices.append(mutating_index)
        35.     print("mutations_indices = " + str(mutations_indices))

        36.     ''' 
        37.     從 DNA 序列的指標串列中刪除,
        38.     以避免在下一迴圈重複取同一個鹼基。
        39.     同時把對應的鹼基的權重從其串列中一併刪除。
        40.     ''' 
        41.     position = DNA_base_indices.index(mutating_index)
        42.     DNA_base_indices.pop(position) 
        43.     DNA_base_weights.pop(position)

        44.     '''把剩下未突變的鹼基的指標串列顯示出來'''
        45.     print("DNA_base_indices = " + str(DNA_base_indices))
        46.     print("DNA_base_weights = " + str(DNA_base_weights))
        47.     
        48.     # 進入下一個迴圈

        49. '''
        50. 迴圈結束時,突變串列 mutations_indices 中含有 DNA 所有突變鹼基的指標
        51. '''
        52. print("Original DNA_bases = " + str(DNA_bases))
        53. for m in range(len(mutations_indices)):
        54.     '''取出即將突變鹼基的指標'''
        55.     mutating_index = mutations_indices[m]
        56.     
        57.     '''用指標取出即將突變鹼基的英文代碼'''
        58.     mutating_base = DNA_bases[mutating_index]
        59.     print("mutating_index = " + str(mutating_index) + \
        60.           " mutating_base = " + mutating_base)
        61.     
        62.     '''呼叫鹼基突變函數代入即將突變的鹼基名稱,得到突變後的鹼基名稱'''
        63.     mutated_base = dna.get_mutated_base(mutating_base)
        64.     print("mutated_base = " + mutated_base)

        65.     '''用得到的突變鹼基名稱改掉原來的 DNA 對應的鹼基,加尾標 x 以利識別'''
        66.     DNA_bases[mutating_index] = mutated_base + "x"

        67. print("final DNA_bases = " + str(DNA_bases))
        68. dna.py
        69. """
        70. Manipulates nucleotide bases in a DNA sequence, abbreviated as three letters.

        71. The bases are Adenine (Ade), Cytosine (Cyt), Guanine (Gua), and Thymine (Thy).
        72. """

        73. import random

        74. """ 
        75. 為了讓鹼基突變函數真的改變原來的鹼基,
        76. 這函數必須輸入一個參數代表將要突變的鹼基。
        77. 然後函數傳回突變後的鹼基,確保和原來鹼基不同。

        78. 並且根據 Yui 的說明:
        79. Ade 和 Gua 互變;Cyt 和 Thy 互變。
        80. 且 DNA 序列兩端的鹼基比中間的鹼基發生突變的機率高。
        81. """
        82. def get_mutated_base(mutating_base):
        83.     if mutating_base == "Ade":
        84.         return "Gua"
        85.     elif mutating_base == "Gua":
        86.         return "Ade"
        87.     elif mutating_base == "Cyt":
        88.         return "Thy"
        89.     else: # 一定是 Thy
        90.         return "Cyt"

        91. Console (監視窗)

        92. num_mutations = 3
        93. mutating_index = 2
        94. mutations_indices = [2]
        95. DNA_base_indices = [0, 1, 3, 4, 5, 6, 7]
        96. DNA_base_weights = [3, 2, 1, 1, 1, 2, 3]
        97. mutating_index = 1
        98. mutations_indices = [2, 1]
        99. DNA_base_indices = [0, 3, 4, 5, 6, 7]
        100. DNA_base_weights = [3, 1, 1, 1, 2, 3]
        101. mutating_index = 6
        102. mutations_indices = [2, 1, 6]
        103. DNA_base_indices = [0, 3, 4, 5, 7]
        104. DNA_base_weights = [3, 1, 1, 1, 3]
        105. Original DNA_bases = ['Gua', 'Cyt', 'Thy', 'Gua', 'Ade', 'Ade', 'Cyt', 'Gua']
        106. mutating_index = 2 mutating_base = Thy
        107. mutated_base = Cyt
        108. mutating_index = 1 mutating_base = Cyt
        109. mutated_base = Thy
        110. mutating_index = 6 mutating_base = Cyt
        111. mutated_base = Thy
        112. final DNA_bases = ['Gua', 'Thyx', 'Cytx', 'Gua', 'Ade', 'Ade', 'Thyx', 'Gua']
    • 作業指派:
      1. 請佳恩複習今天學習的學習內容,說明如「今日教學進度」。
        1. 焦點:探索 Python List 變數的 random.choices 方法中選項的權重概率
    • 下次課程計畫: 
      1. 下次課程日期預計:2026/8/11(二)。 (8/4 自行複習 DNA mutation Bonus )
      2. 檢閱上次作業派執行狀況。
      3. 教師指導佳恩寫程註解。
      4. 教師帶領佳恩討論 Khan Academy: Intro to computer science - Python/Unit 5: Automating tasks with lists/Lesson 2: List iteration: Looping over lists: by key or by element.
    • 備用教材:
      • GEPT中級聽力AI 生成提示語模板 & ElevenLags TTS Dialogue
      • 中文作文:啟承轉合
      • 《AI雙語字詞發展策略》
      • 《抄寫英語的奇蹟》的 Day9, Day10, Day11
        • 聽力練習(全文)
          • 被動聆聽:習慣發音、語調和節奏。
          • 同步聆聽和默讀。
        • 口說訓練:(全文)
          • 逐句跟唸。
          • 同步跟唸。
          • 邊唸邊寫。
        • 閱讀訓練:(選擇)文章中的句子和段落,進行分析語法、語意、和語用。
        • 寫作訓練:(選擇)文章中的句子和段落,進行改寫、換句話說、拆句、併句。
        • 擴充單字訓練:(選擇)文章中的字詞,進行語意場分析和造句。
      • 《完美英語之心靈盛宴》 的一般使用方法,透過 ChatGPT 生成 1) 換句話說:用不同的說法闡明原短句之涵意,提昇用英文解釋英文的能力,以及用英文思考的能力。2) 造長句:使用不同的結構來造長句,提升應用短句的能力,以及閱讀和寫作長句的能力。3) 語用分析:從某句話推論說話者的意圖和隱含的意思,以及這句話適用的各種情境。 
      • 《完美英語之心靈盛宴》第84頁 Book1 Part2 Unit6 拒絕失敗。
        • Refuse to lose. 拒絕失敗。Refuse to give up. 拒絕放棄。Persistence wins the day. 堅持才會贏。Don't worry about failures. 不要擔心失敗。Worry about missed chances. 擔心錯過機會。Always try, try, try! 永遠嘗試再嘗試。Turn the tables. 反敗為勝。Turn the tide. 扭轉乾坤。 Reverse the situation. 反轉局勢。
      • 《完美英語之心靈盛宴》第502頁 Book4 Part1 Unit3 「不要選邊站」。
        • Don't take sides. 不要選邊站。Be on everyone's side. 要站在所有人這一邊。Be friendly to all. 對人人友善。Everyone is unique. 每個人都獨一無二。Everyone to his taste. 各有所好。To each his own. 各有所好。Never blame others. 不要責備他。Never point a finger at others. 不要指責他人。It reflects badly on you. 這會為你帶來負面影響。
      • 《Heart of  the Matter》Part 1 - Chapter 1 第 4-9 段。
      • 高職統測及全民英檢中級測驗日期
        高職統測 2027年5月中旬,
        全民英檢中級測驗日期如下表:

    沒有留言:

    張貼留言