谁会用matlab编一个双色球彩票的程序

谁会用matlab编一个双色球彩票的程序,第1张

再修改一次,程序在这儿.PHP版消镇正的双色球代码。

http://hi.baidu.com/tianfan/blog/item/1c637f81c96990dcbd3e1e20.html

______________________________________________

我也想知道......

简单的来说,只要按拿悔照彩票的玩法规则写一个运算过程就OK了.都是随机数,没什么太大意义

---------------------------------------------

我刚写旅滑了个在PHP环境下获取双色球号码的程序。

不知道你会PHP不。可以看看

福利彩票选号的Matlab模拟程序

%

axes('position',[0.1,0.8,0.8,0.1])

text(0,0,'模拟3D彩票','fontsize',18)

axis off

axes('position',[0.6,0.8,0.3,0.2],'Visible','off')

bb=text(0.1,0.5,'0','fontsize',24)q=0

axes('position',[0.3,0.23,0.6,0.1])

tt=text(0,0,'please press "space" to stop!',...

'fontsize',18)

axis off

axes('position',[0.1,0.4,0.2,0.3])

t1=text(0.3,0.5,'3','fontsize',60)

box on

set(gca,'xtick',[],'ytick',[])

set(gca,'xticklabel',[],'yticklabel',[])

axes('position',[0.4,0.4,0.2,0.3])

t2=text(0.3,0.5,'3','fontsize',60)

box on

set(gca,'xtick',[],'ytick',[])

set(gca,'xticklabel',[],'yticklabel',[])

axes('position',[0.7,0.4,0.2,0.3])

t3=text(0.3,0.5,'3','fontsize',60)

box on

set(gca,'xtick',[],'ytick',[])

set(gca,'xticklabel',[],'yticklabel',[])

set(gcf,'doublebuffer','on')

k=1DD=[]

fid = fopen('save_data.txt','wt')

while k

s=get(gcf,'currentkey')

if strcmp(s,'space')

clck=0

end

d=fix(rand(1,3)*10*(1-eps))

a=num2str(d(1))

b=num2str(d(2))

c=num2str(d(3))

set(t1,'string',a)

set(t2,'string',b)

set(t3,'string',c)

set(tt,'color',rand(1,3))

q=q+1set(bb,'string',num2str(q))

p=num2str(d)

fprintf(fid,'%c',p)

fprintf(fid,'%c\慎腊n',' ')

DD=[DDd]

pause(0.2)

end

fclose(fid)

figure(gcf)

figure

plot(1:size(DD,1),DD(:,1),'rs','MarkerFaceColor','r')

legend('first')

figure

plot(1:size(DD,1),DD(:,2),'gs','MarkerFaceColor','g')

legend('second')

figure

plot(1:size(DD,1),DD(:,3),'bs'禅圆,'MarkerFaceColor','b')

legend('贺孝塌third')

dos('save_data.txt')

delete save_data.txt

一等奖的概率为(1/10)×(1/10)×(1/10)×(1/10)×(1/10)×(1/春察10)×(1/5)

=1/5000000

二等奖的概率为(1/10)×(1/10)×(1/10)×(1/10)×(1/10)×(1/10)

=1/1000000

三等奖的概率为(1/10)×(1/10)×(1/10)×(1/扒敬茄10)×(1/10)×(9/10)×6

=54/1000000=27/500000

四等奖的概率为(1/10)×(1/10)×(1/10)×(1/10)×(9/10)×(9/10)×15

=1215/100000=243/200000

五等奖的概率为(1/10)×(1/10)×(1/10)×(9/10)×(9/10)×(9/10)×20

=14580/1000000=729/50000

六等奖的概率为稿御(1/10)×(1/10)×(9/10)×(9/10)×(9/10)×(9/10)×15

=98415/1000000=19683/200000


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12515859.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-26
下一篇 2023-05-26

发表评论

登录后才能评论

评论列表(0条)

保存