This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Mon Sep 21 14:56:39 2020 | |
| Kelly Criterion functions | |
| @author: johnx | |
| """ | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Generate yacht hull lines using Letcher's method with all curves defined | |
| % analytically using Bezier curves | |
| % | |
| % | |
| % | |
| % Input(s) | |
| % fName: Name of Excel file containing Bezier points | |
| % | |
| % Output(s) | |
| % BezStruct: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Generates Bezier polynomials in x and y for use in Geogebra | |
| % | |
| % | |
| % Input(s) | |
| % n: Degree of Bezier curve | |
| % | |
| % Output(s) | |
| % cStr: String used to define Bezier curve in Geogebra | |
| % | |
| % Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| turtles-own [speed radius turn-angle] | |
| to setup | |
| setup-circle | |
| reset-ticks | |
| end | |
| to setup-circle | |
| clear-all | |
| set-default-shape turtles "dot" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Additive partitions of integers | |
| Inputs: | |
| t: Integer (Target number) | |
| c: Number of elements in the sum (Size of the cage) | |
| u: Solutions must contain unique entries if set (Set u=0 if cage spans multiple rows or columns) | |
| e: Exclusion set (numbers will not appear in output list) | |
| n: Maximum integer in the sum partition (Size of the KenKen puzzle, default = 9) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Filters vectors for KenKen game | |
| Inputs | |
| v: vector | |
| c: Number of elements in the sum (size of the KenKen cell) | |
| n: Maximum value in the sum (length of a side in the game) | |
| u: T/F flag for uniqueness. Set if the cell is contained in a single row or column | |
| e: Exclusion set vector. Numbers appearing in the same row or column as the cell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Returns a vector of the unique elements of v | |
| Input | |
| v: vector | |
| Output | |
| u: Vector of unique elements of v | |
| Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Returns the number of multiplicative partitions of integer n | |
| Ref: https://oeis.org/A001055 | |
| https://oeis.org/A162247 | |
| https://oeis.org/A162247/a162247.txt | |
| Inputs: | |
| n: Non-negative integer | |
| m: Maximum factor (optional) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Returns the multiplicative partition of integer n | |
| Ref: https://oeis.org/A001055 | |
| https://oeis.org/A162247 | |
| https://oeis.org/A162247/a162247.txt | |
| Inputs: | |
| n: Non-negative integer | |
| Output: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Multiplicative partitions of integers | |
| Inputs: | |
| t: Integer (Target number) | |
| c: Number of elements in the sum (Size of the cage) | |
| u: Solutions must contain unique entries if set (Set u=0 if cage spans multiple rows or columns) | |
| e: Exclusion set (numbers will not appear in output list) | |
| n: Maximum integer in the sum partition (Size of the KenKen puzzle, default = 9) | |
OlderNewer