问题求解一

问题求解一

1-1:为什么计算机能解题(UD&DH)

  • 理解问题求解的基本过程

    First . “Understanding the problem.” Easier said than done, of course.What should you do? Make sure you know what all the words mean.You may need to look something up in this book, or you may need touse another book. Look at the statement to figure out carefully whatyou are given and what you are supposed to figure out. If a picturewill help, draw it. Will you be proving something? What? Will youhave to obtain an example? Of what? Check all conditions. Will youhave to show that something is false? Once you understand whatyou have to do, you can move on to the next step.

    Second. “Devising a plan.” How will you attack the problem? Atthis point, you understand what must be done (because you havecompleted Step 1). Have you seen something like it before? If youhaven’t looked over class notes, haven’t read the text, or haven’tdone the previous homework assignments, the odds are slim thatyou have seen anything that will be helpful. Do all that first. Lookover the text with the problem in mind, read over your notes withthe problem in your head, look at previous exercises and theoremsthat sound similar. Maybe you can use some of the ideas in the proofof a theorem, or maybe you can use a previous homework problem.Mathematics builds on itself and the problems in the text will also. Ifyou are truly stuck, try to answer a simpler, similar question. Onceyou decide on a method of approach, try it out.

    Third. “Carrying out the plan.” Solve the problem. Look at yoursolution. Is each sentence true? Sometimes it is difficult to catch anerror right after you have “found a solution.” Put the problem downand come back to it a few hours later. Is each sentence still true?

    Fourth. “Looking Back.” Po ́lya suggests checking the result and the argument, or even looking for a different proof. If you are allowed(check with your teacher), one really good way to check a proofis to give it to someone else. You can present it to friends. Even if they don’t understand a word you are saying, sometimes saying it out loud in a coherent manner will allow you to recognize an error you can’t spot when you are reading. If you are permitted to work together, switch proofs and ask your partner for criticism of your proof.

  • 理解计算机中简单操作为什么能解决复杂问题

    简单操作能够通过设计的算法组合起来以解决各种复杂问题

![新文档 2017-01-01 21.10.47_1](/Users/apple/Desktop/问题求解/问题求解一/问求复习/图片/新文档 2017-01-01 21.10.47_1.jpg)


1-2:什么样的推理是正确的(UD)

  • 掌握命题逻辑与谓词逻辑的基本推导方法
    1. A statement is a sentence that is either true or false (but not both).

    2. “P if and only if Q.” Such symbolic sentences will be called statement forms.

      – negation(否定)

      – disjunction(析取)

      – conjunction(合取)

      – implication(蕴涵)

      – equivalence(等价)

      The statement form “P if and only if Q” is called an equivalence, and we will write this as P ↔ Q.

      注:equivalent statement form:两个statement form具有相同真假性

      – tautology(永真式)

      – contradiction(永假式)

    3. 真值表

      表征逻辑事件输入和输出之间全部可能状态的表格。

      构造真值表步骤
      1. 找出命题公式中所含的所有命题变项(若无下角标就按字典顺序给出),列出所有的可能的赋值;
      2. 按从低到高的顺序写出各层次;
      3. 对应每个赋值,计算命题公式各层次的值,直到最后计算出命题公式的值。

      ![屏幕快照 2017-01-01 21.16.22](/Users/apple/Desktop/问题求解/问题求解一/问求复习/图片/屏幕快照 2017-01-01 21.16.22.png)

    4. 持续等值变化

      ![新文档 2017-01-01 21.10.47_2](/Users/apple/Desktop/问题求解/问题求解一/问求复习/图片/新文档 2017-01-01 21.10.47_2.jpg)

    5. Now consider ¬Q → ¬P, which is called the contrapositive of the implication P → Q .

    6. The converse of an implication P → Q is the statement form Q → P.

    7. Set Notation and Quantifiers集合的表示和量词(∀,∃)

引导要点

  • 计算机解题的关键是正确的推导
  • 其正向是算法的设计,其反向是正确性证明

1-3:常用的证明方法(UD)

  • 掌握逻辑正确的常用证明方法

    Direct proof (just get started and keep going)

    P0∧(P0→P1)∧(P1→P2)∧…∧(Pn-1→Pn) → Pn 是永真式

    Proof by contradiction (show that the negation of the statement you wish to prove implies the impossible)

    P∧(¬Q→¬P) → Q 是永真式

    Proof in cases (which may be used when conditions dictate thatdifferent situations occur)

    P∧(P↔P1∨…∨Pn)∧(P1→Q)∧…∧(Pn→Q) → Q 是永真式

    Mathematical Induction

    P ↔ P1∧P2∧…↔ P1∧(P1→P2)∧(P2→P3)∧… 是永真式

    Pigeonhole principle


1-4:基本的算法结构(DH)

  • 理解基本的算法结构:顺序、分支、循环、子程序、递归

    循环:1. Boundediteration 2.Conditionaliteration (aka unboundediteration)

    递归:所有递归子程序都能改写为循环(在计算开始之前就能确定层数,而且遍历顺序无所谓的情况下的递归都该被改成循环)

    
    #include <iostream>
    
    using namespace std;
    int fac (int n)
    {
      if (n == 0)
          return 1;
      else
          return n * fac(n-1);
    }
    int main()
    {
      int a;  
      cin >> a;
      int temp = a;
      int out = a;
      
  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值