[MD-sorular] matematik ve algoritma

Kadir GÜLEÇ kadir.gulec at spk.gov.tr
14 Kas 2008 Cum 11:00:14 EET


Merhaba,

Tam algoritmayı çıkaramadım
Ama bir taslak vermek istiyorum

// Çağırılırken M=1000000 değeri kullanılacak
Algoritma P1M(M)

   n=0
   bul=false
   While (not bul)
      n=n+1
      tp=P(n)
      k=tp mod M
      if k=0 then bul=true
   End
   return n

End P1M

Algoritma P(n)

  t=0
  // P(N) değeri n elemanının 1,2,3,...n parçaya ayrıldığında elde edilen 
  // değerlerin toplamından oluşur
  for i=1 to n
    t=t+PX(n,i)
  end for  

End P 

Algoritma PX(n,i)

  // 1 parça (i=1) veya parça sayısı eleman sayısına eşit ise
  // 1 tane dağılım vardır
  if i<=1 or n>=i then return 1
  
  // Dağılım sayısını hesapla
  t=0
  // ilk parça k elemandan oluşsun
  // k=1 den başlayıp geriye i-1 eleman kalana kadar
  // n-k=i-1 olana kadar ilerleyecek
  // geriye n-k eleman ve i-1 parça kalır
  // n-k elamın i-1 parçaya dağılımını toplama ekle
  for k=1 to n-i+1
    t=t+PX(n-k,i-1)
  end for
  return t

End PX

Algoritmanın eksiği
Yinelenen dağılımları da hesaba katmasıdır
Yinelenen dağılımların nasıl saptanacağını bulamadım
Kolay gelsin



Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz dogrudan veya dolayli olarak mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve tum kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Sermaye Piyasasi Kurulu' nun (SPK) goruslerini yansitmadigi gibi, SPK' yi baglayici da degildir. Bu mesajin icerisinde ya da eklerinde yer alan bilgilerin dogrulugu, butunlugu ve guncelligi SPK tarafindan garanti edilmemektedir ve bilinen viruslere karsi kontrolleri yapilmis olarak yollanan mesajin sitenizde yaratabilecegi zararlardan SPK sorumlu tutulamaz.

This email is intended solely for the use of the individual or entity to whom it is adressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distrubute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. The Capital Markets Board of Turkey (CMB) does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by the CMB. The CMB does not warrant the accuracy, integrity and currency of the information transmitted with this message. This message has been detected for all known computer viruses thence CMB is not liable for the occurrence of any system corruption caused by this message.



MD-sorular mesaj listesiyle ilgili daha fazla bilgi