This file contains 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
public void fropple() { | |
ListElement d = head; | |
int i = (getSize() % 2 == 0) ? getSize() : getSize() - 1; | |
while (i > 1) { | |
if (i-- % 2 == 0) { | |
Object temp = d.getFirst(); | |
d.setValue(d.getNext().getFirst()); | |
d.getNext().setValue(temp); | |
} | |
d = d.getNext(); |
This file contains 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
(define (discriminant a b c) | |
(- (expt b 2) (* 4 a c))) | |
(define (wortel a b c) | |
(if (> (discriminant a b c) 0) | |
(list (/ (- (- b) (sqrt (discriminant a b c))) (* 2 a)) (/ (+ (- b) (sqrt (discriminant a b c))) (* 2 a))) | |
(if (= (discriminant a b c) 0) | |
(/ (- (- b)) (* 2 a)) | |
"Imagine a solution"))) | |
This file contains 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
library(lpSolveAPI) | |
# Input | |
n <- 3 # n is cross-section | |
d <- 5 # number of worst case losses (based on the marginal; to be matched - dependence is unknown ) | |
# simple example | |
# Create matrix with identical rows, filled with inverse probabilities | |
data <- matrix(1 : d, | |
ncol = n, |