Questions tagged [induction]

Anything related to mathematical induction principle and techniques applied to computing. Please DO NOT USE this tag for math-only questions since they are off-topic on SO. This tag may be used for math-related questions only if it involves some programming activity or software tools (e.g. automatic theorem proving, etc.).

Anything related to mathematical induction principle and techniques applied to computing. Please DO NOT USE this tag for math-only questions since they are off-topic on SO. This tag may be used for math-related questions only if it involves some programming activity or software tools (e.g. automatic theorem proving, etc.).

262 questions
0
votes
1 answer

Induction on String? (automata related)

Honestly, all I know about mathematical induction is as follow: 1. prove P(0) - base step 2. for all n ≥ 1, prove (P(n − 1) -> P(n)) - inductive step And here is image of my induction problem that I am struggling now (please click) I am currently…
0
votes
1 answer

Inductive proof on scala stream

Can someone help me with how to reason inductively that this scala code lazy val y : Stream[Int] = 1 #:: (y map (_ + 1)) produces a list of natural numbers from 1 onwards?
Abdul Rahman
  • 1,294
  • 22
  • 41
0
votes
0 answers

proving a function's correctness

1 def recmin(A): 2 if len(A) == 1: 3 return A[0] 4 else: 5 m = len(A) // 2 6 min1 = recmin(A[0..m-1]) 7 min2 = recmin(A[m..len(A)-1]) 8 return min(min1, min2) I'm trying to prove the partial correctness of this function, I figured out a…
ddd suman
  • 55
  • 1
  • 8
0
votes
1 answer

An Example from Description Logic Handbook

I dont understand this example very clearly. The example is taken from Description Logic Handbook. At the last line of the example, "induction is required, hence such reasoning is not first order". That line completely took me off the guard. your…
0
votes
2 answers

Proving an algorithm correct by induction

I am supposed to prove an algorithm by induction and that it returns 3n - 2n for all n >= 0. This is the algorithm written in Eiffel. P(n:INTEGER):INTEGER; do if n <= 1 then Result := n else Result := 5*P(n-1) - 6*P(n-2) …
user3325783
0
votes
4 answers

What is the algorithm efficiency (in terms of Big-Oh) of simple fixed-size integer-arithmetic?

For example, public int sumArray() { int[] arr = new int[10]; int n = arr.length; int sum = (n*(n+1))/2; return sum; } Would the efficiency of this algorithm be O(1), O(n), or something else?
0
votes
1 answer

Proving efficiency class for a time complexity function

Below is the solution but I have trouble understanding 1 part of the proof by induction part. Why can you just add + 2 to one side and +4 to the other? We're dealing with the function T(n) = 2n + 2 We want to find a c such that T(n) <= c * f(n) for…
Andrew Tsay
  • 1,893
  • 6
  • 23
  • 35
0
votes
1 answer

Time complexity(theta) for loops with special case

I can't able to find the theta for some type of code like. for(i=1;i<=n;i++){ for(j=i;j>=1;j=j/3){ .... } } How to find the theta for the above code. It will be really helpful if some one help me how to find it in general case like. …
0
votes
1 answer

Are there any self-learning declarative/inductive programming language to input the expected results, not the procedure to follow?

The language where the computer is told what the problem is, not how to solve the problem. So given a database or a set of rules, the computer tries to find a solution matching all the desired properties. Example 1 (format: input vars => expected…
kenorb
  • 155,785
  • 88
  • 678
  • 743
0
votes
0 answers

Weka J48 implement different missing value handlings

I have to use the J48 tree induction algorithm in some tasks of using data with missing values in. Now i will do some experiential research to compare different missing value approaches in context of J48 tree induction, with different sets of UCI…
user3770188
0
votes
1 answer

Any documents for practice Rule Induction in Type System?

As you know, to define a new type system, one way is that we need: Language syntax Typing rules And then we need to prove some theorems we believe that it is provable by using above typing rules. To prove these theorems, one way is that we can use…
Marco Dinh
  • 332
  • 2
  • 15
0
votes
1 answer

Minimum Heigth AVL-Tree

I was just reading this (http://condor.depaul.edu/ntomuro/courses/417/notes/lecture1.html) paper which proves the minimum number of nodes in an AVL-Tree. Yet, I do not understand the meaning of the result, since O(log n) is not referring to the…
Henry
  • 727
  • 1
  • 6
  • 25
0
votes
1 answer

Inductively Defining Sets of Strings

CS student slogging through a logic class. This question has me befuddled Inductively Defining Sets of Strings Find an inductive definition for the following set of strings: S = {apbcr | p is a natural number, and r is a natural number greater than…
0
votes
2 answers

Algebra Help on Inductive Proof?

I am trying to learn inductive proofs for a test tomorrow. I am trying to understand a solution for a problem in a book, but my math is a bit rusty. Can somebody explain how these are all equal? I don't understand how the last equation was found…
danb
  • 55
  • 2
  • 10
0
votes
1 answer

How to get an induction principle for nested fix

I am working with a function that searches through a range of values. Require Import List. (* Implementation of ListTest omitted. *) Definition ListTest (l : list nat) := false. Definition SearchCountList n := (fix f i l := match i with | 0 =>…
scubed
  • 307
  • 3
  • 10