config root man

Current Path : /home/design/public_html/

Linux rs105.nsresponse.com 3.10.0-614.10.2.lve1.4.55.el7.x86_64 #1 SMP Tue Jun 20 08:59:12 EDT 2017 x86_64
Upload File :
Current File : /home/design/public_html/random4-liniar.php

<?php
//$a1=array(2.7, 2.6 ,2.5, 2.4, 2.3, 2.2, 2.1, 2, 2); // liniar

$a1=array(3, 2.6 ,2.39, 2.258, 2.164, 2.1, 2, 2, 2); // parabolic

$sansa=12;
$suma_initiala=0.2;
$numar_meciuri=1600;

$ppi=0;
$pp=$suma_initiala;

// Aici se calculeaza pierderea. Pierderea se calculeaza doar odata.
for ($i2 = 0; $i2 <= 8; $i2++) {
	$ppi=$ppi+$pp;
	$pp=$pp*$a1[$i2];
}
	



echo "Sansa: 1 din ".$sansa."<br />Suma initiala: ".$suma_initiala."<br />Numar de meciuri: ".$numar_meciuri."<br /><br />";


$p=0; //pierdere
$i=1;
$total_castiguri=0; //profit total
$total_pierderi=0; //pierdere total

$total_castiguri2=0; //profit total model 2
$total_pierderi2=0; //pierdere total model 2

$total_castiguri3=0; //profit total model 3
$total_pierderi3=0; //pierdere total model 3


while ($i<=$numar_meciuri) {
$rezultat_random=mt_rand(1,$sansa);	

if ($rezultat_random!=$sansa) {
	$ssi=0;
	$ss=$suma_initiala; //suma start
	
	$rezultat_random_interval=mt_rand(0,8);
		
	
	// aici se calculeaza suma investita
	for ($i2 = 0; $i2 <= $rezultat_random_interval; $i2++) {
		$ssi=$ssi+$ss; // se aduma suma
		$ss=$ss*$a1[$i2]; // se multiplica dupa valorile din array a1
		}
		
	$ss=$ss/$a1[$rezultat_random_interval];
	$c=$ss*3; // castig (fara profit)
	$p=$c-$ssi; // profit
	$r21=$rezultat_random_interval+1; // interval
	
	// aici se scoate din calcul intervalul 0-10; 10-20;
	if (($rezultat_random_interval!=0) or ($rezultat_random_interval!=1)) 	{
		$p2=$p+0.8; // 0.8 inseamna investitia totala in pasul 2
	}
	if (($rezultat_random_interval==0) or ($rezultat_random_interval==1)) 	{
		$p2=0;
	}

	// aici se scoate din calcul intervalul 0-10; 10-20; 20-30
	if (($rezultat_random_interval!=0) or ($rezultat_random_interval!=1) or ($rezultat_random_interval!=2)) 	{
		$p3=$p+2.36; // 2.36 inseamna investitia totala in pasul 2
	}
	if (($rezultat_random_interval==0) or ($rezultat_random_interval==1) or ($rezultat_random_interval==2)) 	{
		$p3=0;
	}



	echo $i.". intervalul ".$rezultat_random_interval."0-".$r21."0 ..... investit total: ".round($ssi,2)." ..... ultima investitie: ".round($ss,2)." ..... castig brut: ".round($c,2)." ..... Profit net: ".round($p,2)." sau ".round($p2,2)." sau ".round($p3)."<br />";
	$total_castiguri=$total_castiguri+$p;
	$total_castiguri2=$total_castiguri2+$p2;
	$total_castiguri3=$total_castiguri3+$p3;
	}

// aici se afiseaza si se aduna pierderile.
if ($rezultat_random==$sansa) {
	$ppi2=$ppi-0.8; // 0.8 inseamna investitia totala in pasul 2
	$ppi3=$ppi-2.36; // 2.36 inseamna investitia totala in pasul 2
	echo $i.". PIERDERE: ".round($ppi,2)." sau ".round($ppi2,2)." sau ".round($ppi3,2)."<br />";
	$total_pierderi=$total_pierderi+$ppi;
	$total_pierderi2=$total_pierderi2+$ppi2;
	$total_pierderi3=$total_pierderi3+$ppi3;
	}


$i++;
}
$total=$total_castiguri-$total_pierderi;
$total2=$total_castiguri2-$total_pierderi2;
$total3=$total_castiguri3-$total_pierderi3;
echo "<br /><br />
TOTAL CASTIGURI: ".round($total_castiguri,2)." sau ".round($total_castiguri2,2)." sau ".round($total_castiguri3,2)."<br />
TOTAL PIERDERI: ".round($total_pierderi,2)." sau ".round($total_pierderi2,2)." sau ".round($total_pierderi3,2)."<br /><br />

PROFIT NET LA FINAL: ".round($total,2)." sau ".round($total2,2)." sau ".round($total3,2)."<br /><br />";

echo "<a href='random3-rezultat.php?sansa=".$sansa."&suma_initiala=".$suma_initiala."&numar_meciuri=".$numar_meciuri."'>recalculeaza</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='random3.php'>inapoi la formular</a>"
?>

Man Man