fall_89-90_exer03.pdf

‫ﺑﻪ ﻧﺎﻡ ﺧﺪﺍ‬
‫ﺳﺎﺧﺘﻤﺎﻥ ﻫﺎﻱ ﮔﺴﺴﺘﻪ‬
‫ﺗﻤﺮﻳﻦ ﺳﻮﻡ ‪ ،‬ﻣﻬﻠﺖ ﺗﺤﻮﻳﻞ‪ 23 :‬ﺁﺑﺎﻥ ‪89‬‬
‫ﺩﺍﻧﺸﻜﺪﻩ ﻣﻬﻨﺪﺳﻲ ﻛﺎﻣﭙﻴﻮﺗﺮ ﺩﺍﻧﺸﮕﺎﻩ ﺻﻨﻌﺘﻲ ﺷﺮﻳﻒ‬
‫‪ - 1‬ﺛﺎﺑﺖ ﻛﻨﻴﺪ‬
‫‪ .a‬ﺍﮔﺮ ‪ 2n − 1‬ﻋﺪﺩﻱ ﺍﻭﻝ ﺑﺎﺷﺪ ﺁﻧﮕﺎﻩ 𝑛𝑛 ﺍﻭﻝ ﺍﺳﺖ‪.‬‬
‫‪ .b‬ﺍﮔﺮ ‪ 2𝑛𝑛 + 1‬ﺍﻭﻝ ﺑﺎﺷﺪ ﺁﻧﮕﺎﻩ 𝑛𝑛 ﺗﻮﺍﻧﻲ ﺍﺯ ‪ 2‬ﺍﺳﺖ‪.‬‬
‫‪ - 2‬ﻣﺮﺗﺒﻪ )‪ (Order‬ﺍﻟﮕﻮﺭﻳﺘﻢ ﺯﻳﺮ ﺭﺍ ﺑﺪﺳﺖ ﺁﻭﺭﻳﺪ‪ ) .‬ﺑﻪ ﺻﻮﺭﺕ ‪( θ‬‬
‫)‪FIND-ORDER(n‬‬
‫‪1 𝑠𝑠𝑠𝑠𝑠𝑠 = 1‬‬
‫𝑛𝑛 𝑡𝑡𝑡𝑡 ‪2 𝑓𝑓𝑓𝑓𝑓𝑓 𝑖𝑖 = 1‬‬
‫‪3‬‬
‫‪𝑑𝑑𝑑𝑑 𝑓𝑓𝑓𝑓𝑓𝑓 𝑗𝑗 = 1 𝑡𝑡𝑡𝑡 𝑖𝑖 2‬‬
‫‪4‬‬
‫‪𝑑𝑑𝑑𝑑 𝑖𝑖𝑖𝑖 𝑗𝑗 𝑚𝑚𝑚𝑚𝑚𝑚 𝑖𝑖 = 0‬‬
‫‪5‬‬
‫𝑗𝑗 𝑡𝑡𝑡𝑡 ‪𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑓𝑓𝑓𝑓𝑓𝑓 𝑘𝑘 = 1‬‬
‫‪6‬‬
‫‪𝑑𝑑𝑑𝑑 𝑠𝑠𝑠𝑠𝑠𝑠 = 𝑠𝑠𝑠𝑠𝑠𝑠 + 1‬‬
‫‪9‬‬
‫‪ - 3‬ﺑﺎﻗﻴﻤﺎﻧﺪﻩ ) ‪ 2(11‬ﺑﺮ ‪ 11‬ﭼﻨﺪ ﺍﺳﺖ؟‬
‫‪ - 4‬ﺛﺎﺑﺖ ﻛﻨﻴﺪ ﺑﺮﺍﻱ ﻫﺮ ﻋﺪﺩ ﻃﺒﻴﻌﻲ ‪ n‬ﻋﺪﺩ ﻃﺒﻴﻌﻲ ﻣﺎﻧﻨﺪ ‪ a‬ﻭﺟﻮﺩ ﺩﺍﺭﺩ ﺑﻪ ﻃﻮﺭﻱ ﻛﻪ ﻫﻴﭻ ﻛﺪﺍﻡ ﺍﺯ ﺍﻋﺪﺍﺩ‬
‫ﻧﺒﺎﺷﺪ‪.‬‬
‫‪ - 5‬ﺛﺎﺑﺖ ﻛﻨﻴﺪ ﺑﻴﻨﻬﺎﻳﺖ ﻋﺪﺩ ﻃﺒﻴﻌﻲ ﻣﺎﻧﻨﺪ ‪ n‬ﻭﺟﻮﺩ ﺩﺍﺭﺩ ﺑﻪ ﻃﻮﺭﻱ ﻛﻪ‪:‬‬
‫‪ a+1, a+2, … , a+n‬ﺍﻭﻝ‬
‫‪ - 6‬ﺛﺎﺑﺖ ﻛﻨﻴﺪ ﺑﺮﺍﻱ ﻫﺮ 𝑛𝑛 ‪ 2n ،‬ﻋﺒﺎﺭﺕ )𝑛𝑛‪ (𝑛𝑛 + 1)(𝑛𝑛 + 2) … (2‬ﺭﺍ ﻣﻲ ﺷﻤﺎﺭﺩ‪.‬‬
‫‪ - 7‬ﻣﺮﺗﺒﻪ )‪ (Order‬ﻫﺮ ﻳﻚ ﺍﺯ ﺗﻮﺍﺑﻊ ﺯﻳﺮ ﺭﺍ ﺑﺪﺳﺖ ﺁﻭﺭﻳﺪ‪:‬‬
‫‪65|4𝑛𝑛2 + 1‬‬
‫{ ) ‪a. Int f ( int n‬‬
‫;‪If ( n==1 ) return 1‬‬
‫;‪Return 2*f( n-1) + 3*n +1‬‬
‫}‬
‫{ ) ‪b. Int f ( int n‬‬
‫;‪If ( n==1 ) return 1‬‬
‫)‪Return f( n/2 ) + log (n‬‬
‫}‬
‫‪ - 8‬ﺍﮔﺮ ‪ A‬ﻭ ‪ B‬ﺩﻭ ﻣﺎﺗﺮﻳﺲ ‪ n*n‬ﺑﺎﺷﻨﺪ‪ ،‬ﻧﺸﺎﻥ ﺩﻫﻴﺪ‪:‬‬
‫‪(𝐴𝐴 + 𝐵𝐵)𝑡𝑡 = 𝐴𝐴𝑡𝑡 + 𝐵𝐵𝑡𝑡 .a‬‬
‫‪(𝐴𝐴𝐴𝐴)𝑡𝑡 = 𝐵𝐵𝑡𝑡 𝐴𝐴𝑡𝑡 .b‬‬
‫ﻣﻮﻓﻖ ﺑﺎﺷﻴﺪ‬