MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Inspired by the Problem 1713 by Chris E.

Here is the code that generates the first lottery number:

rng('shuffle'); number1=randi([10,20]); for j=1:number1 round(rand(1,1)); end

Can you find the number even with the rng('shuffle')?

As everybody knows hacking methods, I prefer a logical solution.

Good luck!

15 correct solutions
21 incorrect solutions

Last solution submitted on Feb 03, 2015

4 players like this problem

1 Comment

Armando Villani
on 22 Jun 2014

"rng(stream.Seed);" instead of "rng(stream.get('Seed'));" gives a lower code size of 24.

2 Comments

Armando Villani
on 22 Jun 2014

Why not "s.State(end)=0;" instead of "s.State(end)=s.State(end)-s.State(end);"?

Jean-Marie SAINTHILLIER
on 11 Jul 2014

At that time, I didn't understand the stream correctly...

1 Comment