Assessment

Description

Assessment
kanghsien92
Quiz by kanghsien92, updated more than 1 year ago
kanghsien92
Created by kanghsien92 over 8 years ago
18
0

Resource summary

Question 1

Question
Tick the answer(s). There can be more than one answers In order to recursively define an entity, we need
Answer
  • A number of base cases - describes simple instances of the entity
  • A number of step cases - describes complicated instances of the entity
  • Define the operations should do for each base cases
  • Define the operations should do for each step cases
  • Come out with the algorithm first

Question 2

Question
[40, 20, 3] = [blank_start]40 : [20, 3][blank_end] = [blank_start]40 : 20 : [3][blank_end] = [blank_start]40 : 20 : 3 : [ ][blank_end]
Answer
  • 40 : [20, 3]
  • 40 : 20 : [3]
  • 40 : 20 : 3 : [ ]

Question 3

Question
Is the mathematical recursive definition related to programming?
Answer
  • Yes
  • No
  • I am not very sure. But since recursion is used in programming, they should be related?

Question 4

Question
add[2, 4, 10] = [blank_start]add( 2 : [4, 10] )[blank_end] = 2 + [blank_start]add[4, 10][blank_end] = 2 + [blank_start]add( 4 : [10] )[blank_end] = 2 + 4 + [blank_start]add[10][blank_end] = 2 + 4 + [blank_start]add( 10 : [ ] )[blank_end] = [blank_start]2 + 4 + 10 + add[ ][blank_end] = 2 + 4 + 10 = 16
Answer
  • add( 2 : [4, 10] )
  • 2 + 4 + 10 + add[ ]
  • add( 10 : [ ] )
  • add[4, 10]
  • add( 4 : [10] )
  • add[10]

Question 5

Question
[99, 9] ++ [23, 1] = [blank_start](99 : [9]) ++ [23, 1][blank_end] = 99 : [blank_start]([9] ++ [23, 1])[blank_end] = 99 : [blank_start]((9 : [ ]) ++ [23, 1])[blank_end] = 99 : [blank_start](9 : ([ ] ++ [23, 1]))[blank_end] = 99 : [blank_start](9 : ([23, 1]))[blank_end] = 99 : 9 : [23, 1] = [99, 9, 23, 1]
Answer
  • (99 : [9]) ++ [23, 1]
  • ([9] ++ [23, 1])
  • ((9 : [ ]) ++ [23, 1])
  • (9 : ([ ] ++ [23, 1]))
  • (9 : ([23, 1]))

Question 6

Question
Can we prove the property by induction?
Answer
  • Why do we need to prove? Its already proven!
  • Yes we need to prove this

Question 7

Question
What are the orders to prove them? 1) Replace the statement with [blank_start]the base case of Lists[blank_end] 2) Prove the replaced statement using [blank_start]the properties given[blank_end] 3) Replace the statement with [blank_start]the step case of Lists[blank_end] 4) Prove the replaced statement using [blank_start]the properties given[blank_end] 5) Make us of [blank_start]the induction hypothesis[blank_end]
Answer
  • the base case of Lists
  • the properties given
  • the step case of Lists
  • the property given
  • the induction hypothesis
Show full summary Hide full summary

Similar

The main reason knowledge is produced is to solve problems.
Darrel Hong
LMC questions
sbadger
Essbase Certification
Bob Costas
Medical Physics
Tim Davidson
Skull Bones
Justin Jimmy
Ratio and Proportion
sk.ks205
Proyectos
Rocio Anderson
Frans A en B N-F
Manu Mehendale
Haruki Murakami
Fernando Lopez O
Harrys Hannibal Quiz
hmasterson16